CN108834179B - Method, server and client for adjusting heartbeat cycle - Google Patents

Method, server and client for adjusting heartbeat cycle Download PDF

Info

Publication number
CN108834179B
CN108834179B CN201810547756.6A CN201810547756A CN108834179B CN 108834179 B CN108834179 B CN 108834179B CN 201810547756 A CN201810547756 A CN 201810547756A CN 108834179 B CN108834179 B CN 108834179B
Authority
CN
China
Prior art keywords
client
heartbeat
heartbeat cycle
identification information
type
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
CN201810547756.6A
Other languages
Chinese (zh)
Other versions
CN108834179A (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 Cooday Communication Co ltd
Original Assignee
Shenzhen Cooday Communication 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 Cooday Communication Co ltd filed Critical Shenzhen Cooday Communication Co ltd
Priority to CN201810547756.6A priority Critical patent/CN108834179B/en
Publication of CN108834179A publication Critical patent/CN108834179A/en
Application granted granted Critical
Publication of CN108834179B publication Critical patent/CN108834179B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0212Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave
    • H04W52/0216Power saving arrangements in terminal devices managed by the network, e.g. network or access point is master and terminal is slave using a pre-established activity schedule, e.g. traffic indication frame
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention is suitable for the technical field of Internet of things, and provides a method for adjusting a heartbeat cycle, a server and a client, wherein the method comprises the following steps: determining the heartbeat cycle of the client according to the identification information of the client and a preset heartbeat table, wherein the identification information is the only information for determining the client, and the heartbeat table is a corresponding relation table of the identification information of the client and the heartbeat cycle; acquiring the data loss times of a client within a preset time T; determining a new heartbeat cycle according to the heartbeat cycle of the client and the data loss frequency of the client within the preset time T; and sending a first notification message to the client, wherein the first notification message contains the new heartbeat cycle. The period of sending the heartbeat packets by the client is dynamically adjusted according to the period of sending the heartbeat packets by the client and the times of historical data loss in the period, so that the waste of network resources and the consumption of electric quantity and flow of the client caused by sending a large number of heartbeat packets by the client are reduced while the data transmission quality is ensured.

Description

Method, server and client for adjusting heartbeat cycle
Technical Field
The invention belongs to the technical field of Internet of things, and particularly relates to a method for adjusting a heartbeat cycle, a server and a client.
Background
In the field of internet of things, Push service becomes an indispensable important component of App (Application, mobile phone software) Application, and the Push service can improve the activity and retention rate of users. Most of the various advertisements and prompt messages received by our mobile phone every day are realized by push service. With the development of the internet of things, most smart homes and wearable devices support mobile push services, and all smart devices accessing the internet of things will be clients of the push services in the future, which means that the push services will face massive devices and terminals to access in the future.
In order to ensure the quality of the push service, a long connection needs to be established between the client and the server, and the heartbeat mechanism is a mechanism for ensuring the effectiveness of the long connection between the client and the server. However, in the mobile communication network, due to the large number of users and the scarce resources, each user dynamically occupies resources, such as an IP address and a radio channel. Each time the heartbeat packet is sent, the mobile communication network is required to allocate resources for the user, and the allocation process is embodied in the sending and receiving of the signaling. The sending process of one heartbeat packet involves dozens of signaling. When a large number of clients access the server, not only huge network resources are consumed, but also the flow and power consumption of the clients are increased.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a server, and a client for adjusting a heartbeat cycle, so as to solve the problems of large network resource consumption, large terminal traffic and large power consumption caused by long connection between the client and the server in the prior art.
A first aspect of an embodiment of the present invention provides a method for adjusting a heartbeat cycle, including:
determining a heartbeat cycle of a client according to identification information of the client and a preset heartbeat table, wherein the identification information is the only information for determining the client, and the heartbeat table is a corresponding relation table of the identification information of the client and the heartbeat cycle;
acquiring the data loss times of the client within a preset time T;
determining a new heartbeat cycle according to the heartbeat cycle of the client and the data loss frequency of the client within a preset time T;
and sending a first notification message to the client, wherein the first notification message comprises the new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
Further, after determining a new heartbeat cycle according to the heartbeat cycle of the client and the number of times of data loss of the client within the preset time T, the method further includes:
and putting the new heartbeat cycle into the heartbeat table, so that the heartbeat table is a corresponding relation table of the identification information of the client and the new heartbeat cycle.
Further, the method further comprises:
determining the type of the client according to the identification information of the client and a preset client type table, wherein the client type comprises a power consumption limiting client and a non-power consumption limiting client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client;
if the heartbeat cycle of the client is determined to be T1 according to the identification information of the client and a preset heartbeat table, determining a new heartbeat cycle according to the heartbeat cycle of the client and the data loss times of the client within a preset time T specifically includes:
if the client is a power consumption limitation client and the data loss frequency of the client in a preset time T exceeds a preset value a1, determining that a new heartbeat cycle is T2;
if the client is a non-power-consumption-limited client and the data loss frequency of the client in a preset time T exceeds a preset value a2, determining that a new heartbeat cycle is T2;
wherein t1 > t2, a1 > a2, and a1 and a2 are both positive integers.
Further, the method further comprises:
receiving a second notification message sent by the client, wherein the second notification message comprises identification information of the client and type information of the client;
and creating the client type table according to the identification information of the client and the type information of the client.
Further, the first notification message includes a message header, a message body, and a message trailer, where the message header includes address information of a sending end of the notification message and the client, the message body includes the new heartbeat cycle, and the message trailer includes an end identifier of the notification message.
A second aspect of the embodiments of the present invention provides a method for adjusting a heartbeat cycle, where the method includes:
receiving a first notification message, wherein the first notification message comprises a new heartbeat cycle;
and sending a heartbeat packet to the server according to the new heartbeat period.
Further, before receiving the first notification message, the method further includes:
and sending a second notification message to the server, wherein the second notification message comprises the identification information of the client and the type information of the client, and the type of the client comprises a power consumption limitation type client and a non-power consumption limitation type client, so that the server creates a client type table according to the identification information of the client and the type information of the client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client.
A third aspect of the embodiments of the present invention provides a server, where the server includes a first determining unit, an obtaining unit, a second determining unit, and a sending unit;
the first determining unit is configured to determine a heartbeat cycle of the client according to identification information of the client and a preset heartbeat table, where the identification information is information that uniquely determines the client, and the heartbeat table is a corresponding relationship table between the identification information of the client and the heartbeat cycle;
the acquiring unit is used for acquiring the data loss times of the client within a preset time T;
the second determining unit is configured to determine a new heartbeat cycle according to the heartbeat cycle of the client and the data loss frequency of the client within a preset time T;
the sending unit is configured to send a first notification message to the client, where the first notification message includes the new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
A fourth aspect of the embodiments of the present invention provides a client, where the client includes a receiving unit and a sending unit;
the receiving unit is configured to receive a first notification message, where the first notification message includes a new heartbeat cycle;
and the sending unit is used for sending the heartbeat packet to the server according to the new heartbeat cycle.
A fifth aspect of embodiments of the present invention provides a server, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method for adjusting a heartbeat cycle according to any one of the first aspect when executing the computer program.
A sixth aspect of embodiments of the present invention provides a client, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the method for adjusting a heartbeat cycle according to any one of the second aspect when executing the computer program.
A seventh aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method of adjusting a heartbeat cycle as in any one of the first aspects.
An eighth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method of adjusting a heartbeat cycle according to any one of the second aspects.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: the heartbeat period of the heartbeat packet sent by the client is dynamically adjusted according to the heartbeat period of the heartbeat packet sent by the client and the number of times of historical data loss in the period, so that the data transmission quality is ensured, and the waste of network resources and the consumption of electric quantity and flow caused by the fact that a large number of heartbeat packets are sent by the client are reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a method for adjusting a heartbeat cycle according to an embodiment of the present invention;
fig. 2 is a flowchart of another method for adjusting a heartbeat cycle according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a server according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a client according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another server provided by an embodiment of the invention;
fig. 6 is a schematic diagram of another client according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the 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 explain the technical means of the present invention, the following description will be given by way of specific examples.
With reference to fig. 1, an embodiment of the present invention provides a method for adjusting a heartbeat cycle, where the method is applied to a server, and the method includes:
s101, determining the heartbeat cycle of the client according to the identification information of the client and a preset heartbeat table, wherein the identification information is the only information for determining the client, and the heartbeat table is a corresponding relation table of the identification information of the client and the heartbeat cycle.
The client can be uniquely determined and uniquely associated through the identification information of the client, for example, when the client is a Mobile terminal of GSM (Global System for Mobile communication) and WCDMA (Wideband Code Division Multiple Access) systems, IMEI (International Mobile Equipment Identity) can be used as the identification information of the client; when the client is a Mobile terminal of CDMA (Code Division Multiple Access) system, the MEID (Mobile Equipment Identifier) may be used as the identification information of the client. Specifically, the embodiment of the present invention does not limit the identification information of the client, and any information that can uniquely determine and uniquely associate with the client may be used as the identification information of the client.
The server creates a heartbeat table through the identification information of the client and the initial heartbeat cycle of the client, wherein the heartbeat table contains the corresponding relationship between the identification information of all the clients connected with the server and the heartbeat cycle, for example, client 1 corresponds to identification 1, and client 2 corresponds to identification 2 … …, client n corresponds to identification n. The heartbeat cycle of the client in the heartbeat table may have a plurality of obtaining modes, for example, the server detects that a time interval of receiving the heartbeat packet of the client in a fixed time period is the heartbeat cycle of the client, or the client sends the heartbeat cycle to the server, or the heartbeat cycle is preset, which is not limited in the embodiment of the present invention.
When the identification information of the client is known, the heartbeat period of the client can be determined according to the heartbeat table.
S102, acquiring the data loss times of the client within the preset time T.
When the heartbeat period is too large, the number of times of data loss in the data transmission process between the server and the client is large. In order to ensure the communication quality, the data loss times need to be maintained within an acceptable range. In this step, the server may record the number of times of data loss sent to the client within a preset time T.
S103, determining a new heartbeat cycle according to the heartbeat cycle of the client and the data loss frequency of the client within the preset time T.
Preferably, when the data loss frequency of the client within the preset time T exceeds a preset value, the heartbeat cycle is reduced, and a new heartbeat cycle is generated, for example, the original heartbeat cycle of the client is 20 seconds, and the new heartbeat cycle may be 18 seconds.
In another possible implementation manner, if the number of data loss times of the client within each preset time T of the m continuous preset times T is less than the preset value, the heartbeat cycle may be increased, and a new heartbeat cycle may be generated. For example, the original heartbeat cycle of the client is 20 seconds, the preset time T is 1 day, the preset value is 5, when the data loss times of the client in 3 consecutive days are all less than 5, the heartbeat cycle can be increased, and the new heartbeat cycle can be 22 seconds.
It should be noted that, it is within the scope of the present invention to determine, according to the heartbeat cycle, the number of times of data loss within the preset time T, and the preset value, that a new heartbeat cycle is obtained by reducing the original heartbeat cycle or increasing the original heartbeat cycle, and besides, the above-mentioned original heartbeat cycle is increased from 20 seconds to 18 seconds, or from 20 seconds to 22 seconds, which is merely an example, and any feasible implementation manner based on the idea of the present invention is within the scope of the present invention.
Preferably, determining the new heartbeat cycle also requires consideration of the type of client. Specifically, the client types include a power consumption limiting client and a non-power consumption limiting client, where the power consumption limiting client refers to a client with limited electric quantity and limited flow, such as a mobile phone, a smart watch, and the like, and the non-power consumption limiting client refers to a client with unlimited electric quantity or flow, such as a desktop computer.
For the power consumption limiting client, the longer the heartbeat cycle of the client sending the heartbeat packet, the smaller the loss of the flow and the electric quantity, at this time, part of the communication quality can be sacrificed to reduce the loss of the electric quantity and the flow, and for the non-power consumption limiting client, the communication quality can be maintained as much as possible.
Based on this, preferably, the type of the client is determined according to the identification information of the client and a preset client type table, where the client type table is a correspondence table between the identification information of the client and the type information of the client. If the heartbeat cycle of the client is determined to be t1 according to the identification information of the client and the preset heartbeat table, the method for determining the new heartbeat cycle by combining the type of the client comprises the following steps:
if the client is a power consumption limitation type client and the data loss frequency of the client in the preset time T exceeds a preset value a1, determining that a new heartbeat cycle is T2, and if the client is a no power consumption limitation type client and the data loss frequency of the client in the preset time T exceeds a preset value a2, determining that the new heartbeat cycle is T2, wherein T1 is greater than T2, a1 is greater than a2, and a1 and a2 are positive integers.
For example, the preset time T is 1 day, the heartbeat period of the client is T1 ═ 20s, when the client is a non-power consumption limitation type client, since the power consumption limitation of the client is not considered, it may be set to determine a new heartbeat period T2 ═ 18s when the data loss number exceeds a2 ═ 5 times; when the client is a power consumption limiting client, since power consumption and traffic consumption of the client need to be considered, it may be set to determine that the new heartbeat cycle t2 is 18s when the data loss time a1 is 8 times.
Preferably, the method for creating the client type table includes:
receiving a second notification message sent by the client, wherein the second notification message comprises identification information of the client and type information of the client;
and creating the client type table according to the identification information of the client and the type information of the client.
S104, sending a first notification message to the client, wherein the first notification message comprises a new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
Preferably, the first notification message includes a message header, a message body, and a message trailer, where the message header includes address information of a sending end of the notification message and the client, the message body includes the new heartbeat cycle, and the message trailer includes an end identifier of the notification message.
Preferably, after a new heartbeat cycle is determined, the new heartbeat cycle is put into the heartbeat table, so that the heartbeat table is a corresponding relationship table between the identification information of the client and the new heartbeat cycle. For example, the identification information of the client 1 is identification 1, the original heartbeat cycle of the client 1 is t1, the adjusted heartbeat cycle is t2, and after a new heartbeat cycle t2 is determined, t1 is replaced by t2, so that the heartbeat cycle corresponding to identification 1 is t2 in the heartbeat table.
The embodiment of the invention provides a method for adjusting a heartbeat cycle, which dynamically adjusts the cycle of sending heartbeat packets by a client according to the cycle of sending the heartbeat packets by the client and the number of times of historical data loss in the cycle, and reduces the waste of network resources and the consumption of electric quantity and flow caused by sending a large number of heartbeat packets by the client while ensuring the data transmission quality.
Further, with reference to fig. 2, an embodiment of the present invention further provides a method for adjusting a heartbeat cycle, where the method is applied to a client, and the method includes:
s201, receiving a first notification message, wherein the first notification message comprises a new heartbeat cycle.
And S202, sending a heartbeat packet to the server according to the new heartbeat cycle.
Preferably, the method further comprises: and sending a second notification message to the server, wherein the second notification message comprises the identification information of the client and the type information of the client, and the type of the client comprises a power consumption limitation type client and a non-power consumption limitation type client, so that the server creates a client type table according to the identification information of the client and the type information of the client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client.
The embodiment of the invention provides a method for adjusting a heartbeat cycle, which is characterized in that a new heartbeat cycle dynamically adjusted by a server according to the cycle of sending heartbeat packets by a client and the number of times of historical data loss in the cycle is received, and data is sent to the server according to the new heartbeat cycle, so that the waste of network resources and the consumption of electric quantity and flow caused by the fact that the client sends a large number of heartbeat packets are reduced while the data transmission quality is ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Further, with reference to fig. 3, an embodiment of the present invention provides a server, where the server includes a first determining unit 31, an obtaining unit 32, a second determining unit 33, and a sending unit 34;
the first determining unit 31 is configured to determine a heartbeat cycle of the client according to identification information of the client and a preset heartbeat table, where the identification information is information that uniquely determines the client, and the heartbeat table is a corresponding relationship table between the identification information of the client and the heartbeat cycle;
the obtaining unit 32 is configured to obtain the number of data loss times of the client within a preset time T;
the second determining unit 33 is configured to determine a new heartbeat cycle according to the heartbeat cycle of the client and the data loss frequency of the client within the preset time T;
the sending unit 34 is configured to send a first notification message to the client, where the first notification message includes the new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
Further, the server further includes a replacing unit 35, configured to put the new heartbeat cycle into the heartbeat table, so that the heartbeat table is a correspondence table between the identification information of the client and the new heartbeat cycle.
Further, the server further comprises a third determining unit 36;
the third determining unit 36 is configured to determine the type of the client according to the identification information of the client and a preset client type table, where the client type includes a power consumption limitation-type client and a non-power consumption limitation-type client, and the client type table is a correspondence table between the identification information of the client and the type information of the client;
if the first determining unit 31 determines that the heartbeat cycle of the client is t1 according to the identification information of the client and the preset heartbeat table, the second determining unit 33 is specifically configured to: if the client is a power consumption limitation type client and the data loss frequency of the client in the preset time T exceeds a preset value a1, determining that a new heartbeat cycle is T2, and if the client is a no power consumption limitation type client and the data loss frequency of the client in the preset time T exceeds a preset value a2, determining that the new heartbeat cycle is T2, wherein T1 is greater than T2, a1 is greater than a2, and a1 and a2 are positive integers.
Further, the server further includes a receiving unit 37 and a creating unit 38;
a receiving unit 37, configured to receive a second notification message sent by the client, where the second notification message includes identification information of the client and type information of the client;
a creating unit 38, configured to create the client type table according to the identification information of the client and the type information of the client.
Further, the first notification message includes a message header, a message body, and a message trailer, where the message header includes address information of a sending end of the notification message and the client, the message body includes the new heartbeat cycle, and the message trailer includes an end identifier of the notification message.
The embodiment of the invention provides a server, which dynamically adjusts the period of sending heartbeat packets by a client according to the period of sending the heartbeat packets by the client and the number of times of historical data loss in the period, so that the waste of network resources and the consumption of electric quantity and flow of the server caused by sending a large number of heartbeat packets by the client are reduced while the data transmission quality is ensured.
Further, in conjunction with fig. 4, an embodiment of the present invention provides a client, including a receiving unit 41 and a sending unit 42,
a receiving unit 41, configured to receive a first notification message, where the first notification message includes a new heartbeat cycle;
and a sending unit 42, configured to send the heartbeat packet to the server according to the new heartbeat cycle.
Further, the sending unit 42 is further configured to: and sending a second notification message to the server, wherein the second notification message comprises the identification information of the client and the type information of the client, and the type of the client comprises a power consumption limitation type client and a non-power consumption limitation type client, so that the server creates a client type table according to the identification information of the client and the type information of the client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client.
The embodiment of the invention provides a client, which dynamically adjusts a new heartbeat cycle according to the cycle of sending heartbeat packets by a client and the number of times of historical data loss in the cycle by a receiving server, and sends data to the server according to the new heartbeat cycle, so that the waste of network resources and the consumption of electric quantity and flow caused by the fact that the client sends a large number of heartbeat packets are reduced while the data transmission quality is ensured.
Further, in conjunction with fig. 5, an embodiment of the present invention provides a server, as shown in fig. 5, where the server 5 of this embodiment includes: a processor 50, a memory 51 and a computer program 52 stored in said memory 51 and executable on said processor 50, such as a program of a method of adjusting a heart beat cycle. The processor 50, when executing the computer program 52, implements the steps in the above-mentioned embodiments of the method for adjusting a heartbeat cycle, such as the steps 101 to 104 shown in fig. 1. Alternatively, the processor 50, when executing the computer program 52, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 31 to 38 shown in fig. 3.
Illustratively, the computer program 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 52 in the server 5.
The server 5 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The server may include, but is not limited to, a processor 50, a memory 51. Those skilled in the art will appreciate that fig. 5 is merely an example of a server 5 and does not constitute a limitation of server 5 and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server may also include input output devices, network access devices, buses, etc.
The Processor 50 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 51 may be an internal storage unit of the server 5, such as a hard disk or a memory of the server 5. The memory 51 may also be an external storage device of the server 5, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the server 5. Further, the memory 51 may also include both an internal storage unit and an external storage device of the server 5. The memory 51 is used for storing the computer program and other programs and data required by the server. The memory 51 may also be used to temporarily store data that has been output or is to be output.
With reference to fig. 6, an embodiment of the present invention provides a client, and as shown in fig. 6, a server 6 of the embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60, such as a program of a method of adjusting a heart cycle. The processor 60 executes the computer program 62 to implement the steps in the above-mentioned embodiments of the method for adjusting a heartbeat cycle, such as the steps 201 to 202 shown in fig. 2. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the above-mentioned device embodiments, such as the functions of the modules 41 to 42 shown in fig. 4.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 62 in the server 6.
The server 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The server may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a server 6 and does not constitute a limitation of the server 6, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the server may also include input output devices, network access devices, buses, etc.
The Processor 60 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the server 6, such as a hard disk or a memory of the server 6. The memory 61 may also be an external storage device of the server 6, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) and the like provided on the server 6. Further, the memory 61 may also include both an internal storage unit of the server 6 and an external storage device. The memory 61 is used for storing the computer program and other programs and data required by the server. The memory 61 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of 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 processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
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 implementation. 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 ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. . Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (12)

