CN115776510A - Control method and device of heartbeat packet, processor and electronic equipment - Google Patents

Control method and device of heartbeat packet, processor and electronic equipment Download PDF

Info

Publication number
CN115776510A
CN115776510A CN202211476046.1A CN202211476046A CN115776510A CN 115776510 A CN115776510 A CN 115776510A CN 202211476046 A CN202211476046 A CN 202211476046A CN 115776510 A CN115776510 A CN 115776510A
Authority
CN
China
Prior art keywords
target
period
service
heartbeat packet
heartbeat
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.)
Pending
Application number
CN202211476046.1A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202211476046.1A priority Critical patent/CN115776510A/en
Publication of CN115776510A publication Critical patent/CN115776510A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The application discloses a control method and device of a heartbeat packet, a processor and electronic equipment, and relates to the technical field of computers, wherein the method comprises the following steps: establishing long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is in normal communication or not through the first heartbeat packet; detecting whether a plurality of target connection requests are successfully connected within a preset time period; if the plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending heartbeat packets; and adjusting the rate according to the first target, and lengthening the sending period of the heartbeat packet from the initial preset period to the first target period. By the method and the device, the problem that in the related technology, availability of previous connection between a consumer and a provider is guaranteed by sending the heartbeat packet at a fixed period, and heartbeat sending cost is high is solved.

Description

