CN110365598B - Heartbeat message sending method, device, server, terminal and storage medium - Google Patents

Heartbeat message sending method, device, server, terminal and storage medium Download PDF

Info

Publication number
CN110365598B
CN110365598B CN201910559395.1A CN201910559395A CN110365598B CN 110365598 B CN110365598 B CN 110365598B CN 201910559395 A CN201910559395 A CN 201910559395A CN 110365598 B CN110365598 B CN 110365598B
Authority
CN
China
Prior art keywords
heartbeat
message
target
heartbeat message
sending
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
CN201910559395.1A
Other languages
Chinese (zh)
Other versions
CN110365598A (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.)
Shenzhen Montnets Technology Co ltd
Original Assignee
Shenzhen Montnets Technology 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 Shenzhen Montnets Technology Co ltd filed Critical Shenzhen Montnets Technology Co ltd
Priority to CN201910559395.1A priority Critical patent/CN110365598B/en
Publication of CN110365598A publication Critical patent/CN110365598A/en
Application granted granted Critical
Publication of CN110365598B publication Critical patent/CN110365598B/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
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/32Flow control; Congestion control by discarding or delaying data units, e.g. packets or frames
    • 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 invention is applicable to the technical field of computers, and provides a heartbeat message sending method which is used for a server and comprises the following steps: if the total number of the received concurrent heartbeat messages is larger than a preset saturation threshold, determining each heartbeat message larger than the preset saturation threshold as a target heartbeat message; determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message; and sending a heartbeat feedback message to the terminal sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset. And determining the heartbeat offset of the target heartbeat message and indicating the terminal to adjust the time for transmitting the heartbeat information next time according to the heartbeat offset. The method and the device can solve the problem of periodic congestion of network data caused by the fact that the terminal sends heartbeat messages simultaneously in a short time, and improve the overall performance of the server. The invention also provides a heartbeat message sending device, a server, a terminal and a storage medium.

Description

