CN112769889B - Service data pushing method and device, storage medium and electronic device - Google Patents

Service data pushing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN112769889B
CN112769889B CN202011300195.3A CN202011300195A CN112769889B CN 112769889 B CN112769889 B CN 112769889B CN 202011300195 A CN202011300195 A CN 202011300195A CN 112769889 B CN112769889 B CN 112769889B
Authority
CN
China
Prior art keywords
node
service data
state
receiving node
target service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011300195.3A
Other languages
Chinese (zh)
Other versions
CN112769889A (en
Inventor
杨军库
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202011300195.3A priority Critical patent/CN112769889B/en
Publication of CN112769889A publication Critical patent/CN112769889A/en
Application granted granted Critical
Publication of CN112769889B publication Critical patent/CN112769889B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a method, a device, a storage medium and an electronic device for pushing service data, wherein the method comprises the following steps: the method comprises the steps of acquiring the running state of a first node under the condition that it is determined that target service data needs to be pushed to a receiving node, pushing the target service data to the receiving node under the condition that the first node is in a first running state, and stopping pushing the target service data to the first node under the condition that the first node is in a second running state.

Description

Service data pushing method and device, storage medium and electronic device
Technical Field
The embodiment of the invention relates to the field of communication, in particular to a method and a device for pushing service data, a storage medium and an electronic device.
Background
Webhook is an api (application programming interface) concept, also called reverse api, that is: the terminal does not actively send the request, and the server completely carries out back-end pushing.
In a conventional service data push process, a client requests data from a server, and then the server provides the client with the data. In WebHook, the server updates the resources that need to be provisioned and then automatically pushes them as service data to the client, which is not the requestor but the passive recipient. This reversal of the control relationship may be used to facilitate many communication requests that would otherwise require more complex requests and constant polling on the remote server.
However, when data and messages are pushed in the WebHook fashion, cascading failures of the entire system can result when one or more services are unavailable or exhibit high latency. Retry logic for push services only makes the situation worse and may lead to a complete crash of the system.
Aiming at the technical problems that the data of the push service in the related technology is easy to cause cascade faults and the push service is difficult to finish efficiently, an effective solution is not provided at present.
Disclosure of Invention
Embodiments of the present invention provide a method, an apparatus, a storage medium, and an electronic apparatus for pushing service data, so as to at least solve technical problems that cascading failures are easily caused by pushing service data and it is difficult to efficiently complete a push service in related technologies.
According to an embodiment of the present invention, a method for pushing service data is provided, including: acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node; under the condition that the first node is in a first operation state, pushing the target service data to the receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value; and terminating the pushing of the target service data to the first node under the condition that the first node is in a second operation state, wherein the second operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
According to another embodiment of the present invention, there is provided a service data pushing apparatus, including: the acquisition module is used for acquiring the running state of the first node under the condition that the target service data needs to be pushed to the receiving node; the pushing module is used for pushing the target service data to the receiving node under the condition that the first node is in a first running state, wherein the first running state is used for indicating that the number of times of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value; and a terminating module, configured to terminate, when the first node is in a second operating state, pushing the target service data to the first node, where the second operating state is used to indicate that the number of times that the service data pushed to the receiving node is continuously abnormal is greater than a first threshold.
According to a further embodiment of the invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of any of the method embodiments described above.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps in any of the method embodiments described above when executing the computer program.
According to the invention, the operation state of the first node is obtained under the condition that the target service data needs to be pushed to the receiving node, the target service data is pushed to the receiving node under the condition that the first node is in the first operation state, and the target service data is finally pushed to the first node under the condition that the first node is in the second operation state, so that the technical problems that cascade faults are easily caused by the pushed service data and the pushed service is difficult to finish efficiently in the related technology can be solved, the cascade faults of multiple systems are favorably prevented, a system with high fault tolerance and elasticity is constructed, when the key service is unavailable or has high delay, the system can still run normally, the technical effects of improving the robustness and stability of the data pushing service and realizing the high availability of the service are achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention to a proper form. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal according to an alternative service data push method in an embodiment of the present invention;
fig. 2 is a flow chart illustrating an alternative service data pushing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an alternative service data pushing method according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating an alternative push apparatus for service data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an alternative electronic device according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings in conjunction with the embodiments.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided in the embodiments of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking an example of the present invention running on a mobile terminal, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data, wherein the mobile terminal may further include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those of ordinary skill in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used for storing computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the service data pushing method in the embodiment of the present invention, and the processor 102 executes the computer programs stored in the memory 104 to execute various functional applications and data processing, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for pushing service data running on a mobile terminal, a computer terminal, or a similar operation device is provided, and fig. 2 is a schematic flow chart of an alternative method for pushing service data according to an embodiment of the present invention, as shown in fig. 2, the flow chart includes the following steps:
s202, acquiring the running state of the first node under the condition that the target service data needs to be pushed to the receiving node;
s204, under the condition that the first node is in a first running state, pushing the target service data to the receiving node, wherein the first running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value;
and S206, under the condition that the first node is in a second running state, terminating the pushing of the target service data to the first node, wherein the second running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
The main body of executing the above steps may be a base station, a terminal, and the like, but is not limited thereto.
Optionally, in this embodiment, the receiving nodes may include, but are not limited to, one or more receiving nodes, and may be preconfigured by a worker in the process of erecting the service push system.
Optionally, in this embodiment, the target service data may correspond to one receiving node, or the same target service data may correspond to multiple receiving nodes.
Optionally, in this embodiment, the first node may include, but is not limited to, a breaker controlled in an application program form.
Optionally, in this embodiment, the operation state of the first node may include, but is not limited to, an open (open) state, a closed (close) state, a half open (half open) state, and the like, and may be preconfigured by an operator according to an application scenario or a type of service to be pushed by the server.
Optionally, in this embodiment, the first operating state is used to indicate that the number of times that the service data pushed to the receiving node is continuously abnormal is less than or equal to a first threshold, that is, when it is detected that the number of times that the service data pushed to the receiving node is continuously abnormal is less than or equal to the first threshold, the operating state of the first node is determined as the first operating state, and the first threshold may be configured in advance according to an application scenario or a type of a service to be pushed by the server.
Optionally, in this embodiment, the terminating pushing the target service data to the first node may include, but is not limited to, terminating pushing the target service data to the first node, and may also include, but is not limited to, terminating pushing the target service data to a receiving node, and the like.
The above is merely an example, and the present embodiment is not limited in any way.
Optionally, in this embodiment, the second operation state is used to indicate that the number of times that the service data pushed to the receiving node continuously generates the abnormality is greater than a first threshold, that is, in a case that it is detected that the number of times that the service data pushed to the receiving node continuously generates the abnormality is greater than the first threshold, the operation state of the first node is determined as the second operation state.
According to the embodiment, the operation state of the first node is obtained under the condition that the target service data needs to be pushed to the receiving node, the target service data is pushed to the receiving node under the condition that the first node is in the first operation state, and the target service data is stopped being pushed to the first node under the condition that the first node is in the second operation state, so that the technical problems that cascade faults are easily caused by the pushing of the service data and the pushing of the service is difficult to finish efficiently in the related technology can be solved, the cascade faults of multiple systems are favorably prevented, a system with high fault tolerance and elasticity is built, when key services are unavailable or have high delay, the system can still run normally, the robustness and the stability of the data pushing service are improved, and the technical effect of high availability of the service is achieved.
As an optional solution, after pushing the target service data to the receiving node, the method further includes: detecting the times of continuous abnormity of the service data pushed to the receiving node; determining the running state of the first node as a first running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be less than or equal to a second threshold value, wherein the second threshold value is less than the first threshold value, and the first running state comprises the first running sub-state; determining the running state of the first node as a second running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the second threshold and smaller than the first threshold, wherein the first running state comprises the second running sub-state; and determining the running state of the first node as the second running state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the first threshold value.
Optionally, in this embodiment, the state of the first node is determined by whether an exception occurs in the service data in the process of pushing the service data before.
Optionally, in this embodiment, the detecting the number of times that the service data pushed to the receiving node continuously generates the abnormality may be performed by a server or a terminal, taking the server as an execution subject, in the detecting process, determining whether the service data generates the abnormality by obtaining a sending duration taken for sending the service data last time or whether the sent service data is available, recording a number of times of the abnormality once when the service data generates the abnormality, determining that the operating state of the first node is the first operating sub-state when the number of times of the continuous occurrence of the abnormality is less than or equal to a second threshold, and determining that the operating state of the first node is the second operating sub-state when the number of times of the continuous occurrence of the abnormality is greater than the second threshold and less than the first threshold.
For example, the second threshold may be set to 0, that is, when no abnormality occurs continuously, the state of the first node may be set to the first operation sub-state, and when an abnormality occurs once, the state of the first node may be set to the second operation sub-state.
According to the embodiment, the method comprises the steps of detecting the continuous abnormal times of the service data pushed to the receiving node; determining the running state of the first node as a first running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be less than or equal to a second threshold value, wherein the second threshold value is less than the first threshold value, and the first running state comprises the first running sub-state; determining the running state of the first node as a second running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than a second threshold value and smaller than a first threshold value, wherein the first running state comprises the second running sub-state; the method comprises the steps of determining the running state of a first node as a second running state under the condition that the number of times of continuous abnormal occurrence of service data pushed to a receiving node is detected to be larger than a first threshold value, and determining the running states of different first nodes aiming at different abnormal times so as to solve the problems of robustness and stability of data pushing service.
As an optional scheme, after obtaining the operating state of the first node, the method further includes: under the condition that the first node is in the second running state, pushing preset data to the receiving node; detecting whether the preset data pushed to the receiving node is abnormal or not; under the condition that the predetermined data pushed to the receiving node is determined not to be abnormal, adjusting the state of the first node to be the first running state; and maintaining the state of the first node as the second running state when determining that the predetermined data pushed to the receiving node is abnormal.
Optionally, in this embodiment, the predetermined data may include, but is not limited to, the service data to be pushed acquired when the first node is in the second operating state, and may also include, but is not limited to, test data used for detecting whether an abnormality occurs.
For example, the predetermined data may be configured as data of a single byte, but is not limited thereto, to test whether the flow of the current service push is normal, and may also include, but is not limited to, using part or all of the service data to be pushed to test whether the flow of the current service push is normal.
When part or all of the service data to be pushed is used as predetermined data, once the detection result shows that no abnormality occurs, the state of the first node can be adjusted to be a first running state, and the service data can be sent.
When the single-byte data is used as the predetermined data, once the detection result shows that no abnormality occurs, the state of the first node can be adjusted to be the first running state, and the subsequent service data to be pushed is continuously sent.
Through the embodiment, the preset data is pushed to the receiving node under the condition that the first node is in the second running state; detecting whether the preset data pushed to the receiving node is abnormal or not; under the condition that the preset data pushed to the receiving node is determined not to be abnormal, the state of the first node is adjusted to be a first running state; when the predetermined data pushed to the receiving node is determined to be abnormal, the state of the first node is maintained to be the second operation state, so that the technical problems that the data of the push service existing in the related technology is easy to cause cascade faults and the push service is difficult to finish efficiently can be solved, the cascade faults across a plurality of systems can be prevented, a system with high fault tolerance and elasticity can be built, when the key service is unavailable or has high delay, the system can still operate normally, the technical effects of improving the robustness and stability of the data push service and realizing the high availability of the service can be achieved.
As an optional scheme, after obtaining the operating state of the first node, the method further includes: under the condition that the first node is in the second running state, pushing preset data to the receiving node; detecting the continuous abnormal times of the preset data pushed to the receiving node; when detecting that the number of times of continuous abnormity of the preset data pushed to the receiving node is smaller than a third threshold value, adjusting the state of the first node to be the first running state; and maintaining the state of the first node as the second operation state under the condition that the number of times of continuous abnormity of the preset data pushed to the receiving node is greater than or equal to the third threshold value.
Optionally, in this embodiment, the method may further include, but is not limited to, detecting a state where the predetermined data is abnormal multiple times, and adjusting the state of the first node to the first operating state only when the number of times that the predetermined data is abnormal continuously is less than or equal to a third threshold.
For example, the number of times of continuous occurrence of an abnormality in the predetermined data may be set to be less than 1 time, that is, when an abnormality does not occur continuously in the predetermined data, the state of the first node may be adjusted to the first operation state, and when an abnormality occurs continuously, the state of the first node may be maintained to the second operation state.
The method may further include adjusting the state of the first node to the first operating state when the number of times of continuous occurrence of the anomaly of the predetermined data is less than 3 times, that is, when the number of times of continuous occurrence of the anomaly of the predetermined data is less than 3 times, maintaining the state of the first node to a second operating state when the number of times of continuous occurrence of the anomaly of the predetermined data is greater than or equal to 3 times, so that the service push system may have a certain fault tolerance, may attempt to continue to push the service even when the number of continuous occurrences of the anomaly is greater than or equal to 3 times, and may expand an application range of the service push method when the service data to be pushed is critical service data.
Through the embodiment, the preset data is pushed to the receiving node under the condition that the first node is in the second running state; detecting the number of times of continuous abnormity of the preset data pushed to the receiving node; under the condition that the number of times of continuous abnormity of the preset data pushed to the receiving node is detected to be less than or equal to a third threshold value, the state of the first node is adjusted to be a first running state; when the number of times of continuous abnormity of the preset data pushed to the receiving node is larger than a third threshold value, the state of the first node is maintained to be a second operation state, so that the technical problems that cascade faults are easily caused by the data of the push service in the related technology and the push service is difficult to finish efficiently can be solved, cascade faults across a plurality of systems can be prevented, a system with high fault tolerance and elasticity is constructed, and when the key service is unavailable or has high delay, the system can still operate normally, so that the technical effects of improving the robustness and stability of the data push service and realizing the high availability of the service are achieved.
As an optional solution, after the target service data is pushed to the receiving node while the first node is in the first operating state, the method further includes: acquiring the sending time length for pushing the target service data; and determining that the service data pushed to the receiving node is abnormal under the condition that the sending duration is greater than or equal to a first duration threshold.
Optionally, in this embodiment, the sending duration may include, but is not limited to, the receiving node actively feeding back to the execution main body of the push service, and may also include, but is not limited to, the execution main body of the push service sending an acquisition message to the receiving node, so that the receiving node returns a message for recording the sending duration to the execution main body of the push service.
Optionally, in this embodiment, the first time threshold may be preset by a worker according to an actual situation or an application scenario, and may also be dynamically adjusted according to an importance level of a current service to be pushed or a number of services to be pushed.
According to the embodiment, the sending time length for obtaining the pushed target service data is adopted; when the sending time length is greater than or equal to the first time length threshold value, the service data pushed to the receiving node is determined to be abnormal, so that the technical problems that cascade faults are easily caused by the pushed service data in the related technology and the pushed service is difficult to finish efficiently can be solved, the cascade faults of a plurality of systems can be prevented, a system with high fault tolerance and elasticity is constructed, when the key service is unavailable or has high delay, the system can still operate normally, the technical effects of improving the robustness and stability of the data pushed service and realizing the high availability of the service are achieved.
As an optional solution, after the target service data is pushed to the receiving node while the first node is in the first operating state, the method further includes: acquiring the running state of a target service corresponding to the target service data, wherein the running state of the target service comprises an available state and an unavailable state; and determining that the target service data pushed to the receiving node is abnormal under the condition that the target service is in an unavailable state.
Optionally, in this embodiment, the operation state of the target service may include, but is not limited to, the receiving node actively feeding back to an execution subject of the push service, and may also include, but is not limited to, the execution subject of the push service sending an acquisition message to the receiving node, so that the receiving node returns a message recording the operation state of the target service to the execution subject of the push service, and may also include, but is not limited to, a server acquiring an operation state of an application program associated with the target service to determine whether the target service data is abnormal.
According to the embodiment, the running state of the target service corresponding to the acquired target service data is adopted, wherein the running state of the target service comprises an available state and an unavailable state; when the target service is in an unavailable state, the target service data pushed to the receiving node is determined to be abnormal, so that the technical problems that cascade faults are easily caused by the pushed service data in the related technology and the pushed service is difficult to finish efficiently can be solved, the cascade faults across multiple systems can be prevented, a system with high fault tolerance and elasticity is constructed, when the key service is unavailable or has high delay, the system can still normally operate, the technical effects of improving the robustness and stability of the data pushing service and realizing the high availability of the service are achieved.
The invention is further explained below with reference to specific examples:
fig. 3 is a flow diagram illustrating an alternative pushing method of service data according to an embodiment of the present invention, and as shown in fig. 3, the flow includes the following steps:
when a data push service (corresponding to an execution main body of the push method of the service data) sends data to a receiving data service A (corresponding to the receiving node), the data is directly sent to the receiving data service A through a breaker (corresponding to the first node) if the breaker of the A is in an open (corresponding to the first operation sub-state), and the state of the breaker is still open when the data is sent without timeout or abnormal conditions;
when the data pushing service sends data to a receiving data service B (corresponding to the receiving node), the data is directly sent to the receiving data service B through a breaker if the breaker of the B is in an open state, and when the data is sent, overtime or abnormal conditions occur, a short-circuiting device of the B is in a HalfOpen (corresponding to the second operation sub-state), the data pushing of the data service B is not influenced in the HalfOpen state, and only abnormal times are recorded;
when the data push service sends data to the data receiving service B, the data push service is sent to the data receiving service B through the breaker if the breaker of the B is in a HalfOpen state, and the state of the breaker is changed from the HalfOpen state to an open state when no overtime or abnormal condition exists during data sending;
when the data push service sends data to the data receiving service B, the data push service sends the data receiving service B through the breaker, if the breaker of B is in a HalfOpen state, the data push service sends the data receiving service B, and when the data is sent, overtime or abnormal conditions occur, and the threshold value exceeds unit time, the state of the breaker is changed into a Close state (corresponding to the second running state) from the HalfOpen state;
when the data pushing service sends data to a receiving data service C (corresponding to the receiving node), the data pushing service can regularly send a piece of data (corresponding to the preset data) to the receiving data service C through a breaker if the breaker of C is in a Close state, when the data is sent, overtime or abnormal conditions occur, the data pushing service is stopped sending the data to the receiving data service C, and the state of the breaker C is not changed and is still in the Close state;
when the data pushing service sends data to the data receiving service C, the data pushing service can regularly send a piece of data to the data receiving service C through the breaker if the breaker of the C is in a Close state, and when the data is sent, no overtime or abnormal condition occurs, the state of the breaker of the C is changed into an Open state.
By the embodiment, the problems of robustness and stability of the data push service under the condition that the received data service is overtime or abnormal due to various reasons in the Webhook mode can be solved, and high availability of the service is realized.
In addition, the set judgment mechanism is simple and convenient, the problem that the system has catastrophic cascading failure in the Webhook mode can be efficiently solved, the fault tolerance of the system (including a distributed system) in the Webhook mode can be improved, and the elasticity of the system (including the distributed system) in the Webhook mode can be increased.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus necessary general hardware platform, but may also be implemented by hardware, but in many cases, the former is a better embodiment. Based on this understanding, the technical solutions of the present invention or portions thereof contributing to the prior art may be embodied in the form of software products, which are stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and include instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the methods described in the embodiments of the present invention.
In this embodiment, a device for pushing service data is further provided, where the device is used to implement the foregoing embodiment and the preferred embodiments, and details of the foregoing description are omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram illustrating an alternative pushing apparatus for service data according to an embodiment of the present invention, and as shown in fig. 4, the apparatus includes:
an obtaining module 402, configured to obtain an operating state of a first node when it is determined that target service data needs to be pushed to a receiving node;
a pushing module 404, configured to, when the first node is in a first operating state, push the target service data to the receiving node, where the first operating state is used to indicate that the number of times that the service data pushed to the receiving node continuously generates an abnormality is smaller than or equal to a first threshold;
a terminating module 406, configured to terminate pushing the target service data to the first node when the first node is in a second operating state, where the second operating state is used to indicate that the number of times that the service data pushed to the receiving node continuously generates an exception is greater than a first threshold.
As an optional solution, after pushing the target service data to the receiving node, the apparatus is further configured to: detecting the times of continuous abnormity of the service data pushed to the receiving node; determining the running state of the first node as a first running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be less than or equal to a second threshold value, wherein the second threshold value is less than the first threshold value, and the first running state comprises the first running sub-state; determining the running state of the first node as a second running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the second threshold and smaller than the first threshold, wherein the first running state comprises the second running sub-state; and determining the running state of the first node as the second running state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the first threshold value.
As an optional solution, after obtaining the operating state of the first node, the apparatus is further configured to: under the condition that the first node is in the second running state, pushing preset data to the receiving node; detecting whether the preset data pushed to the receiving node is abnormal or not; under the condition that the predetermined data pushed to the receiving node is determined not to be abnormal, adjusting the state of the first node to be the first running state; and maintaining the state of the first node as the second operation state when determining that the predetermined data pushed to the receiving node is abnormal.
As an optional solution, after obtaining the operating state of the first node, the apparatus is further configured to: under the condition that the first node is in the second running state, pushing preset data to the receiving node; detecting the number of times of continuous abnormity of the preset data pushed to the receiving node; when the number of times of continuous abnormity of the preset data pushed to the receiving node is detected to be smaller than a third threshold value, adjusting the state of the first node to be the first running state; and maintaining the state of the first node as the second operation state under the condition that the number of times of continuous abnormity of the preset data pushed to the receiving node is greater than or equal to the third threshold value.
As an optional solution, after the target service data is pushed to the receiving node while the first node is in the first operating state, the apparatus is further configured to: acquiring the sending time length for pushing the target service data; and determining that the service data pushed to the receiving node is abnormal under the condition that the sending duration is greater than or equal to a first duration threshold.
As an optional solution, after the target service data is pushed to the receiving node while the first node is in the first operating state, the apparatus is further configured to: acquiring the running state of a target service corresponding to the target service data, wherein the running state of the target service comprises an available state and an unavailable state; and determining that the target service data pushed to the receiving node is abnormal under the condition that the target service is in an unavailable state.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the method for pushing service data, where the electronic device may be a terminal device or a server shown in fig. 1. The present embodiment takes the electronic device as a server as an example for explanation. As shown in fig. 5, the electronic device comprises a memory 502 and a processor 504, the memory 502 having a computer program stored therein, the processor 504 being arranged to perform the steps of any of the above method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic device may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node;
s2, under the condition that the first node is in a first operation state, pushing target service data to a receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value;
and S3, under the condition that the first node is in a second running state, stopping pushing the target service data to the first node, wherein the second running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 5 is a diagram illustrating a structure of the electronic apparatus. For example, the electronics may also include more or fewer components (e.g., network interfaces, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
The memory 502 may be used to store software programs and modules, such as program instructions/modules corresponding to the service data pushing method and apparatus in the embodiment of the present invention, and the processor 504 executes various functional applications and data processing by running the software programs and modules stored in the memory 502, that is, implements the service data pushing method described above. The memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 502 may further include memory located remotely from the processor 504, which may be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. The memory 502 may be, but not limited to, specifically used for the target service data and the information such as the operating status of the first node. As an example, as shown in fig. 5, the storage 502 may include, but is not limited to, an obtaining module 402, a pushing module 404, and a terminating module 406 in a pushing device that includes the service data. In addition, the service data pushing apparatus may further include, but is not limited to, other module units in the service data pushing apparatus, which is not described in this example again.
Optionally, the transmission device 506 is used for receiving or sending data via a network. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 506 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 506 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In addition, the electronic device further includes: a display 508 for displaying the target service data information; and a connection bus 510 for connecting the respective module parts in the above-described electronic apparatus.
In other embodiments, the terminal device or the server may be a node in a distributed system, where the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting a plurality of nodes through a network communication. Nodes can form a Peer-To-Peer (P2P) network, and any type of computing device, such as an electronic device like a server or a terminal, can become a node in the blockchain system by joining the Peer-To-Peer network.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, where the computer program is arranged to, when executed, perform the steps in any of the above-mentioned method embodiments.
In the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node;
s2, under the condition that the first node is in a first operation state, pushing target service data to a receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value;
and S3, under the condition that the first node is in a second running state, stopping pushing the target service data to the first node, wherein the second running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
The computer readable storage medium is further arranged to store a computer program for performing the steps of:
s1, acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node;
s2, under the condition that the first node is in a first operation state, pushing target service data to a receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value;
and S3, under the condition that the first node is in a second running state, stopping pushing the target service data to the first node, wherein the second running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention further provide an electronic device, comprising a memory having a computer program stored therein and a processor configured to run the computer program to perform the steps of any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In an exemplary embodiment, the processor may be configured to perform the following steps by a computer program:
s1, acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node;
s2, under the condition that the first node is in a first operation state, pushing target service data to a receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value;
and S3, under the condition that the first node is in a second running state, stopping pushing the target service data to the first node, wherein the second running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented in program code that is executable by the computing devices, such that they may be stored in a memory device and executed by the computing devices, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into separate integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims (10)

1. A method for pushing service data is characterized by comprising the following steps:
acquiring the running state of a first node under the condition that target service data needs to be pushed to a receiving node;
under the condition that the first node is in a first operation state, pushing the target service data to the receiving node, wherein the first operation state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is less than or equal to a first threshold value; in the process of pushing the target service data to the receiving node, the target service data passes through the first node;
under the condition that the first node is in a second operation state, terminating the pushing of the target service data to the first node, wherein the second operation state is used for indicating that the number of times of continuous abnormity of the service data pushed to the receiving node is greater than a first threshold value;
wherein terminating the push of the target service data to the first node comprises: terminating pushing of the target service data to the receiving node;
wherein the target service data is discarded in case the pushing of the target service data to the receiving node is terminated.
2. The method of claim 1, wherein after pushing the target service data to the receiving node, the method further comprises:
detecting the times of continuous abnormity of the service data pushed to the receiving node;
determining the running state of the first node as a first running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be smaller than or equal to a second threshold value, wherein the second threshold value is smaller than the first threshold value, and the first running state comprises the first running sub-state;
determining the running state of the first node as a second running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the second threshold and smaller than the first threshold, wherein the first running state comprises the second running sub-state;
and determining the running state of the first node as the second running state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the first threshold value.
3. The method of claim 1, wherein after obtaining the operational status of the first node, the method further comprises:
under the condition that the first node is in the second running state, pushing preset data to the receiving node;
detecting whether the preset data pushed to the receiving node is abnormal or not;
under the condition that the predetermined data pushed to the receiving node is determined not to be abnormal, adjusting the state of the first node to be the first running state;
and maintaining the state of the first node as the second operation state when determining that the predetermined data pushed to the receiving node is abnormal.
4. The method of claim 1, wherein after obtaining the operational status of the first node, the method further comprises:
under the condition that the first node is in the second running state, pushing preset data to the receiving node;
detecting the continuous abnormal times of the preset data pushed to the receiving node;
when the number of times of continuous abnormity of the preset data pushed to the receiving node is detected to be smaller than a third threshold value, the state of the first node is adjusted to be the first running state;
and maintaining the state of the first node as the second operation state under the condition that the number of times of continuous abnormity of the predetermined data pushed to the receiving node is greater than or equal to the third threshold value.
5. The method according to any of claims 1 to 4, wherein after pushing the target service data to the receiving node with the first node in the first operational state, the method further comprises:
acquiring the sending duration for pushing the target service data;
and determining that the service data pushed to the receiving node is abnormal under the condition that the sending duration is greater than or equal to a first duration threshold.
6. The method according to any of claims 1 to 4, wherein after pushing the target service data to the receiving node with the first node in the first operational state, the method further comprises:
acquiring the running state of a target service corresponding to the target service data, wherein the running state of the target service comprises an available state and an unavailable state;
and determining that the target service data pushed to the receiving node is abnormal under the condition that the target service is in an unavailable state.
7. A pushing apparatus of service data, comprising:
the acquisition module is used for acquiring the running state of the first node under the condition that the target service data needs to be pushed to the receiving node;
the pushing module is used for pushing the target service data to the receiving node under the condition that the first node is in a first running state, wherein the first running state is used for indicating that the frequency of continuous abnormity of the service data pushed to the receiving node is smaller than or equal to a first threshold value; in the process of pushing the target service data to the receiving node, the target service data passes through the first node;
a termination module, configured to terminate, when the first node is in a second operating state, pushing the target service data to the first node, where the second operating state is used to indicate that the number of times that the service data pushed to the receiving node is continuously abnormal is greater than a first threshold;
the terminating module is further configured to terminate pushing the target service data to the receiving node, and discard the target service data when the pushing of the target service data to the receiving node is terminated.
8. The apparatus of claim 7, wherein the apparatus is further configured to:
after the target service data is pushed to the receiving node, detecting the number of times of continuous abnormity of the service data pushed to the receiving node;
determining the running state of the first node as a first running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be less than or equal to a second threshold value, wherein the second threshold value is less than the first threshold value, and the first running state comprises the first running sub-state;
determining the running state of the first node as a second running sub-state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the second threshold and smaller than the first threshold, wherein the first running state comprises the second running sub-state;
and determining the running state of the first node as the second running state under the condition that the number of times of continuous abnormity of the service data pushed to the receiving node is detected to be larger than the first threshold value.
9. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method as claimed in any of claims 1 to 6 are implemented when the computer program is executed by the processor.
CN202011300195.3A 2020-11-18 2020-11-18 Service data pushing method and device, storage medium and electronic device Active CN112769889B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011300195.3A CN112769889B (en) 2020-11-18 2020-11-18 Service data pushing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011300195.3A CN112769889B (en) 2020-11-18 2020-11-18 Service data pushing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN112769889A CN112769889A (en) 2021-05-07
CN112769889B true CN112769889B (en) 2022-12-06

Family

ID=75693134

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011300195.3A Active CN112769889B (en) 2020-11-18 2020-11-18 Service data pushing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN112769889B (en)

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8108537B2 (en) * 2008-07-24 2012-01-31 International Business Machines Corporation Method and system for improving content diversification in data driven P2P streaming using source push
CN104901955B (en) * 2015-05-20 2017-09-26 腾讯科技(深圳)有限公司 A kind of method for early warning, device and processing server
US10169138B2 (en) * 2015-09-22 2019-01-01 Walmart Apollo, Llc System and method for self-healing a database server in a cluster
CN107171926B (en) * 2017-03-23 2020-08-14 深圳市口袋网络科技有限公司 Switching method and device of multi-platform message push service
CN109218349A (en) * 2017-06-29 2019-01-15 北京微影时代科技有限公司 A kind of method and device of management server cluster
CN109936613B (en) * 2017-12-19 2021-11-05 北京京东尚科信息技术有限公司 Disaster recovery method and device applied to server
CN110557273A (en) * 2018-06-04 2019-12-10 视联动力信息技术股份有限公司 Terminal state warning method and device
CN109600444A (en) * 2018-12-14 2019-04-09 北京向上心科技有限公司 Data push method, server, terminal, electronic equipment and readable storage medium storing program for executing
CN111212391B (en) * 2020-01-14 2022-04-29 中保车服科技服务股份有限公司 Short message pushing method, device, equipment and readable medium
CN111367521A (en) * 2020-02-21 2020-07-03 国铁吉讯科技有限公司 Message sending method and device and message receiving method and device
CN111355802B (en) * 2020-03-03 2023-04-18 中国邮政储蓄银行股份有限公司 Information pushing method and device
CN111711697A (en) * 2020-06-17 2020-09-25 北京同邦卓益科技有限公司 Message pushing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112769889A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN110389815B (en) Task processing method, device and system
US10425316B2 (en) Heart beat monitoring for broadband access devices and enterprise devices
CN108566290B (en) Service configuration management method, system, storage medium and server
CN108287751B (en) Task execution method and device and distributed system
US11218541B2 (en) Data storage method, storage server, and storage medium and system
CN112422684B (en) Target message processing method and device, storage medium and electronic device
CN110830283A (en) Fault detection method, device, equipment and system
CN109327544B (en) Leader node determination method and device
CN110740072A (en) fault detection method, device and related equipment
EP4037281A1 (en) Transmission control method, network management server, base station and storage medium
CN111884875A (en) Offline device determination method and device
CN107204924B (en) Link discovery method and device
US9641595B2 (en) System management apparatus, system management method, and storage medium
CN112769889B (en) Service data pushing method and device, storage medium and electronic device
CN110224872B (en) Communication method, device and storage medium
CN114338477B (en) Communication link monitoring method, device, equipment and storage medium
CN112437146B (en) Equipment state synchronization method, device and system
CN114125023B (en) Method and device for determining data connection, storage medium and electronic device
CN112948098B (en) Service unit offline method based on micro-service unit architecture and related device
CN114116906A (en) Data synchronization method, device, electronic device and storage medium
CN114265693A (en) Data information pushing method, device, equipment and medium based on Internet of things platform
CN108924013B (en) Network flow accurate acquisition method and device
CN112799856A (en) Method and device for acquiring data
CN110932878A (en) Management method, equipment and system of distributed network
CN115883466B (en) Switch control method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant