CN112887416A - Frequency adjustment method and device for sending keep-alive packets - Google Patents

Frequency adjustment method and device for sending keep-alive packets Download PDF

Info

Publication number
CN112887416A
CN112887416A CN202110156657.7A CN202110156657A CN112887416A CN 112887416 A CN112887416 A CN 112887416A CN 202110156657 A CN202110156657 A CN 202110156657A CN 112887416 A CN112887416 A CN 112887416A
Authority
CN
China
Prior art keywords
keep
alive
online
equipment
period
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.)
Granted
Application number
CN202110156657.7A
Other languages
Chinese (zh)
Other versions
CN112887416B (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110156657.7A priority Critical patent/CN112887416B/en
Publication of CN112887416A publication Critical patent/CN112887416A/en
Application granted granted Critical
Publication of CN112887416B publication Critical patent/CN112887416B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • 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 provides a frequency adjustment method and a device for sending keep-alive packets, comprising the following steps: under the condition that the device offline rate in the target network is determined to exceed a preset threshold value, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: keep-alive success rate, keep-alive period and keep-alive efficiency of the online equipment; and adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters. The method and the device solve the problem that no scheme for avoiding or reducing the offline of the equipment exists in the related technology, and further achieve the effect of avoiding or reducing the offline of the equipment.

Description

Frequency adjustment method and device for sending keep-alive packets
Technical Field
The present invention relates to the field of communications, and in particular, to a frequency adjustment method and apparatus for sending keep-alive packets.
Background
In a wireless network, a device may be disconnected in communication due to factors such as communication quality or device abnormality, and the device may not be used normally. In practical application, the online/offline state of the terminal needs to be acquired to identify whether the equipment works normally. There is often some relationship between devices in a wireless network, and the more devices that are off-line will result in the inability to complete the task. There is no solution that can avoid or reduce the device from going offline.
In the related art, there is no scheme for avoiding or reducing the offline of the device.
Disclosure of Invention
The embodiment of the invention provides a frequency adjustment method and a frequency adjustment device for sending keep-alive packets, which are used for at least solving the problem that a scheme for avoiding or reducing equipment offline does not exist in the related technology.
According to an embodiment of the present invention, there is provided a frequency adjustment method for transmitting keep-alive packets, including: under the condition that the device offline rate in the target network is determined to exceed a preset threshold value, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment; and adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
Optionally, adjusting the frequency of sending the keep-alive packet by the online device according to the keep-alive parameter includes: judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value; under the condition that the keep-alive success rate is larger than or equal to a first threshold, judging whether the keep-alive efficiency of the online equipment is larger than or equal to a second threshold; and under the condition that the keep-alive efficiency is greater than or equal to a second threshold value, increasing the keep-alive period of the online equipment and/or reducing the maximum retransmission times of the online equipment, wherein the maximum retransmission times are the maximum times of the online equipment transmitting the keep-alive packets in the keep-alive period.
Optionally, the method further comprises: under the condition that the keep-alive success rate is smaller than the first threshold, judging whether the keep-alive period of the online equipment is larger than a third threshold or not; reducing the keep-alive period of the online device under the condition that the keep-alive period of the online device is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
Optionally, in a case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum number of retransmissions of the online device includes: and increasing the maximum retransmission times of the online equipment under the condition that the keep-alive period of the online equipment is equal to the third threshold value and the maximum retransmission times of the online equipment is less than a fourth threshold value.
Optionally, the method further comprises: determining that the current keep-alive of the target equipment fails under the condition that a keep-alive packet sent by the target equipment is not received within first preset time; and under the condition that the target equipment fails to keep alive in the keep-alive period, determining that the target equipment is offline.
According to another embodiment of the present invention, there is provided a frequency adjustment device for transmitting keep-alive packets, including: an obtaining module, configured to obtain a keep-alive parameter of an online device in a target network when it is determined that a device offline rate in the target network exceeds a preset threshold, where the keep-alive parameter includes: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment; and the adjusting module is used for adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
Optionally, the adjusting module includes: the first judgment unit is used for judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value; a second judging unit, configured to judge whether the keep-alive efficiency of the online device is greater than or equal to a second threshold value when the keep-alive success rate is greater than or equal to the first threshold value; a first adjusting unit, configured to increase a keep-alive period of the online device and/or decrease a maximum number of retransmissions of the online device when the keep-alive efficiency is greater than or equal to a second threshold, where the maximum number of retransmissions is a maximum number of times that the online device transmits the keep-alive packet in the keep-alive period.
Optionally, the adjusting module further comprises: a third judging unit, configured to judge whether a keep-alive period of the online device is greater than a third threshold value when the keep-alive success rate is smaller than the first threshold value; the second adjusting unit is used for reducing the keep-alive period of the online equipment under the condition that the keep-alive period of the online equipment is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, under the condition that the device offline rate in the target network is determined to exceed the preset threshold, the keep-alive parameters of the online devices in the target network are obtained, wherein the keep-alive parameters comprise: keep-alive success rate, keep-alive period and keep-alive efficiency of the online equipment; and adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters. Therefore, the problem that a scheme for avoiding or reducing the offline of the equipment does not exist can be solved, and the effect of avoiding or reducing the offline of the equipment is achieved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a frequency adjustment method for transmitting keep-alive packets according to an embodiment of the present invention;
fig. 2 is a flowchart of a frequency adjustment method of transmitting keep-alive packets according to an embodiment of the present invention;
fig. 3 is a schematic topology diagram of a wireless network according to an alternative embodiment of the present invention;
FIG. 4 is a flow diagram of communication resource optimization in accordance with an alternative embodiment of the present invention;
FIG. 5 is an interaction diagram of a single keep-alive of a device in accordance with an alternative embodiment of the invention;
fig. 6 is a block diagram of a frequency adjustment apparatus for transmitting keep-alive packets according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking the operation on the mobile terminal as an example, fig. 1 is a hardware structure block diagram of the mobile terminal of the frequency adjustment method for sending the keep-alive packet according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to the frequency adjustment method for sending keep-alive packets in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a frequency adjustment method for sending keep-alive packets, which is operated in the mobile terminal described above, is provided, and fig. 2 is a flowchart of the frequency adjustment method for sending keep-alive packets according to the embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, under the condition that the device offline rate in the target network is determined to exceed a preset threshold, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment;
and step S204, adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
Through the steps, under the condition that the device offline rate in the target network is determined to exceed the preset threshold, the keep-alive parameters of the online devices in the target network are obtained, wherein the keep-alive parameters comprise: keep-alive success rate, keep-alive period and keep-alive efficiency of the online equipment; and adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters. Therefore, the problem that a scheme for avoiding or reducing the offline of the equipment does not exist can be solved, and the effect of avoiding or reducing the offline of the equipment is achieved.
Alternatively, the execution subject of the above steps may be a terminal or the like, but is not limited thereto.
As an alternative embodiment, the following explains the terms referred to in the present application:
the off-line rate (x) — (number of off-line devices/total number of devices in the network) × 100%
The keep-alive success rate (y) is (the number of times of actual keep-alive success in unit time/the number of times of theoretically keep-alive success in unit time) 100 percent
The keep-alive efficiency (z) is (the number of keep-alive data packets actually sent in unit time/the number of times that keep-alive should be successfully carried out theoretically in unit time) × 100%, wherein the smaller z is, the higher the efficiency is.
Maximum number of retransmissions: the maximum number of retransmissions of the keep-alive data (each device may set a different maximum number of retransmissions).
Keep-alive interval: time interval for uploading keep-alive packets (each device can set a different keep-alive interval).
As an optional implementation manner, the topology of the wireless network is mainly a star network, and the communication effects of different terminals and gateways are different depending on factors such as the installation environment distance, and the like, as shown in fig. 3, a schematic topology diagram of the wireless network according to an optional embodiment of the present invention is shown. When the off-line equipment exists in the system, firstly, the heartbeat cycle of the off-line equipment is greatly shortened, the retransmission times of the equipment are increased, the heartbeat cycle of the on-line equipment with better communication is properly adjusted and the on-line rate of the equipment is preferentially ensured according to the air data duty ratio and the off-line rate of the equipment in the network. And after the off-line rate of the equipment meets the requirement, optimizing the whole communication resource based on several statistical indexes of the keep-alive success rate and the keep-alive efficiency. In this embodiment, the preset threshold of the device offline rate may be determined according to an actual situation, for example, the offline rate may be optimized when there is one offline device in the network, or the offline rate is greater than 10%, 20%, or 25% to optimize the communication resource, and the size of the preset threshold may be determined according to the actual situation, which is not limited herein.
Optionally, adjusting the frequency of sending the keep-alive packet by the online device according to the keep-alive parameter includes: judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value; under the condition that the keep-alive success rate is larger than or equal to a first threshold, judging whether the keep-alive efficiency of the online equipment is larger than or equal to a second threshold; and under the condition that the keep-alive efficiency is greater than or equal to a second threshold value, increasing the keep-alive period of the online equipment and/or reducing the maximum retransmission times of the online equipment, wherein the maximum retransmission times are the maximum times of the online equipment transmitting the keep-alive packets in the keep-alive period.
As an alternative implementation, fig. 4 is a schematic flow chart illustrating communication resource optimization according to an alternative embodiment of the present invention, wherein the optimization shown in fig. 4 can be performed for each online device in the wireless network. In this embodiment, a device with a high keep-alive success rate and a small number of data retransmissions can be considered as a device with a good communication quality. In which case the device has less probability of being offline and more stable communications. The sending period of the keep-alive packet can be properly expanded, the maximum retransmission times can be reduced, and partial network channel resources can be released.
As an optional implementation manner, for an online device in a wireless network, it may be determined first whether a keep-alive success rate of the online device is greater than or equal to a first threshold, if the keep-alive success rate is greater than or equal to the first threshold, it is continuously determined whether a keep-alive efficiency of the online device is greater than or equal to a second threshold, and if the keep-alive efficiency is greater than or equal to the second threshold, it is determined that the device is a device with better communication quality. The first threshold and the second threshold may be determined according to actual conditions, for example, may be 0.5, 0.6, 0.9, and the like, and specific values may be determined according to actual conditions. For the device with better communication quality, the keep-alive period can be increased, or the maximum retransmission times can be reduced, or both the keep-alive period and the maximum retransmission times can be increased, so that the frequency of sending the keep-alive packet by the online device can be reduced. In this embodiment, by reducing the frequency of sending the keep-alive packet by the device with better communication quality, part of network channel resources can be released, more resources are provided for the other devices, and the number of offline devices is reduced.
Optionally, the method further comprises: under the condition that the keep-alive success rate is smaller than the first threshold, judging whether the keep-alive period of the online equipment is larger than a third threshold or not; reducing the keep-alive period of the online device under the condition that the keep-alive period of the online device is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
As an optional implementation manner, the communication quality of the device with the low keep-alive success rate of the terminal is poor, the corresponding offline probability is also increased, and the keep-alive success rate can be improved by reducing the keep-alive period and increasing the keep-alive frequency and the retransmission times. In this implementation, if the keep-alive success rate of the online device is smaller than the first threshold, it is determined that the communication quality of the online device is poor, and the first threshold may be determined according to an actual situation, and may be, for example, 0.5, 0.6, 0.9, and the like. And judging whether the keep-alive period of the online device reaches the minimum, wherein the third threshold corresponds to the minimum keep-alive period, and the minimum keep-alive period can be determined according to actual conditions, and can be 10 minutes of porridge, 30 minutes, 1 hour and the like. If the keep-alive period of the online equipment is larger than the minimum keep-alive period, the keep-alive period of the online equipment can be reduced. If the keep-alive period of the online equipment reaches the minimum, the times of sending the keep-alive packets by the online equipment can be increased. Therefore, the frequency of the line equipment for sending the keep-alive packets can be increased.
Optionally, in a case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum number of retransmissions of the online device includes: and increasing the maximum retransmission times of the online equipment under the condition that the keep-alive period of the online equipment is equal to the third threshold value and the maximum retransmission times of the online equipment is less than a fourth threshold value.
As an optional implementation manner, if the keep-alive period of the online device reaches the minimum, determining whether the maximum retransmission number of the device reaches the maximum number, where there is an upper limit for the maximum retransmission number of the device in the wireless network, and the size of the fourth threshold may be determined according to the actual situation, and may be, for example, 100, 50, 80, and so on. If the maximum retransmission times of the online equipment is smaller than the threshold, the maximum retransmission times of the online equipment can be increased, so that the frequency of sending the keep-alive packets by the online equipment is improved, and the offline rate is reduced.
As an optional implementation, the keep-alive success rate is high, but the communication quality of the online device with low keep-alive efficiency is general, in which case the offline rate of the device is low, but the actual communication is not very stable, and the data is retransmitted. Normally no adjustment is made in this case.
Optionally, the method further comprises: determining that the current keep-alive of the target equipment fails under the condition that a keep-alive packet sent by the target equipment is not received within first preset time; and under the condition that the target equipment fails to keep alive in the keep-alive period, determining that the target equipment is offline.
As an optional implementation manner, a single keep-alive interaction process performed by a device may refer to fig. 5, where fig. 5 is an interaction schematic diagram of single keep-alive of the device according to an optional embodiment of the present invention, where the device reports a keep-alive packet to a gateway, where the keep-alive packet may be keep-alive data, and the gateway performs an ack acknowledgement after receiving the keep-alive packet. If the response is overtime, the terminal retransmits the data with the maximum retransmission times as the limit until the host responds, and at the moment, the keep-alive is considered to be successful. And when the ack response which is valid by the host is not received after the maximum retransmission times is reached, judging that the keep-alive fails. Or, the gateway determines that the keep-alive fails this time when the keep-alive packet sent by the device is not received within a first predetermined time, where the first predetermined time may be determined according to an actual situation, and may be, for example, 30 seconds, 10 seconds, and the like.
As an optional implementation manner, the keep-alive packet may include an address of the device, a current keep-alive packet period, a current maximum retransmission number, and other information. When the time T is within the specified time T, which may be a keep-alive period, the devices all fail to keep alive continuously, that is, the gateway does not receive keep-alive data of the corresponding device within the time T, and the device is determined to be offline. When the off-line equipment exists in the system, firstly, the heartbeat cycle of the off-line equipment is greatly shortened, the retransmission times of the equipment are increased, the heartbeat cycle of the on-line equipment with better communication is properly adjusted and the on-line rate of the equipment is preferentially ensured according to the air data duty ratio and the off-line rate of the equipment in the network. In this embodiment, since the wireless environment is dynamically changed, the keep-alive mechanism of each device is also adjusted accordingly, thereby implementing keep-alive adaptation in the network and reducing or avoiding terminal offline.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a frequency adjustment device for sending keep-alive packets is further provided, and the frequency adjustment device is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a block diagram of a frequency adjustment apparatus for transmitting keep-alive packets according to an embodiment of the present invention, and as shown in fig. 6, the apparatus includes: an obtaining module 62, configured to obtain a keep-alive parameter of an online device in a target network when it is determined that a device offline rate in the target network exceeds a preset threshold, where the keep-alive parameter includes: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment; and an adjusting module 64, configured to adjust a frequency of sending the keep-alive packet by the online device according to the keep-alive parameter.
Optionally, the adjusting module includes: the first judgment unit is used for judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value; a second judging unit, configured to judge whether the keep-alive efficiency of the online device is greater than or equal to a second threshold value when the keep-alive success rate is greater than or equal to the first threshold value; a first adjusting unit, configured to increase a keep-alive period of the online device and/or decrease a maximum number of retransmissions of the online device when the keep-alive efficiency is greater than or equal to a second threshold, where the maximum number of retransmissions is a maximum number of times that the online device transmits the keep-alive packet in the keep-alive period.
Optionally, the adjusting module further comprises: a third judging unit, configured to judge whether a keep-alive period of the online device is greater than a third threshold value when the keep-alive success rate is smaller than the first threshold value; the second adjusting unit is used for reducing the keep-alive period of the online equipment under the condition that the keep-alive period of the online equipment is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
Optionally, the foregoing apparatus is further configured to increase the maximum number of retransmissions of the online device when the keep-alive period of the online device is equal to the third threshold by: and increasing the maximum retransmission times of the online equipment under the condition that the keep-alive period of the online equipment is equal to the third threshold value and the maximum retransmission times of the online equipment is less than a fourth threshold value.
Optionally, the apparatus is further configured to determine that the current keep-alive of the target device fails when the keep-alive packet sent by the target device is not received within a first predetermined time; and under the condition that the target equipment fails to keep alive in the keep-alive period, determining that the target equipment is offline.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, under the condition that the device offline rate in the target network is determined to exceed a preset threshold, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment;
s2, adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
Optionally, the storage medium is further arranged to store a computer program for performing the steps of:
optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, under the condition that the device offline rate in the target network is determined to exceed a preset threshold, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment;
s2, adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A frequency adjustment method for sending keep-alive packets is characterized by comprising the following steps:
under the condition that the device offline rate in the target network is determined to exceed a preset threshold value, acquiring keep-alive parameters of online devices in the target network, wherein the keep-alive parameters comprise: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment;
and adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
2. The method of claim 1, wherein adjusting the frequency of keep-alive packets sent by the online device according to the keep-alive parameters comprises:
judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value;
under the condition that the keep-alive success rate is larger than or equal to a first threshold, judging whether the keep-alive efficiency of the online equipment is larger than or equal to a second threshold;
and under the condition that the keep-alive efficiency is greater than or equal to a second threshold value, increasing the keep-alive period of the online equipment and/or reducing the maximum retransmission times of the online equipment, wherein the maximum retransmission times are the maximum times of the online equipment transmitting the keep-alive packets in the keep-alive period.
3. The method of claim 2, further comprising:
under the condition that the keep-alive success rate is smaller than the first threshold, judging whether the keep-alive period of the online equipment is larger than a third threshold or not;
reducing the keep-alive period of the online device under the condition that the keep-alive period of the online device is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
4. The method of claim 3, wherein increasing the maximum number of retransmissions for the online device if the keep-alive period for the online device is equal to the third threshold comprises:
and increasing the maximum retransmission times of the online equipment under the condition that the keep-alive period of the online equipment is equal to the third threshold value and the maximum retransmission times of the online equipment is less than a fourth threshold value.
5. The method according to any one of claims 1 to 4, further comprising:
determining that the current keep-alive of the target equipment fails under the condition that a keep-alive packet sent by the target equipment is not received within first preset time;
and under the condition that the target equipment fails to keep alive in the keep-alive period, determining that the target equipment is offline.
6. A frequency adjustment device for transmitting keep-alive packets, comprising:
an obtaining module, configured to obtain a keep-alive parameter of an online device in a target network when it is determined that a device offline rate in the target network exceeds a preset threshold, where the keep-alive parameter includes: the keep-alive success rate, the keep-alive period and the keep-alive efficiency of the online equipment;
and the adjusting module is used for adjusting the frequency of the keep-alive packet sent by the online equipment according to the keep-alive parameters.
7. The apparatus of claim 6, wherein the adjustment module comprises:
the first judgment unit is used for judging whether the keep-alive success rate of the online equipment is greater than or equal to a first threshold value;
a second judging unit, configured to judge whether the keep-alive efficiency of the online device is greater than or equal to a second threshold value when the keep-alive success rate is greater than or equal to the first threshold value;
a first adjusting unit, configured to increase a keep-alive period of the online device and/or decrease a maximum number of retransmissions of the online device when the keep-alive efficiency is greater than or equal to a second threshold, where the maximum number of retransmissions is a maximum number of times that the online device transmits the keep-alive packet in the keep-alive period.
8. The apparatus of claim 7, wherein the adjustment module further comprises:
a third judging unit, configured to judge whether a keep-alive period of the online device is greater than a third threshold value when the keep-alive success rate is smaller than the first threshold value;
the second adjusting unit is used for reducing the keep-alive period of the online equipment under the condition that the keep-alive period of the online equipment is larger than a third threshold value; or, in the case that the keep-alive period of the online device is equal to the third threshold, increasing the maximum retransmission number of the online device.
9. A storage medium, in which a computer program is stored, wherein the program is executable by a terminal device or a computer to perform the method of any one of claims 1 to 5.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 5.
CN202110156657.7A 2021-02-04 2021-02-04 Frequency adjustment method and device for sending keep-alive packets Active CN112887416B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110156657.7A CN112887416B (en) 2021-02-04 2021-02-04 Frequency adjustment method and device for sending keep-alive packets

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110156657.7A CN112887416B (en) 2021-02-04 2021-02-04 Frequency adjustment method and device for sending keep-alive packets

Publications (2)

Publication Number Publication Date
CN112887416A true CN112887416A (en) 2021-06-01
CN112887416B CN112887416B (en) 2022-10-18

Family

ID=76057269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110156657.7A Active CN112887416B (en) 2021-02-04 2021-02-04 Frequency adjustment method and device for sending keep-alive packets

Country Status (1)

Country Link
CN (1) CN112887416B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114630393A (en) * 2022-02-25 2022-06-14 深圳市海洋王石油照明技术有限公司 Method and device for updating state and computer storage medium
CN115086263A (en) * 2022-07-22 2022-09-20 康键信息技术(深圳)有限公司 IM message sending method, system, storage medium and computer equipment of IOS terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731875A (en) * 2012-10-12 2014-04-16 中兴通讯股份有限公司 Method and system for adaptively adjusting paging sending time number
CN104813641A (en) * 2012-10-22 2015-07-29 交互数字专利控股公司 Method and apparatus for negotiating "keep-alive" message frequencies of applications running on a mobile station
WO2016002436A1 (en) * 2014-06-30 2016-01-07 ソニー株式会社 Wireless communications device, wireless communications method, and program
CN105610913A (en) * 2015-12-22 2016-05-25 用友网络科技股份有限公司 Heartbeat keep-alive method and apparatus for long connection in communication network
CN109474494A (en) * 2018-12-05 2019-03-15 深圳绿米联创科技有限公司 Equipment detection method, device, server and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103731875A (en) * 2012-10-12 2014-04-16 中兴通讯股份有限公司 Method and system for adaptively adjusting paging sending time number
CN104813641A (en) * 2012-10-22 2015-07-29 交互数字专利控股公司 Method and apparatus for negotiating "keep-alive" message frequencies of applications running on a mobile station
WO2016002436A1 (en) * 2014-06-30 2016-01-07 ソニー株式会社 Wireless communications device, wireless communications method, and program
CN105610913A (en) * 2015-12-22 2016-05-25 用友网络科技股份有限公司 Heartbeat keep-alive method and apparatus for long connection in communication network
CN109474494A (en) * 2018-12-05 2019-03-15 深圳绿米联创科技有限公司 Equipment detection method, device, server and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114630393A (en) * 2022-02-25 2022-06-14 深圳市海洋王石油照明技术有限公司 Method and device for updating state and computer storage medium
CN115086263A (en) * 2022-07-22 2022-09-20 康键信息技术(深圳)有限公司 IM message sending method, system, storage medium and computer equipment of IOS terminal
CN115086263B (en) * 2022-07-22 2024-04-05 康键信息技术(深圳)有限公司 IM message sending method, system, storage medium and computer equipment of IOS terminal

Also Published As

Publication number Publication date
CN112887416B (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN112887416B (en) Frequency adjustment method and device for sending keep-alive packets
CN111865736B (en) Equipment control method and device
US20190159064A1 (en) Data transmission method and device
CN113259391B (en) Data transmission method and device applied to multi-level node network
CN113721966B (en) Node upgrading method and device, storage medium and electronic device
CN104038845A (en) Method and device for transmitting message
CN104980257B (en) Internet of things communication method and device
CN105262836A (en) Information push method of server and push information reception method of client
CN113572694A (en) Congestion control method, device and system and computer storage medium
CN112565341A (en) Method, apparatus, system, device and storage medium for diagnosing routing
CN107508916B (en) Server link management method for intelligent robot
CN115687226A (en) I2c bus communication method, device and readable storage medium
CN102811451B (en) Method and device for controlling connection of control and provisioning of wireless access points (Capwap) tunnel
EP3041285B1 (en) Data frame sending method and apparatus
CN110856120B (en) Message sending and receiving method and device
CN108988994B (en) Message retransmission method and device
CN114422573B (en) Message sending method and device, storage medium and electronic device
CN106850153B (en) Data retransmission method and system
CN114125052B (en) Target operation execution method and device, storage medium and electronic device
WO2020259277A1 (en) Parameter optimization method and apparatus, base station, server and storage medium
US20230344554A1 (en) Access layer ip packet processing method, apparatus and device
CN111917511B (en) Data receiving method
CN113347681A (en) Data transmission method, data transmission device, storage medium and electronic device
CN112714440A (en) Communication method, system, gateway and storage medium compatible with LoRaWAN and self-research protocol
CN110099001A (en) The machinery of consultation of two-way converting parameters of detection time, device and electronic equipment

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