Heartbeat message sending method, device, server, terminal and storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a heartbeat message sending method, a server, a terminal, computing equipment and a storage medium.
Background
With the continuous development of mobile internet technology, various applications on terminals have also been developed, and besides browsing web pages, sending and receiving mails, many emerging instant messaging applications, game applications, etc. have emerged. A feature of these emerging applications is that in order to achieve the functions of interconnection, long online etc., the terminal is required to periodically send small data packets to the server, such small data packet messages are often referred to as heartbeat messages.
In practical application, factors such as restarting of a server or network abnormality may occur, so that a large number of terminals are simultaneously disconnected, if the number of terminals which are disconnected currently is large, since the waiting time of reconnection after disconnection of each terminal is the same, a large number of terminals are reconnected in the same time period, so that the instant pressure of the server is easily caused to be too large, and the server is halted or restarted again; meanwhile, after the reconnection of the dropped terminals is successful, because the heartbeat period of each terminal is the same, a large number of terminals can simultaneously send heartbeat messages in a short time, so that the pressure of the server can be increased, the periodical congestion of network data can be caused, and the overall performance of the server is further influenced.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a method for sending a heartbeat message, a server, a terminal, a computing device, and a storage medium, so as to solve the problem of periodic congestion of network data caused by that the terminal sends the heartbeat message in a short time in the prior art, and improve the overall performance of the server.
A first aspect of an embodiment of the present invention provides a heartbeat message sending method, which is used for a server, and includes:
if the total number of the received concurrent heartbeat messages is larger than a preset saturation threshold, determining each heartbeat message larger than the preset saturation threshold as a target heartbeat message;
determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message;
sending a heartbeat feedback message to a terminal sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; and the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time.
Optionally, the determining, based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message, a heartbeat offset of the target heartbeat message includes:
acquiring the total number of concurrent heartbeat messages received at each moment in the current heartbeat period and the receiving time of the target heartbeat message;
generating a target heartbeat message sequence according to a preset target heartbeat message sequence generation rule;
if at t i And if the total number of the concurrent heartbeat messages received at the moment is smaller than the preset saturation threshold, the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows:
t=t 0 +t i -t s
wherein t is the heartbeat bias of the nth target heartbeat message in the target heartbeat message sequenceShift amount, t 0 T is the starting time of the current heartbeat period s T is the receiving time of the nth target heartbeat message in the target heartbeat message sequence i And the ith moment in the current heartbeat cycle.
Optionally, the generating the target heartbeat message sequence according to the preset target heartbeat message generation rule includes:
and generating a target heartbeat message sequence according to the sequence of the receiving time of the target heartbeat message.
Optionally, at said if at t i And if the total number of the received concurrent heartbeat messages is smaller than the preset saturation threshold and the total number of the received concurrent heartbeat messages is minimum, determining that the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows: t=t 0 +t i -t s Thereafter, the method further comprises:
if the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is larger than the preset maximum offset, determining that the heartbeat offset of the (n+1) th target heartbeat message in the target heartbeat sequence is:
t=t 0 +t i -t s+1
wherein t is s+1 And the receiving time of the (n+1) th target heartbeat message in the target heartbeat message sequence is set.
The second aspect of the present invention provides a heartbeat message sending method, which is used for a terminal, and includes:
receiving a heartbeat feedback message sent by a server, wherein the heartbeat feedback message comprises a heartbeat offset of the heartbeat message; the heartbeat feedback message is sent by the server when the total number of the concurrent heartbeat messages received at the current moment is detected to be larger than a preset saturation threshold value, and the heartbeat offset is determined;
according to the heartbeat offset, adjusting the sending time of the heartbeat message to the server next time;
and sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
A third aspect of the present invention provides a heartbeat message transmitting apparatus, including:
the first determining module is used for taking each heartbeat message which is larger than the preset saturation threshold value as a target heartbeat message if the total number of the received concurrent heartbeat messages is larger than the preset saturation threshold value;
the second determining module is used for determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message;
the first sending module is used for sending a heartbeat feedback message to the terminal sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; and the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time.
A fourth aspect of the present invention provides a heartbeat message transmitting apparatus, including:
the receiving module is used for receiving the heartbeat feedback message sent by the server, wherein the heartbeat feedback message comprises the heartbeat offset of the target heartbeat message; the heartbeat feedback message is sent by the server when the total number of the concurrent heartbeat messages received at the current moment is detected to be larger than a preset saturation threshold value, and the heartbeat offset is determined;
the adjusting module is used for adjusting the sending time of the target heartbeat message to the server according to the heartbeat offset;
and the second sending module is used for sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
A fifth aspect of the invention provides a server comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor, when executing said computer program, implements the steps of the heartbeat message sending method as described in the first aspect above.
A sixth aspect of the invention provides a terminal comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor, when executing said computer program, implements the steps of the heartbeat message sending method as described in the second aspect above.
A seventh aspect of the present invention provides a computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the heartbeat message sending method as described in the first aspect above, or the steps of the heartbeat message sending method as described in the second aspect above.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: determining the heartbeat offset of each heartbeat message greater than the preset saturation threshold based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of each heartbeat message greater than the preset saturation threshold by the total number of the received concurrent heartbeat messages greater than the preset saturation threshold; and indicating the terminal to adjust the time for sending the heartbeat information next time according to the heartbeat offset. The method and the device can solve the problem of periodic congestion of network data caused by the fact that the terminal sends heartbeat messages simultaneously in a short time, and improve the overall performance of the server.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an implementation of a heartbeat message sending method according to a first embodiment of the present invention;
FIG. 2 is a specific implementation of S102 in FIG. 1;
FIG. 3 is a diagram showing another implementation of S102 in FIG. 1;
fig. 4 is a flowchart of an implementation of a heartbeat message sending method according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of an apparatus for sending heartbeat messages according to a third embodiment of the present invention;
fig. 6 is a schematic diagram of a heartbeat message sending device according to a fourth embodiment of the present invention;
FIG. 7 is a schematic diagram of a server provided by the present invention;
fig. 8 is a schematic diagram of a terminal provided by the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to illustrate the technical scheme of the invention, the following description is made by specific examples. As shown in fig. 1, the implementation flow of the heartbeat message sending method provided in the first embodiment of the present invention is that the execution body of the embodiment is a server. The details are as follows:
s101, if the total number of the received concurrent heartbeat messages is larger than a preset saturation threshold, determining each heartbeat message larger than the preset saturation threshold as a target heartbeat message.
In this embodiment, in order to ensure the working efficiency of the server and avoid congestion of the heartbeat messages received in a short time, the server generally divides a heartbeat period into a plurality of time periods, counts the total number of concurrent heartbeat messages received in each time period, and determines redundant heartbeat messages received in a certain time period or at a time T, for example, heartbeat messages greater than a preset saturation threshold, as target heartbeat messages when the total number of concurrent heartbeat messages received at a time T in the certain time period is greater than a preset saturation threshold. Specifically, each time in one heartbeat period may be taken as a statistical unit, and the total number of concurrent heartbeat messages received by the server at each time is counted.
S102, determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message.
Alternatively, since the processing speed of the server is limited, so that the server has a limit on the maximum concurrency number, in order to avoid excessive instantaneous stress of the server, the total number of received concurrency heartbeat messages needs to be considered. In general, the total number of heartbeat messages received by a server at different moments in a heartbeat period is often different, and the sending terminals of the heartbeat messages corresponding to different moments are also often different. Therefore, it is necessary to further determine the receiving time of the target heartbeat message, and determine the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message, so that the terminal needing to adjust the sending time of the heartbeat message can be more accurately determined.
Specifically, as shown in fig. 2, the implementation of S102 in fig. 1 is described. As can be seen from fig. 2, S102 includes:
s1021, obtaining the total number of the concurrent heartbeat messages received at each moment in the current heartbeat period and the receiving time of the target heartbeat message.
In this embodiment, the current heartbeat cycle is divided by taking a time as a unit, and the total number of concurrent heartbeat messages received at each time in the current heartbeat cycle is further obtained. It may be appreciated that the current heartbeat period may be divided into different short time periods in units of a preset duration, where when the total number of heartbeat messages received in a certain short time period is large, it is possible to affect the processing speed of the server in the short time period, and at this time, it may be determined whether the sending time of the heartbeat message needs to be adjusted by calculating the instantaneous heartbeat density in the short time period.
Further, a certain mapping relationship exists between the receiving time of the target heartbeat message and the sending time of the target heartbeat message, and the server can determine the sending time of the target heartbeat message through the receiving time of the target heartbeat message.
S1022, generating a target heartbeat message sequence according to a preset target heartbeat message sequence generation rule.
Optionally, the preset target heartbeat message sequence generating rule is a process of sequencing the target heartbeat messages according to the receiving time to generate a target heartbeat message sequence. Specifically, in this embodiment, generating the target heartbeat message sequence according to the preset target heartbeat message sequence generation rule includes generating the target heartbeat message sequence according to a preset sequence of receiving times of the target heartbeat messages.
S1023, if at the ith time t i The total number of the received concurrent heartbeat messages is smaller than the preset saturation threshold value and the total number of the received concurrent heartbeat messages is minimum, based on the ith time t i And determining the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence at the moment.
Specifically, the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows:
t=t 0 +t i -t s
wherein t is the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence, t 0 T is the starting time of the current heartbeat period s T is the receiving time of the nth target heartbeat message in the target heartbeat message sequence i And the ith moment in the current heartbeat cycle.
It will be appreciated that, in one heartbeat cycle, the server may receive the total number of concurrent heartbeat messages at a plurality of times less than the preset saturation threshold, and in this embodiment, in order to determine the heartbeat offset more accurately, the server may determine, at a time t when the total number of concurrent heartbeat messages received in the current heartbeat cycle is less than the preset saturation threshold and the total number of received concurrent heartbeat messages is minimum i The starting time as the target heartbeat offset is based on time t i To determine a heartbeat offset for any target heartbeat message in the sequence of target heartbeat messages.
As can be seen from the above analysis, in this embodiment, by determining the time at which the total number of received concurrent heartbeat messages in the current heartbeat cycle is the start time of the heartbeat offset, and determining the heartbeat offset of each target heartbeat message according to the heartbeat offset calculation formula, it can be determined that the total number of received concurrent heartbeat messages in each time in the current heartbeat cycle tends to be average.
Specifically, as shown in fig. 3, another implementation of S102 in fig. 1 is shown. As can be seen from fig. 3, compared with the embodiment shown in fig. 2, the implementation process of S2021 is the same as S1021, the implementation process of S2022 is the same as S1022, the implementation process of S2023 is the same as S1023, and the difference is mainly that in this embodiment, S2024 is also included. Specifically, the implementation procedure of S2024 is as follows.
S2024, if the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is greater than the preset maximum offset, determining the heartbeat offset of the (n+1) th target heartbeat message in the target heartbeat sequence based on the maximum offset.
Specifically, the maximum offset determines that the heartbeat offset of the (n+1) th target heartbeat message in the target heartbeat sequence is:
t=t 0 +t i -t s+1
wherein t is s+1 And the receiving time of the (n+1) th target heartbeat message in the target heartbeat message sequence is set.
From the above analysis, in an embodiment of the present solution, the heartbeat offset is in units of time, optionally in units of time within one heartbeat cycle. When the total number of the target heartbeat messages is more and the number of the heartbeat messages exceeding the saturation threshold is larger than the allocable time number in one heartbeat period, according to
t=t 0 +t i -t s
Determining the heartbeat offset will present an allocation problem, so in this embodiment, a maximum offset is presetWhen the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is larger than the preset maximum offset, re-taking t i And determining the heartbeat offset of the (n+1) th target heartbeat message in the target heartbeat sequence for the starting moment.
As can be seen from the above analysis, the present embodiment solves the problem of how to determine the heartbeat offset when the total number of the target heartbeat messages is more and exceeds the saturation threshold by presetting the maximum offset based on the embodiment shown in fig. 2, and can further ensure that the total number of the concurrent heartbeat messages received at each moment in the current heartbeat cycle tends to be average when the total number of the target heartbeat messages exceeds the preset saturation threshold.
S103, sending a heartbeat feedback message to the terminal sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; and the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time.
The heartbeat messages sent by different terminals carry the identification information of the terminals, and the server can determine the terminal for sending the target heartbeat message according to the terminal identification information carried by the target heartbeat message and send a heartbeat feedback message to the terminal for sending the target heartbeat message. Specifically, the heartbeat feedback message is a response message of the received heartbeat message sent by the terminal, and in this example, the heartbeat feedback message includes the heartbeat offset, where the heartbeat offset is used to instruct the terminal to adjust the time of sending the target heartbeat message next.
According to the analysis, when the total number of received concurrent heartbeat messages is larger than the preset saturation threshold, the heartbeat offset of each heartbeat message larger than the preset saturation threshold is determined based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of each heartbeat message larger than the preset saturation threshold; and indicating the terminal to adjust the time for sending the heartbeat information next time according to the heartbeat offset. The method and the device can solve the problem of periodic congestion of network data caused by the fact that the terminal sends heartbeat messages simultaneously in a short time, and improve the overall performance of the server.
Fig. 4 shows a flow of implementation of the heartbeat message sending method according to the second embodiment of the present invention, where the execution body of the embodiment is a terminal. The details are as follows:
s401, receiving a heartbeat feedback message sent by a server, wherein the heartbeat feedback message comprises a heartbeat offset of the heartbeat message; and the heartbeat feedback message is sent by the server when the total number of the concurrent heartbeat messages received at the current moment is detected to be larger than a preset saturation threshold value, and the heartbeat offset is determined.
And after the server determines that the time for sending the heartbeat message needs to be adjusted by the terminal, sending a heartbeat feedback message to the corresponding terminal, wherein the heartbeat feedback message comprises the offset of the heartbeat message.
And S402, adjusting the sending time of the heartbeat message to the server next time according to the heartbeat offset.
And after receiving the heartbeat feedback message sent by the server, the terminal extracts the heartbeat offset and adjusts the time for sending the heartbeat message to the server next time according to the heartbeat offset.
S403, sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
According to the analysis, the heartbeat message sending method provided by the invention can avoid the terminal to send a large number of heartbeat messages at the same time by adjusting the time for sending the heartbeat messages to the server according to the heartbeat offset, thereby solving the problem of periodic congestion of network data and improving the overall performance of the server.
Fig. 5 is a schematic diagram of an apparatus for sending a heartbeat message according to a third embodiment of the present invention. As shown in fig. 5, the heartbeat message transmitting device 5 of this embodiment includes: a first determining module 510, a second determining module 520, a first transmitting module 530. Wherein, the liquid crystal display device comprises a liquid crystal display device,
a first determining module 510, configured to, if the total number of received concurrent heartbeat messages is greater than a preset saturation threshold, determine each heartbeat message greater than the preset saturation threshold as a target heartbeat message;
a second determining module 520, configured to determine a heartbeat offset of the target heartbeat message based on a total number of concurrent heartbeat messages received in the current heartbeat period and a receiving time of the target heartbeat message;
a first sending module 530, configured to send a heartbeat feedback message to a terminal that sends the target heartbeat message, where the heartbeat feedback message includes the heartbeat offset; and the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time.
Fig. 6 is a schematic diagram of a heartbeat message sending device according to a fourth embodiment of the present invention. As shown in fig. 6, the heartbeat message transmitting device 6 of this embodiment includes: a receiving module 610, an adjusting module 620, and a second transmitting module 630; wherein, the liquid crystal display device comprises a liquid crystal display device,
a receiving module 610, configured to receive a heartbeat feedback message sent by a server, where the heartbeat feedback message includes a heartbeat offset of a target heartbeat message; the heartbeat feedback message is sent by the server when the total number of the concurrent heartbeat messages received at the current moment is detected to be larger than a preset saturation threshold value, and the heartbeat offset is determined;
an adjustment module 620, configured to adjust a sending time of the target heartbeat message to the server according to the heartbeat offset;
and a second sending module 630, configured to send a heartbeat message to the server according to the adjusted sending time for sending the heartbeat message. Fig. 7 is a schematic diagram of a server provided by the present invention. As shown in fig. 7, the server of this embodiment includes: a processor 70, a memory 71 and a computer program 72, such as a heartbeat messaging program, stored in the memory 71 and executable on the processor 70. The processor 70, when executing the computer program 72, implements the steps of the various heartbeat message sending method embodiments described above, such as steps 101 through 103 shown in fig. 1. Alternatively, the processor 70, when executing the computer program 72, performs the functions of the modules/units of the server embodiment described above, such as the functions of the modules 510-530 of fig. 5.
By way of example, the computer program 72 may be partitioned into one or more modules/units that are stored in the memory 71 and executed by the processor 70 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used to describe the execution of the computer program 72 in the server 7. For example, the computer program 72 may be divided into an acquisition module, a determination module, an audio signal recording module, and an extraction module (module in the virtual device), each of which specifically functions as follows:
the first determining module is used for taking each heartbeat message which is larger than the preset saturation threshold value as a target heartbeat message if the total number of the received concurrent heartbeat messages is larger than the preset saturation threshold value;
the second determining module is used for determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message;
the first sending module is used for sending a heartbeat feedback message to the terminal sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; and the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time.
Fig. 8 is a schematic diagram of a terminal provided by the present invention. As shown in fig. 8, the terminal of this embodiment includes: a processor 80, a memory 81 and a computer program 82, such as a heartbeat messaging program, stored in the memory 81 and executable on the processor 80. The processor 80, when executing the computer program 82, implements the steps of the respective heartbeat message sending method embodiments described above, such as steps 401 to 403 shown in fig. 4. Alternatively, the processor 80, when executing the computer program 82, performs the functions of the modules/units of the server embodiment described above, such as the functions of modules 610 through 630 shown in fig. 6.
By way of example, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program 82 in the server 8. For example, the computer program 82 may be divided into a receiving module, an adjusting module, and a second transmitting module (a module in the virtual device), where each module specifically functions as follows:
the receiving module is used for receiving the heartbeat feedback message sent by the server, wherein the heartbeat feedback message comprises the heartbeat offset of the target heartbeat message; the heartbeat feedback message is sent by the server when the total number of the concurrent heartbeat messages received at the current moment is detected to be larger than a preset saturation threshold value, and the heartbeat offset is determined;
the adjusting module is used for adjusting the sending time of the target heartbeat message to the server according to the heartbeat offset;
and the second sending module is used for sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of communication units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (9)