Control method and device of heartbeat packet, processor and electronic equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling a heartbeat packet, a processor, and an electronic device.
Background
At present, micro-service architecture becomes mainstream, that is, each consumer and provider communicate by RPC before splitting a single application into distributed micro-services. The consumer needs to establish a long connection with each provider, and the microservice protocol defaults to send heartbeat packets in a fixed period to guarantee the availability of the connection, but as the cluster becomes larger and larger, the number of the consumer and the provider is increased. The cpu overhead for maintaining heartbeat packet transmission available for long connections is a gradual and non-negligible one.
Aiming at the problem that the availability of previous connection between a consumer and a provider is ensured by sending heartbeat packets at a fixed period in the related art, so that the heartbeat sending overhead is high, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide a heartbeat packet control method and apparatus, a processor, and an electronic device, so as to solve the problem in the related art that the availability of previous connection between a consumer and a provider is ensured by sending heartbeat packets at a fixed period, which results in high heartbeat sending overhead.
In order to achieve the above object, according to an aspect of the present application, there is provided a control method of a heartbeat packet. The method comprises the following steps: establishing a long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet; detecting whether a plurality of target connection requests are all successfully connected within a preset time period, wherein the target connection requests at least comprise: a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by the first heartbeat packet, and the service connection request is triggered by a target service to be executed; if the plurality of target connection requests are successfully connected within the preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet; and according to the first target adjustment rate, lengthening the sending period of the heartbeat packet from the initial preset period to the first target period.
Further, if the plurality of target connection requests are all successfully connected within the preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet includes: determining a service type of a target service between the service provider and the service requester; determining the service level of the target service according to the service type; and determining the first target regulation rate and the first target period according to the service level.
Further, determining the first target adjustment rate and the first target period as a function of the service level comprises: if the service level is a first level, determining that the first target adjustment rate is a first adjustment rate, and determining that the first target period is a first period; if the service level is a second level, determining that the first target adjustment rate is a second adjustment rate, and determining that the first target period is a second period, wherein the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and the time of the first period is smaller than the time of the second period; if the service level is a third level, determining that the first target adjustment rate is a third adjustment rate, and determining that the first target period is a third period, wherein the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and the time of the second period is smaller than the time of the third period.
Further, if it is detected that the target connection request is not successfully connected, the method further includes: shortening the sending period of the heartbeat packet from the initial preset period to a second target period, wherein the time of the second target period is less than that of the first target period; and sending a second heartbeat packet according to the second target period.
Further, after sending a second heartbeat packet according to the second target cycle, the method further includes: judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not; and if the connection request of the heartbeat packet triggered by the second heartbeat packet is successful, adjusting the rate according to the first target, and lengthening the sending period of the heartbeat packet from the second target period to the first target period.
Further, after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the method further includes: determining the failure times of the heartbeat packet connection request triggered by the second heartbeat packet; if the failure times are larger than or equal to a first preset time, representing that the long connection between the service provider and the service requester is disconnected; if the long connection between the service provider and the service requester has been disconnected, the long connection between the service provider and the service requester is re-established.
Further, after the sending period of the heartbeat packet is lengthened from the initial preset period to the first target period according to the first target adjustment rate, the method further includes: counting the target times of connection failure caused by lengthening the sending period of the heartbeat packet, and counting a third target period when the connection fails, wherein the time of the third target period is less than or equal to the time of the first target period; and adjusting the first target adjustment rate and the first target period according to the target times and the third target period.
Further, establishing a long connection between the service provider and the service requester comprises: sending a first data packet to the service provider through the service requester, wherein after receiving the first data packet, the service provider performs data processing on the first data packet to obtain a second data packet, and returns the second data packet to the service requester; the second data packet is checked through the service requester, and if the second data packet passes the checking, the second data packet is processed to obtain a third data packet; and sending the third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
In order to achieve the above object, according to another aspect of the present application, there is provided a control device of a heartbeat packet. The device comprises: the first establishing unit is used for establishing long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet; a detecting unit, configured to detect whether a plurality of target connection requests are all successfully connected within a preset time period, where the target connection requests at least include: a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by the first heartbeat packet, and the service connection request is triggered by a target service to be executed; a first determining unit, configured to determine a first target adjustment rate and a first target period for sending a heartbeat packet if the multiple target connection requests are all successfully connected within the preset time period; and the first processing unit is used for lengthening the sending period of the heartbeat packet from the initial preset period to the first target period according to the first target regulation rate.
Further, the first determination unit includes: a first determining module for determining a service type of a target service between the service provider and the service requester; the second determining module is used for determining the service level of the target service according to the service type; a third determining module, configured to determine the first target adjustment rate and the first target period according to the service level.
Further, the third determining module comprises: a first determining submodule, configured to determine that the first target adjustment rate is a first adjustment rate and determine that the first target period is a first period if the service level is a first level; a second determining submodule, configured to determine that the first target adjustment rate is a second adjustment rate and determine that the first target period is a second period if the service level is a second level, where the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and a time of the first period is smaller than a time of the second period; a third determining submodule, configured to determine that the first target adjustment rate is a third adjustment rate and determine that the first target period is a third period if the service level is a third level, where the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and a time of the second period is smaller than a time of the third period.
Further, the apparatus further comprises: the second processing unit is used for shortening the sending period of the heartbeat packet from the initial preset period to a second target period if the target connection request is detected to be not successfully connected, wherein the time of the second target period is less than that of the first target period; and the first sending unit is used for sending a second heartbeat packet according to the second target period.
Further, the apparatus further comprises: the judging unit is used for judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not after the second heartbeat packet is sent according to the second target period; and the third processing unit is configured to, if the connection request of the heartbeat packet triggered by the second heartbeat packet is successful, adjust the rate according to the first target, and lengthen the sending period of the heartbeat packet from the second target period to the first target period.
Further, the apparatus further comprises: a second determining unit, configured to determine, after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the number of failures of the heartbeat packet connection request triggered by the second heartbeat packet; a third determining unit, configured to indicate that the long connection between the service provider and the service requester has been disconnected if the failure number is greater than or equal to a first preset number; a second establishing unit, configured to re-establish the long connection between the service provider and the service requester if the long connection between the service provider and the service requester has been disconnected.
Further, the apparatus further comprises: a counting unit, configured to count a number of target times of connection failure caused by lengthening the sending period of the heartbeat packet after lengthening the sending period of the heartbeat packet from the initial preset period to the first target period according to the first target adjustment rate, and count a third target period when connection fails, where a time of the third target period is less than or equal to a time of the first target period; and the adjusting unit is used for adjusting the first target adjusting rate and the first target period according to the target times and the third target period.
Further, the first establishing unit includes: the second sending unit is used for sending a first data packet to the service provider through the service requester, wherein the service provider performs data processing on the first data packet after receiving the first data packet to obtain a second data packet, and returns the second data packet to the service requester; the checking unit is used for checking the second data packet through the service requester, and processing the second data packet to obtain a third data packet if the checking is passed; and the third sending unit is used for sending the third data packet to the service provider through the service requester, wherein the service provider verifies the third data packet after receiving the third data packet, and if the verification is passed, the long connection between the service provider and the service requester is successfully established.
In order to achieve the above object, according to an aspect of the present application, there is provided a processor for executing a program, wherein the program executes to execute the control method of the heartbeat packet according to any one of the above items.
To achieve the above object, according to one aspect of the present application, there is provided an electronic device including one or more processors and a memory for storing a control method of a heartbeat packet in which the one or more processors implement any one of the above.
By the application, the following steps are adopted: establishing a long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet; detecting whether a plurality of target connection requests are all successfully connected within a preset time period, wherein the target connection requests at least comprise: the method comprises the steps of receiving a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed; if the plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending heartbeat packets; the rate is adjusted according to the first target, the sending period of the heartbeat packet is prolonged from the initial preset period to the first target period, and the problem that in the related technology, the heartbeat packet is sent in a fixed period to guarantee the availability of previous connection between a consumer and a provider, so that the heartbeat sending cost is high is solved. According to the scheme, by detecting whether the target connection requests are all successfully connected within the preset time period, the heartbeat frequency is adaptively adjusted in real time, the number of useless heartbeat transmission is reduced, and the effect of reducing the heartbeat transmission overhead is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a control method for a heartbeat packet according to an embodiment of the present application;
fig. 2 is a schematic diagram of sending heartbeat packets at a fixed period according to an embodiment of the present application;
fig. 3 is a first schematic diagram illustrating a transmission cycle of a heartbeat packet being lengthened according to an embodiment of the present application;
fig. 4 is a second schematic diagram illustrating a transmission cycle of a heartbeat packet being lengthened according to an embodiment of the present application;
fig. 5 is a schematic diagram illustrating resetting a transmission period of a heartbeat packet according to an embodiment of the present application;
fig. 6 is a flowchart of an alternative heartbeat packet control method provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a control device for heartbeat packets according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an electronic device provided in accordance with an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that relevant information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data that are authorized by the user or sufficiently authorized by various parties. For example, an interface is provided between the system and the relevant user or institution, and before obtaining the relevant information, an obtaining request needs to be sent to the user or institution through the interface, and after receiving the consent information fed back by the user or institution, the relevant information needs to be obtained.
At present, micro service architecture becomes mainstream, that is, a single application is split into distributed micro services, and each consumer and provider communicate with each other through RPC before. The consumer needs to establish a long connection with each provider, and the microservice protocol defaults to send heartbeat packets in a fixed period to guarantee the availability of the connection, but as the cluster is larger and larger, the number of the consumer and the provider is larger and larger. The cpu overhead for maintaining heartbeat packet transmission available for long connections is a gradual and non-negligible one.
The present invention is described below with reference to preferred implementation steps, and fig. 1 is a flowchart of a control method for heartbeat packets according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, establishing long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the communication of the long connection is normal or not through the first heartbeat packet;
step S102, detecting whether a plurality of target connection requests are all successfully connected within a preset time period, wherein the target connection requests at least comprise: the method comprises the steps of receiving a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed;
step S103, if a plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending heartbeat packets;
and step S104, according to the first target adjustment rate, lengthening the sending period of the heartbeat packet from the initial preset period to a first target period.
Specifically, after the normal service application is started, long connections between the service provider and the service requester are established, and each long connection starts to send a first heartbeat packet according to a fixed period (i.e., the initial preset period described above), as shown in fig. 2, a heartbeat packet may be sent every 15s. Whether a plurality of target connection requests are all successfully connected within a preset time period is detected, for example, whether the target connection requests within 10 heartbeat transmission cycles (for example, 150 s) are all successfully connected is detected.
It should be noted that the target connection request at least includes: the method comprises a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered through a first heartbeat packet, and the service connection request is triggered through a target service to be executed. A target service refers to a normal service request between a service provider and a service requester.
If the target connection requests are all successfully connected within the preset time period, the communication between the service provider and the service requester is stable, and the sending period of the heartbeat packet can be adjusted. A schematic diagram of the adaptive lengthening of the heart cycle as shown in fig. 3 and 4.
The adjustment rate of the transmission cycle of the heartbeat packets, that is, the first target adjustment rate mentioned above, is determined according to the service between the service provider and the service requester, and the first target cycle of the transmission of the heartbeat packets is determined according to the service between the service provider and the service requester. For example, if the service between the service provider and the service requester is a core service, the corresponding first target adjustment rate may be set slower and the first target period may be set shorter, e.g., the first target adjustment rate may be set at 10 s/time and the first target period may be set at 45s. If the service between the service provider and the service requester is an uncore service, the corresponding first target throttling rate may be set faster and the first target period may be set slower, for example, the first target throttling rate may be set at 5 s/time and the first target period may be set at 60s.
It should be noted that, after adaptively adjusting the heartbeat packet period, if a service request fails or a heartbeat request connection fails, the heartbeat packet transmission period is reset to check whether the long connection between the service provider and the service requester is in normal communication, as shown in fig. 5.
In conclusion, the self-adaptive adjustment of the heartbeat frequency in real time is realized through the steps, and the number of useless heartbeat transmission is reduced. The effect of reducing the system resource overhead and CPU consumption is achieved.
In order to more reasonably adjust the sending period and the rate of the heartbeat packet, in the control method of the heartbeat packet provided in the embodiment of the present application, if a plurality of target connection requests are all successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet includes the following steps: determining a service type of a target service between a service provider and a service requester; determining the service level of the target service according to the service type; a first target adjustment rate and a first target period are determined according to the service level.
Determining the first target adjustment rate and the first target period according to the service level comprises: if the service level is a first level, determining that the first target adjustment rate is a first adjustment rate, and determining that the first target period is a first period; if the service level is a second level, determining that the first target regulation rate is a second regulation rate, and determining that the first target cycle is a second cycle, wherein the first level is higher than the second level, the first regulation rate is smaller than the second regulation rate, and the time of the first cycle is smaller than the time of the second cycle; and if the service level is a third level, determining that the first target adjustment rate is a third adjustment rate, and determining that the first target period is a third period, wherein the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and the time of the second period is smaller than the time of the third period.
Specifically, in order to more reasonably adjust the transmission cycle and the adaptation rate of the heartbeat packet, different adaptation rates and transmission cycles are set according to the type and importance of the service between the service provider and the service requester. For the core service, normal operation of other services may be affected, so the first target adjustment rate corresponding to the core service may be set to be slower, and the first target period may be set to be shorter, for example, the first target adjustment rate may be set at 10 s/time, and the first target period may be set at 45s. If the service between the service provider and the service requester is an uncore service, the corresponding first target adjustment rate may be set faster and the first target period may be set slower, for example, the first target adjustment rate may be set at 5 s/time and the first target period may be set at 60s.
Accordingly, a service type of a target service between a service provider and a service requester is determined, and then a service level of the target service is determined according to the service type. The service classes may be set to a first class, a second class, and a third class, corresponding to the core service, the important service, and the general service, respectively. If the service level is a first level, determining the first target adjustment rate to be the first adjustment rate, and determining the first target period to be the first period. If the service level is the second level, determining the first target adjustment rate as the second adjustment rate, and determining the first target period as the second period, if the service level is the third level, determining the first target adjustment rate as the third adjustment rate, and determining the first target period as the third period.
In an alternative embodiment, the first adjustment rate may be set to 15 s/time, the first period to 30 s/time, the second adjustment rate to 10 s/time, the second period to 45s, the third adjustment rate to 5 s/time, and the third period to 60s.
In summary, by setting different adjustment rates and sending periods of heartbeat packets, the sending period of the heartbeat packets between the service provider and the service requester can be adjusted more reasonably, and the problem of large-scale communication interruption is avoided.
Optionally, in the method for controlling a heartbeat packet provided in this embodiment of the present application, if it is detected that there is a target connection request that is not successfully connected, the method further includes: shortening the sending period of the heartbeat packet from an initial preset period to a second target period, wherein the time of the second target period is less than that of the first target period; and sending a second heartbeat packet according to a second target period.
Specifically, if it is detected that the target connection request is not successfully connected, which indicates that the communication between the service provider and the service requester is not stable well, the transmission period of the heartbeat packet needs to be adjusted immediately, for example, the transmission period of the heartbeat packet may be adjusted from 45s to 15s. Whether the communication between the service provider and the service requester is normal can be timely confirmed by shortening the sending period of the heartbeat packet.
After the second heartbeat packet is sent according to the second target period, the method further comprises the following steps: judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not; and if the connection request of the heartbeat packet triggered by the second heartbeat packet is successful, adjusting the rate according to the first target, and lengthening the sending period of the heartbeat packet from the second target period to the first target period.
Specifically, after the second heartbeat packet is sent according to the second target period, it is determined whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, which indicates that the previous failure may be caused by network delay, rather than a problem occurring in communication between the service provider and the service requester, and therefore, the sending period of the heartbeat packet may be lengthened from the second target period to the first target period again.
If the connection of the heartbeat packet connection request triggered by the second heartbeat packet is judged to fail, executing the following steps: determining the failure times of the heartbeat packet connection request triggered by the second heartbeat packet; if the failure times are larger than or equal to a first preset time, representing that the long connection between the service provider and the service requester is disconnected; if the long connection between the service provider and the service requester has been disconnected, the long connection between the service provider and the service requester is established again.
Specifically, the number of failures of the heartbeat packet connection request triggered by the second heartbeat packet is counted, and if the number of failures exceeds three times (namely, the first preset number), it indicates that the long connection between the service provider and the service requester is disconnected. And when the long connection between the service provider and the service requester is determined to be disconnected, reestablishing the long connection between the service provider and the service requester so as to ensure that the service between the service provider and the service requester is normally operated.
In order to improve the reasonableness of the first target adjustment rate and the first target period, in the method for controlling a heartbeat packet provided in this embodiment of the application, after the sending period of the heartbeat packet is lengthened from the initial preset period to the first target period according to the first target adjustment rate, the method further includes: counting the target times of connection failure caused by lengthening the sending period of the heartbeat packet, and counting a third target period when the connection fails, wherein the time of the third target period is less than or equal to the time of the first target period; and adjusting the first target adjustment rate and the first target period according to the target times and the third target period.
Specifically, the target times of connection failure caused by lengthening the sending period of the heartbeat packet are counted, the third target period when the connection fails is counted, and the first target adjustment rate and the first target period are adjusted according to the target times and the third target period. For example, when the transmission period of the heartbeat packet is lengthened, it is counted that when the transmission period of the heartbeat packet is set to 60s, the connection fails, which means that the transmission period of the heartbeat packet may be set to 60s too long, and adjustment is required.
In order to stabilize a long connection between a service provider and a service requester, in the method for controlling a heartbeat packet provided in an embodiment of the present application, establishing the long connection between the service provider and the service requester includes the following steps: the method comprises the steps that a first data packet is sent to a service provider through a service requester, wherein after the service provider receives the first data packet, the service provider performs data processing on the first data packet to obtain a second data packet, and the second data packet is returned to the service requester; the second data packet is checked through the service requester, and if the second data packet passes the checking, the second data packet is processed to obtain a third data packet; and sending a third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
Specifically, the service provider and the service requester realize the establishment of the long connection through tcp three-way handshake.
In an alternative embodiment, the dynamic adjustment of the sending period of the heartbeat packet may be implemented by using the flow shown in fig. 6. After the normal service application is started, long connection is established between a service provider and a service requester, and each connection starts to send heartbeat packets according to a fixed frequency. Counting the request failure number and the heartbeat failure number, if the failure does not occur recently, gradually adjusting the heartbeat period according to the corresponding rate (i.e. the above-mentioned adjustment rate) and the upper limit (i.e. the above-mentioned upper limit of the heartbeat packet sending period) according to the service level (as shown in fig. 3 and fig. 4). And resetting the heartbeat frequency when a service request fails or a heartbeat timeout scene occurs. The heartbeat frequency is adjusted adaptively. The total quantity of heartbeat sending can be greatly reduced, and the corresponding resource overhead is reduced. And the CPU overhead in the massive clusters is reduced.
According to the control method of the heartbeat packet, the long connection between the service provider and the service requester is established, and the first heartbeat packet is sent according to the initial preset period, so that whether the long connection is in normal communication or not is checked through the first heartbeat packet; detecting whether a plurality of target connection requests are successfully connected within a preset time period, wherein the target connection requests at least comprise: the method comprises the steps of receiving a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed; if the plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet; the rate is adjusted according to the first target, the sending period of the heartbeat packet is prolonged from the initial preset period to the first target period, and the problem that in the related technology, the heartbeat packet is sent in a fixed period to guarantee the availability of previous connection between a consumer and a provider, so that the heartbeat sending cost is high is solved. According to the scheme, by detecting whether the target connection requests are all successfully connected within the preset time period, the heartbeat frequency is adaptively adjusted in real time, the number of useless heartbeat transmission is reduced, and the effect of reducing the heartbeat transmission overhead is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a control device for a heartbeat packet, and it should be noted that the control device for a heartbeat packet in the embodiment of the present application may be used to execute the control method for a heartbeat packet provided in the embodiment of the present application. The following describes a control device for a heartbeat packet according to an embodiment of the present application.
Fig. 7 is a schematic diagram of a control device of a heartbeat packet according to an embodiment of the present application. As shown in fig. 7, the apparatus includes: a first establishing unit 701, a detecting unit 702, a first determining unit 703 and a first processing unit 704.
A first establishing unit 701, configured to establish a long connection between a service provider and a service requester, and send a first heartbeat packet according to an initial preset period, so as to check whether the long connection is in normal communication through the first heartbeat packet;
a detecting unit 702, configured to detect whether all of a plurality of target connection requests are successfully connected within a preset time period, where the target connection request at least includes: the method comprises the steps of receiving a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed;
a first determining unit 703, configured to determine a first target adjustment rate and a first target period for sending a heartbeat packet if multiple target connection requests are all successfully connected within a preset time period;
the first processing unit 704 is configured to adjust a rate according to a first target, and lengthen a sending period of the heartbeat packet from an initial preset period to a first target period.
The control device for heartbeat packets provided in the embodiment of the present application establishes a long connection between a service provider and a service requester through the first establishing unit 701, and sends the first heartbeat packet according to an initial preset period, so as to check whether the long connection is in normal communication through the first heartbeat packet; the detecting unit 702 detects whether a plurality of target connection requests are all successfully connected within a preset time period, where the target connection requests at least include: the method comprises the steps that a heartbeat packet connection request and a service connection request are sent, the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed; if a plurality of target connection requests are successfully connected within a preset time period, the first determining unit 703 determines a first target adjustment rate and a first target period for sending a heartbeat packet; the first processing unit 704 adjusts the rate according to the first target, and extends the sending period of the heartbeat packet from the initial preset period to the first target period, so that the problem that in the related art, the availability of previous connection between a consumer and a provider is ensured by sending the heartbeat packet at a fixed period, and the heartbeat sending overhead is high is solved. According to the scheme, by detecting whether the target connection requests are all successfully connected within the preset time period, the heartbeat frequency is adaptively adjusted in real time, the number of useless heartbeat transmission is reduced, and the effect of reducing the heartbeat transmission overhead is achieved.
Optionally, in the control device for a heartbeat packet provided in the embodiment of the present application, the first determining unit includes: the service type determining module is used for determining the service type of a target service between a service provider and a service requester; the second determining module is used for determining the service level of the target service according to the service type; and the third determining module is used for determining the first target adjustment rate and the first target period according to the service level.
Optionally, in the control device for a heartbeat packet provided in the embodiment of the present application, the third determining module includes: the first determining submodule is used for determining that the first target adjustment rate is the first adjustment rate and determining that the first target period is the first period if the service level is the first level; a second determining submodule, configured to determine that the first target adjustment rate is a second adjustment rate and determine that the first target period is a second period if the service level is a second level, where the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and the time of the first period is smaller than the time of the second period; and a third determining submodule, configured to determine that the first target adjustment rate is a third adjustment rate and determine that the first target period is a third period if the service level is a third level, where the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and the time of the second period is smaller than the time of the third period.
Optionally, in the control device for a heartbeat packet provided in this embodiment of the present application, the device further includes: the second processing unit is used for shortening the sending period of the heartbeat packet from the initial preset period to a second target period if the target connection request is detected to be not successfully connected, wherein the time of the second target period is less than that of the first target period; and the first sending unit is used for sending the second heartbeat packet according to a second target period.
Optionally, in the control device for a heartbeat packet provided in the embodiment of the present application, the device further includes: the judging unit is used for judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not after the second heartbeat packet is sent according to the second target period; and the third processing unit is used for adjusting the rate according to the first target and lengthening the sending period of the heartbeat packet from the second target period to the first target period if the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected.
Optionally, in the control device for a heartbeat packet provided in the embodiment of the present application, the device further includes: a second determining unit, configured to determine, after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the number of failures of the heartbeat packet connection request triggered by the second heartbeat packet; a third determining unit, configured to indicate that the long connection between the service provider and the service requester has been disconnected if the number of failures is greater than or equal to a first preset number; a second establishing unit for re-establishing the long connection between the service provider and the service requester if the long connection between the service provider and the service requester has been disconnected.
Optionally, in the control device for a heartbeat packet provided in this embodiment of the present application, the device further includes: the statistical unit is used for performing statistics on the number of target times of connection failure caused by prolonging the sending period of the heartbeat packet and performing statistics on a third target period when the connection fails after the sending period of the heartbeat packet is prolonged from an initial preset period to a first target period according to the first target adjustment rate, wherein the time of the third target period is less than or equal to that of the first target period; and the adjusting unit is used for adjusting the first target adjusting rate and the first target period according to the target times and the third target period.
Optionally, in the control device of a heartbeat packet provided in this embodiment of the present application, the first establishing unit includes: the second sending unit is used for sending the first data packet to the service provider through the service requester, wherein the service provider performs data processing on the first data packet after receiving the first data packet to obtain a second data packet, and returns the second data packet to the service requester; the checking unit is used for checking the second data packet through the service requester and processing the second data packet to obtain a third data packet if the checking is passed; and the third sending unit is used for sending a third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
The control device of the heartbeat packet includes a processor and a memory, the first establishing unit 701, the detecting unit 702, the first determining unit 703, the first processing unit 704, and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the dynamic control of the heartbeat package is realized by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), including at least one memory chip.
An embodiment of the present invention provides a computer-readable storage medium, on which a program is stored, where the program, when executed by a processor, implements a control method for a heartbeat packet.
The embodiment of the invention provides a processor, which is used for running a program, wherein a control method of a heartbeat package is executed when the program runs.
As shown in fig. 8, an embodiment of the present invention provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and the processor implements the following steps when executing the program: establishing long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is in normal communication or not through the first heartbeat packet; detecting whether a plurality of target connection requests are successfully connected within a preset time period, wherein the target connection requests at least comprise: the method comprises the steps that a heartbeat packet connection request and a service connection request are sent, the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed; if the plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending heartbeat packets; and according to the first target adjustment rate, lengthening the sending period of the heartbeat packet from the initial preset period to a first target period.
Optionally, if the plurality of target connection requests are all successfully connected within the preset time period, determining the first target adjustment rate and the first target period for sending the heartbeat packet includes: determining a service type of a target service between a service provider and a service requester; determining the service level of the target service according to the service type; a first target adjustment rate and a first target period are determined according to the service level.
Optionally, determining the first target adjustment rate and the first target period according to the service level includes: if the service level is a first level, determining that the first target adjustment rate is a first adjustment rate, and determining that the first target period is a first period; if the service level is a second level, determining that the first target adjustment rate is a second adjustment rate, and determining that the first target period is a second period, wherein the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and the time of the first period is smaller than the time of the second period; and if the service level is a third level, determining that the first target adjustment rate is a third adjustment rate, and determining that the first target period is a third period, wherein the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and the time of the second period is smaller than the time of the third period.
Optionally, if it is detected that the target connection request is not successfully connected, the method further includes: shortening the sending period of the heartbeat packet from an initial preset period to a second target period, wherein the time of the second target period is less than that of the first target period; and sending a second heartbeat packet according to a second target period.
Optionally, after sending the second heartbeat packet according to the second target cycle, the method further includes: judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not; and if the connection request of the heartbeat packet triggered by the second heartbeat packet is successful, adjusting the rate according to the first target, and lengthening the sending period of the heartbeat packet from the second target period to the first target period.
Optionally, after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the method further includes: determining the failure times of the heartbeat packet connection request triggered by the second heartbeat packet; if the failure times are larger than or equal to a first preset time, representing that the long connection between the service provider and the service requester is disconnected; if the long connection between the service provider and the service requester has been disconnected, the long connection between the service provider and the service requester is established again.
Optionally, after adjusting the rate according to the first target and lengthening the sending period of the heartbeat packet from the initial preset period to the first target period, the method further includes: counting the target times of connection failure caused by lengthening the sending period of the heartbeat packet, and counting a third target period when the connection fails, wherein the time of the third target period is less than or equal to the time of the first target period; and adjusting the first target adjustment rate and the first target period according to the target times and the third target period.
Optionally, establishing the long connection between the service provider and the service requester comprises: the method comprises the steps that a first data packet is sent to a service provider through a service requester, wherein after the service provider receives the first data packet, the service provider performs data processing on the first data packet to obtain a second data packet, and the second data packet is returned to the service requester; the second data packet is checked through the service requester, and if the second data packet passes the checking, the second data packet is processed to obtain a third data packet; and sending a third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: establishing a long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet; detecting whether a plurality of target connection requests are successfully connected within a preset time period, wherein the target connection requests at least comprise: the method comprises the steps that a heartbeat packet connection request and a service connection request are sent, the heartbeat packet connection request is triggered by a first heartbeat packet, and the service connection request is triggered by a target service to be executed; if the plurality of target connection requests are successfully connected within a preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet; and according to the first target adjustment rate, lengthening the sending period of the heartbeat packet from the initial preset period to a first target period.
Optionally, if the plurality of target connection requests are all successfully connected within the preset time period, determining the first target adjustment rate and the first target period for sending the heartbeat packet includes: determining a service type of a target service between a service provider and a service requester; determining the service level of the target service according to the service type; a first target adjustment rate and a first target period are determined according to the service level.
Optionally, determining the first target adjustment rate and the first target period according to the service level includes: if the service level is a first level, determining a first target adjustment rate as a first adjustment rate, and determining a first target period as a first period; if the service level is a second level, determining that the first target adjustment rate is a second adjustment rate, and determining that the first target period is a second period, wherein the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and the time of the first period is smaller than the time of the second period; and if the service level is a third level, determining that the first target adjustment rate is a third adjustment rate, and determining that the first target period is a third period, wherein the second level is higher than the third level, the second adjustment rate is lower than the third adjustment rate, and the time of the second period is shorter than the time of the third period.
Optionally, if it is detected that the target connection request is not successfully connected, the method further includes: shortening the sending period of the heartbeat packet from an initial preset period to a second target period, wherein the time of the second target period is less than that of the first target period; and sending a second heartbeat packet according to a second target period.
Optionally, after sending the second heartbeat packet according to the second target period, the method further includes: judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not; and if the connection request of the heartbeat packet triggered by the second heartbeat packet is successful, adjusting the rate according to the first target, and lengthening the sending period of the heartbeat packet from the second target period to the first target period.
Optionally, after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the method further includes: determining the failure times of the heartbeat packet connection request triggered by the second heartbeat packet; if the failure times are larger than or equal to a first preset time, representing that the long connection between the service provider and the service requester is disconnected; if the long connection between the service provider and the service requester has been disconnected, the long connection between the service provider and the service requester is re-established.
Optionally, after adjusting the rate according to the first target and lengthening the sending period of the heartbeat packet from the initial preset period to the first target period, the method further includes: counting target times of connection failure caused by lengthening the sending period of the heartbeat packet, and counting a third target period when the connection fails, wherein the time of the third target period is less than or equal to the time of the first target period; and adjusting the first target adjustment rate and the first target period according to the target times and the third target period.
Optionally, establishing the long connection between the service provider and the service requester comprises: the method comprises the steps that a first data packet is sent to a service provider through a service requester, wherein after the service provider receives the first data packet, the service provider performs data processing on the first data packet to obtain a second data packet, and the second data packet is returned to the service requester; the second data packet is checked through the service requester, and if the second data packet passes the checking, the second data packet is processed to obtain a third data packet; and sending a third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (11)