1. A method of adjusting a heartbeat cycle, comprising:
determining a heartbeat cycle of a client according to identification information of the client and a preset heartbeat table, wherein the identification information is the only information for determining the client, and the heartbeat table is a corresponding relation table of the identification information of the client and the heartbeat cycle;
acquiring the data loss times of the client within a preset time T;
determining the type of the client according to the identification information of the client and a preset client type table, wherein the client type comprises a power consumption limiting client and a non-power consumption limiting client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client;
wherein, according to the identification information of the client and the preset heartbeat table, the heartbeat cycle of the client is determined to be t1,
if the client is a power consumption limitation client and the data loss frequency of the client in a preset time T exceeds a preset value a1, determining that a new heartbeat cycle is T2;
if the client is a non-power-consumption-limited client and the data loss frequency of the client in a preset time T exceeds a preset value a2, determining that a new heartbeat cycle is T2;
wherein t1 > t2, a1 > a2, and a1 and a2 are both positive integers;
and sending a first notification message to the client, wherein the first notification message comprises the new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
2. The method according to claim 1, wherein after determining a new heartbeat cycle according to the heartbeat cycle of the client and the number of data losses of the client within a preset time T, the method further comprises:
and putting the new heartbeat cycle into the heartbeat table, so that the heartbeat table is a corresponding relation table of the identification information of the client and the new heartbeat cycle.
3. The method of claim 1, further comprising:
receiving a second notification message sent by the client, wherein the second notification message comprises identification information of the client and type information of the client;
and creating the client type table according to the identification information of the client and the type information of the client.
4. The method according to any of claims 1-3, wherein the first notification message comprises a header, a body, and a trailer, the header comprises address information of a sender of the notification message and the client, the body comprises the new heartbeat cycle, and the trailer comprises an end identifier of the notification message.
5. A method of adjusting a heartbeat cycle, the method comprising:
sending identification information of a client to a server so that the server executes the steps in the method for adjusting the heartbeat cycle according to claim 1;
receiving a first notification message from the server, wherein the first notification message comprises a new heartbeat cycle;
and sending a heartbeat packet to the server according to the new heartbeat period.
6. The method of claim 5, wherein prior to receiving the first notification message, the method further comprises:
and sending a second notification message to the server, wherein the second notification message comprises the identification information of the client and the type information of the client, and the type of the client comprises a power consumption limitation type client and a non-power consumption limitation type client, so that the server creates a client type table according to the identification information of the client and the type information of the client, and the client type table is a corresponding relation table of the identification information of the client and the type information of the client.
7. A server is characterized by comprising a first determining unit, an obtaining unit, a second determining unit and a sending unit;
the first determining unit is configured to determine a heartbeat cycle of the client according to identification information of the client and a preset heartbeat table, where the identification information is information that uniquely determines the client, and the heartbeat table is a corresponding relationship table between the identification information of the client and the heartbeat cycle;
the acquiring unit is used for acquiring the data loss times of the client within a preset time T;
the second determining unit is configured to determine the type of the client according to the identification information of the client and a preset client type table, where the client type includes a power consumption limitation-type client and a non-power consumption limitation-type client, and the client type table is a correspondence table between the identification information of the client and the type information of the client;
wherein, according to the identification information of the client and the preset heartbeat table, the heartbeat cycle of the client is determined to be t1,
if the client is a power consumption limitation client and the data loss frequency of the client in a preset time T exceeds a preset value a1, determining that a new heartbeat cycle is T2;
if the client is a non-power-consumption-limited client and the data loss frequency of the client in a preset time T exceeds a preset value a2, determining that a new heartbeat cycle is T2;
wherein t1 > t2, a1 > a2, and a1 and a2 are both positive integers;
the sending unit is configured to send a first notification message to the client, where the first notification message includes the new heartbeat cycle, so that the client sends a heartbeat packet according to the new heartbeat cycle.
8. A client, characterized in that the client comprises a receiving unit and a sending unit;
the receiving unit is configured to receive a first notification message, where the first notification message includes a new heartbeat cycle;
and the sending unit is used for sending the heartbeat packet to the server according to the new heartbeat cycle.
9. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 4 are implemented when the computer program is executed by the processor.
10. A client comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to claim 5 or 6 are implemented when the processor executes the computer program.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 5 or 6.
CN201810547756.6A 2018-05-31 2018-05-31 Method, server and client for adjusting heartbeat cycle Active CN108834179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810547756.6A CN108834179B (en) 2018-05-31 2018-05-31 Method, server and client for adjusting heartbeat cycle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810547756.6A CN108834179B (en) 2018-05-31 2018-05-31 Method, server and client for adjusting heartbeat cycle