1. A heartbeat message sending method, which is used for a server, and comprises the following steps:
if the total number of the received concurrent heartbeat messages in the current heartbeat period is larger than a preset saturation threshold, determining each heartbeat message larger than the preset saturation threshold as a target heartbeat message;
determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message;
determining a terminal for sending the target heartbeat message according to the terminal identification information carried by the target heartbeat message, and sending a heartbeat feedback message to the terminal for sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time;
the determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message includes:
acquiring the total number of concurrent heartbeat messages received at each moment in the current heartbeat period and the receiving time of the target heartbeat message;
generating a target heartbeat message sequence according to a preset target heartbeat message sequence generation rule;
if at t i And if the total number of the concurrent heartbeat messages received at the moment is smaller than the preset saturation threshold, the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows:
t=t 0 +t i -t s
wherein t is the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence, t 0 T is the starting time of the current heartbeat period s For the reception of the nth target heartbeat message in the sequence of target heartbeat messagesBetween t i And the ith moment in the current heartbeat cycle.
2. The heartbeat message sending method as claimed in claim 1, wherein the generating the target heartbeat message sequence according to the preset target heartbeat message generation rule includes:
and generating a target heartbeat message sequence according to the sequence of the receiving time of the target heartbeat message.
3. The heartbeat message sending method of claim 2 wherein at said if at t i And if the total number of the concurrent heartbeat messages received at the moment is smaller than the preset saturation threshold, determining that the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows: t=t 0 +t i -t s Thereafter, the method further comprises:
if the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is larger than the preset maximum offset, determining that the heartbeat offset of the (n+1) th target heartbeat message in the target heartbeat sequence is:
t=t 0 +t i -t s+1
wherein t is s+1 And the receiving time of the (n+1) th target heartbeat message in the target heartbeat message sequence is set.
4. A heartbeat message sending method, which is used for a terminal, comprising:
receiving a heartbeat feedback message sent by a server, wherein the heartbeat feedback message comprises a heartbeat offset of the heartbeat message; the heartbeat feedback message is sent to a terminal sending the heartbeat message according to the terminal identification information carried by the heartbeat message after the server detects that the total number of the concurrent heartbeat messages received at the current moment is larger than a preset saturation threshold value and determines the heartbeat offset; the server is a server for implementing the heartbeat message sending method according to any one of claims 1 to 3;
according to the heartbeat offset, adjusting the sending time of the heartbeat message to the server next time;
and sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
5. A heartbeat message transmitting device, comprising:
the first determining module is used for taking each heartbeat message which is larger than the preset saturation threshold value as a target heartbeat message if the total number of the received concurrent heartbeat messages is larger than the preset saturation threshold value;
the second determining module is used for determining the heartbeat offset of the target heartbeat message based on the total number of the received concurrent heartbeat messages in the current heartbeat period and the receiving time of the target heartbeat message;
the first sending module is used for determining a terminal for sending the target heartbeat message according to the terminal identification information carried by the target heartbeat message, and sending a heartbeat feedback message to the terminal for sending the target heartbeat message, wherein the heartbeat feedback message comprises the heartbeat offset; the heartbeat offset is used for indicating the terminal to adjust the time for sending the target heartbeat message next time;
the second determining module is specifically configured to:
acquiring the total number of concurrent heartbeat messages received at each moment in the current heartbeat period and the receiving time of the target heartbeat message;
generating a target heartbeat message sequence according to a preset target heartbeat message sequence generation rule;
if at t i And if the total number of the concurrent heartbeat messages received at the moment is smaller than the preset saturation threshold, the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence is as follows:
t=t 0 +t i -t s
wherein t is the heartbeat offset of the nth target heartbeat message in the target heartbeat message sequence, t 0 T is the starting time of the current heartbeat period s For the object ofTime t of receiving nth target heartbeat message in heartbeat message sequence i And the ith moment in the current heartbeat cycle.
6. A heartbeat message transmitting device, comprising:
the receiving module is used for receiving the heartbeat feedback message sent by the server, wherein the heartbeat feedback message comprises the heartbeat offset of the target heartbeat message; the heartbeat feedback message is sent to a terminal sending the heartbeat message according to the terminal identification information carried by the heartbeat message after the server detects that the total number of the concurrent heartbeat messages received at the current moment is larger than a preset saturation threshold value and determines the heartbeat offset; the server is a server for implementing the heartbeat message sending method according to any one of claims 1 to 3;
the adjusting module is used for adjusting the sending time of the target heartbeat message to the server according to the heartbeat offset;
and the second sending module is used for sending the heartbeat message to the server according to the adjusted sending time for sending the heartbeat message.
7. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the heartbeat message sending method according to any of claims 1-3 when the computer program is executed.
8. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the heartbeat message sending method as claimed in claim 4 when the computer program is executed by the processor.
9. A computer-readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the steps of the heartbeat message sending method according to any one of claims 1 to 3 or the steps of the heartbeat message sending method according to claim 4.
CN201910559395.1A 2019-06-26 2019-06-26 Heartbeat message sending method, device, server, terminal and storage medium Active CN110365598B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910559395.1A CN110365598B (en) 2019-06-26 2019-06-26 Heartbeat message sending method, device, server, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910559395.1A CN110365598B (en) 2019-06-26 2019-06-26 Heartbeat message sending method, device, server, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN110365598A CN110365598A (en) 2019-10-22
CN110365598B true CN110365598B (en) 2023-05-02