1. A method for controlling a heartbeat packet, comprising:
establishing a long connection between a service provider and a service requester, and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet;
detecting whether a plurality of target connection requests are successfully connected within a preset time period, wherein the target connection requests at least comprise: a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by the first heartbeat packet, and the service connection request is triggered by a target service to be executed;
if the plurality of target connection requests are successfully connected within the preset time period, determining a first target adjustment rate and a first target period for sending the heartbeat packet;
and according to the first target adjustment rate, lengthening the sending period of the heartbeat packet from the initial preset period to the first target period.
2. The method of claim 1, wherein if the plurality of target connection requests are all successfully connected within the preset time period, determining a first target adjustment rate and a first target period for sending heartbeat packets comprises:
determining a service type of a target service between the service provider and the service requestor;
determining the service level of the target service according to the service type;
and determining the first target adjustment rate and the first target period according to the service level.
3. The method of claim 2, wherein determining the first target adjustment rate and the first target period as a function of the service level comprises:
if the service level is a first level, determining the first target adjustment rate as a first adjustment rate, and determining the first target period as a first period;
if the service level is a second level, determining that the first target adjustment rate is a second adjustment rate, and determining that the first target period is a second period, wherein the first level is higher than the second level, the first adjustment rate is smaller than the second adjustment rate, and the time of the first period is smaller than the time of the second period;
if the service level is a third level, determining that the first target adjustment rate is a third adjustment rate, and determining that the first target period is a third period, wherein the second level is higher than the third level, the second adjustment rate is smaller than the third adjustment rate, and the time of the second period is smaller than the time of the third period.
4. The method of claim 1, wherein if it is detected that there is a target connection request not successfully connected, the method further comprises:
shortening the sending period of the heartbeat packet from the initial preset period to a second target period, wherein the time of the second target period is less than that of the first target period;
and sending a second heartbeat packet according to the second target period.
5. The method of claim 4, wherein after transmitting a second heartbeat packet according to the second target period, the method further comprises:
judging whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected or not;
and if the connection of the heartbeat packet connection request triggered by the second heartbeat packet is successful, the sending period of the heartbeat packet is lengthened from the second target period to the first target period according to the first target adjustment rate.
6. The method according to claim 5, wherein after determining whether the heartbeat packet connection request triggered by the second heartbeat packet is successfully connected, the method further comprises:
determining the failure times of the heartbeat packet connection request triggered by the second heartbeat packet;
if the failure times are larger than or equal to a first preset time, representing that the long connection between the service provider and the service requester is disconnected;
and if the long connection between the service provider and the service requester is disconnected, re-establishing the long connection between the service provider and the service requester.
7. The method according to claim 1, wherein after lengthening the transmission period of the heartbeat packets from the initial preset period to the first target period according to the first target adjustment rate, the method further comprises:
counting the target times of connection failure caused by lengthening the sending period of the heartbeat packet, and counting a third target period when the connection fails, wherein the time of the third target period is less than or equal to the time of the first target period;
and adjusting the first target adjustment rate and the first target period according to the target times and the third target period.
8. The method of claim 1, wherein establishing a long connection between a service provider and a service requestor comprises:
sending a first data packet to the service provider through the service requester, wherein after receiving the first data packet, the service provider performs data processing on the first data packet to obtain a second data packet, and returns the second data packet to the service requester;
the second data packet is checked through the service requester, and if the second data packet passes the checking, the second data packet is processed to obtain a third data packet;
and sending the third data packet to the service provider through the service requester, wherein the service provider checks the third data packet after receiving the third data packet, and if the third data packet passes the checking, the long connection between the service provider and the service requester is successfully established.
9. A control apparatus for a heartbeat packet, comprising:
the system comprises a first establishing unit, a second establishing unit and a third establishing unit, wherein the first establishing unit is used for establishing long connection between a service provider and a service requester and sending a first heartbeat packet according to an initial preset period so as to check whether the long connection is normal in communication or not through the first heartbeat packet;
a detecting unit, configured to detect whether a plurality of target connection requests are all successfully connected within a preset time period, where the target connection request at least includes: a heartbeat packet connection request and a service connection request, wherein the heartbeat packet connection request is triggered by the first heartbeat packet, and the service connection request is triggered by a target service to be executed;
a first determining unit, configured to determine a first target adjustment rate and a first target period for sending a heartbeat packet if all the target connection requests are successfully connected within the preset time period;
and the first processing unit is used for lengthening the sending period of the heartbeat packet from the initial preset period to the first target period according to the first target regulation rate.
10. A processor, characterized in that the processor is configured to execute a program, wherein the program executes the control method of the heartbeat packet according to any one of claims 1 to 8.
11. An electronic device comprising one or more processors and memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the control method of heartbeat packets of any of claims 1 to 8.
CN202211476046.1A 2022-11-23 2022-11-23 Control method and device of heartbeat packet, processor and electronic equipment Pending CN115776510A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211476046.1A CN115776510A (en) 2022-11-23 2022-11-23 Control method and device of heartbeat packet, processor and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211476046.1A CN115776510A (en) 2022-11-23 2022-11-23 Control method and device of heartbeat packet, processor and electronic equipment