Publications (2)

Publication Number Publication Date
CN108834179A CN108834179A (en) 2018-11-16
CN108834179B true CN108834179B (en) 2021-07-09

Family

ID=64145256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810547756.6A Active CN108834179B (en) 2018-05-31 2018-05-31 Method, server and client for adjusting heartbeat cycle

Country Status (1)

Country Link
CN (1) CN108834179B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112865993B (en) * 2019-11-27 2022-10-14 上海哔哩哔哩科技有限公司 Method and device for switching slave nodes in distributed master-slave system
CN111309521B (en) * 2020-01-19 2024-02-09 深圳市恒扬数据股份有限公司 FPGA reloading method, FPGA card type equipment and host
CN111432042B (en) * 2020-03-02 2022-09-16 平安科技(深圳)有限公司 Network address processing method, computer device and storage medium
CN111585839B (en) * 2020-04-29 2022-03-25 湖南中联重科智能技术有限公司 Component management method for construction machine, server, and system
CN114465953B (en) * 2022-01-26 2023-07-07 亚信科技(成都)有限公司 Identification generation method, device and storage medium
CN115134237A (en) * 2022-08-30 2022-09-30 建信金融科技有限责任公司 Data updating method, heartbeat detection method, device, equipment and medium
CN115137447A (en) * 2022-09-02 2022-10-04 深圳北芯医疗科技有限公司 Method and device for protecting components of therapeutic apparatus and therapeutic apparatus
CN115733854B (en) * 2022-10-11 2024-05-28 中信重工开诚智能装备有限公司 Robot remote data transmission method based on RocketMQ protocol

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870646A (en) * 2006-02-17 2006-11-29 华为技术有限公司 Method for improving jump mechanism of media gateway control protocol centre
CN105120495A (en) * 2015-09-09 2015-12-02 北京京东尚科信息技术有限公司 Information push method and system for smart mobile terminal
CN105577507A (en) * 2014-11-10 2016-05-11 中国移动通信集团广东有限公司 Heartbeat packet transmission interval adjustment method, device and server
WO2016173179A1 (en) * 2015-04-29 2016-11-03 中兴通讯股份有限公司 Method and device for switching primary database and secondary database
CN106452978A (en) * 2016-11-25 2017-02-22 深圳怡化电脑股份有限公司 Method and device for detecting communication abnormity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870646A (en) * 2006-02-17 2006-11-29 华为技术有限公司 Method for improving jump mechanism of media gateway control protocol centre
CN105577507A (en) * 2014-11-10 2016-05-11 中国移动通信集团广东有限公司 Heartbeat packet transmission interval adjustment method, device and server
WO2016173179A1 (en) * 2015-04-29 2016-11-03 中兴通讯股份有限公司 Method and device for switching primary database and secondary database
CN105120495A (en) * 2015-09-09 2015-12-02 北京京东尚科信息技术有限公司 Information push method and system for smart mobile terminal
CN106452978A (en) * 2016-11-25 2017-02-22 深圳怡化电脑股份有限公司 Method and device for detecting communication abnormity