Family

ID=68216944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910559395.1A Active CN110365598B (en) 2019-06-26 2019-06-26 Heartbeat message sending method, device, server, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN110365598B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309521B (en) * 2020-01-19 2024-02-09 深圳市恒扬数据股份有限公司 FPGA reloading method, FPGA card type equipment and host
CN112767936A (en) * 2021-01-06 2021-05-07 镁佳(北京)科技有限公司 Voice conversation method, device, storage medium and electronic equipment
CN115087087A (en) * 2021-03-15 2022-09-20 中国电信股份有限公司 Service synchronization method, dual-card terminal and non-transitory computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102843250B (en) * 2011-06-21 2018-01-19 中兴通讯股份有限公司 The adaptive approach and device of a kind of heart beat cycle
CN105359596B (en) * 2013-09-09 2019-05-28 华为技术有限公司 Method of adjustment, equipment and the system of Timing Advance
CN106685748B (en) * 2015-11-05 2020-06-12 中移(杭州)信息技术有限公司 Heartbeat information sending method, server and terminal

Also Published As

Publication number Publication date
CN110365598A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
CN110365598B (en) Heartbeat message sending method, device, server, terminal and storage medium
CN108540568B (en) Computing capacity sharing method and intelligent equipment
CN107872396B (en) Communication method with timeout control, processing device, terminal device and server
CN112218339B (en) Relay transmission scheduling method, device, storage medium and electronic equipment
CN109769029B (en) Communication connection method based on electricity consumption information acquisition system and terminal equipment
CN110532294A (en) Ticket merging method, device, equipment and computer readable storage medium
CN109800085B (en) Resource configuration detection method and device, storage medium and electronic equipment
CN110751045A (en) Fault recording method, system and terminal equipment
CN112596985B (en) IT asset detection method, device, equipment and medium
CN111159009B (en) Pressure testing method and device for log service system
CN113873003B (en) Data transmission control method and system between storage end and communication end in Internet of things
CN112966005B (en) Timing message sending method, device, computer equipment and storage medium
CN113660179B (en) Bandwidth cooperative control device and method for PCIe SSD multi-virtual function device
CN111278047B (en) Method, system, electronic device and medium for processing CSI of non-serving cell
CN113873026A (en) Dynamic timeout response method, device, terminal equipment and storage medium
CN113535020A (en) Method, apparatus, device, medium and product for generating application icons
CN112994976A (en) Gateway testing method and device, electronic equipment and storage medium
CN114900477B (en) Message processing method, server, electronic equipment and storage medium
CN112653092B (en) Generator exit protection method and terminal equipment
CN113301597B (en) Network analysis method and equipment
CN111081253B (en) Voice processing method, device and system
CN110968397B (en) Analysis method and device for virtual machine capacity management
CN116669090A (en) Capacity expansion judging method, device, equipment and storage medium
CN117635195A (en) User matching method and device, electronic equipment and storage medium
CN114390003A (en) Method, device and terminal for data transmission control

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