Publications (1)

Publication Number Publication Date
CN115776510A true CN115776510A (en) 2023-03-10

Family

ID=85389957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211476046.1A Pending CN115776510A (en) 2022-11-23 2022-11-23 Control method and device of heartbeat packet, processor and electronic equipment

Country Status (1)

Country Link
CN (1) CN115776510A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117336213A (en) * 2023-12-01 2024-01-02 四川才子软件信息网络有限公司 Subsystem monitoring method, system and equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117336213A (en) * 2023-12-01 2024-01-02 四川才子软件信息网络有限公司 Subsystem monitoring method, system and equipment
CN117336213B (en) * 2023-12-01 2024-02-27 四川才子软件信息网络有限公司 Subsystem monitoring method, system and equipment

Similar Documents

Publication Publication Date Title
CN107391317B (en) Data recovery method, device, equipment and computer readable storage medium
US9733983B2 (en) System and method for surge protection and rate acceleration in a traffic director environment
CN109274707B (en) Load scheduling method and device
CN108600005A (en) A method of defence micro services avalanche effect
CN110505155B (en) Request degradation processing method and device, electronic equipment and storage medium
JP2020501237A (en) Server load balancing method, device, and server device
KR102266089B1 (en) Mec(mobile edge computing) system and control method thereof
US20110138053A1 (en) Systems, Methods and Computer Readable Media for Reporting Availability Status of Resources Associated with a Network
CN110764963A (en) Service exception handling method, device and equipment
CN110018781B (en) Disk flow control method and device and electronic equipment
CN115776510A (en) Control method and device of heartbeat packet, processor and electronic equipment
CN109600436B (en) Distributed iscsi service implementation method, system and related device
CN113328906B (en) Flow real-time monitoring method and device, storage medium and electronic equipment
CN112416594A (en) Micro-service distribution method, electronic equipment and computer storage medium
CN110290210B (en) Method and device for automatically allocating different interface flow proportions in interface calling system
US11836528B2 (en) Throttling thread resources of service computing platform
CN116489103A (en) Service flow limiting method, device and service processing system
CN111556142B (en) Service calling method, device and system
CN114296869A (en) Server node service method and device based on TCP long connection
CN112866131A (en) Traffic load balancing method, device, equipment and medium
CN115150400B (en) Service fault processing method and device, cloud service platform and storage medium
CN114465958B (en) Input and output control method, device and medium
US20240146657A1 (en) Reducing Network Congestion Using a Load Balancer
US20230353709A1 (en) Configuring a virtualised environment in a telecommunications network
CN112532670B (en) Data processing method and 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