Also Published As

Publication number Publication date
CN108834179A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN108834179B (en) Method, server and client for adjusting heartbeat cycle
US10285185B2 (en) Resource allocation method and communications terminal
CN106954225B (en) wireless roaming method and device and wireless equipment
US20200344597A1 (en) Network connection method, terminal device and computer readable storage medium
CN109152094B (en) Wireless network connection method for terminal
CN109889451B (en) Network speed limiting system and method and server
JP2020534760A (en) RBG division method and user terminal
CN107864044B (en) Information processing method and device, terminal and readable storage medium
CN105577573B (en) Information processing method and electronic equipment
CN111031602A (en) Bandwidth part updating method and terminal
CN107979863B (en) WiFi automatic connection method, system and terminal equipment
WO2022222674A1 (en) Message processing method and apparatus, electronic device, and computer-readable storage medium
CN109933595B (en) Internet of things equipment information sharing system and device and terminal equipment
CN113742389A (en) Service processing method and device
US11805553B2 (en) Control method, network device, and terminal
CN109565405B (en) RRC signaling validation time determination method, terminal, base station, and computer storage medium
CN106330504B (en) Method for realizing application and service controller
CN106534571A (en) Event notification method and terminal
CN113472674B (en) Flow control method and device, storage medium and electronic equipment
CN107371263B (en) Method and device for scheduling uplink resources
CN109587353B (en) Method, device and storage medium for identifying short message number attribution information
US10785750B2 (en) Methods for triggering user equipment to monitor paging message, user equipments, base stations and storage medium
CN110022595B (en) Downlink data transmission method, network device and computer storage medium
CN101562839A (en) Method and device for allocating resource
CN111771409A (en) Resource allocation method and device and computer storage medium

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