A device online state calculation method, device and storage medium
By working collaboratively with local and remote servers, and utilizing target queues and heartbeat messages to confirm device status, the problem of misjudgment of device status caused by heartbeat load in the cluster system is solved, and efficient online status calculation is achieved.
Patent Information
- Application Number
- CN202311597847.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-11-27
AI Technical Summary
In a cluster system composed of multiple application systems, the heartbeat load of a device can easily lead to misjudgment of the device status when it is sent to other servers.
The target device identifier is confirmed by the local server and added to the target queue. The remote server confirms the device status based on the received heartbeat message. This dual judgment reduces server resource consumption and avoids misjudgment of device status.
It effectively avoids misjudgment of device status, reduces server resource consumption, and achieves accurate and efficient calculation of device online status.
Smart Images

Figure CN118827481B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of device online state calculation, and in particular to a device online state calculation method, device and storage medium. BACKGROUND
[0002] With the continuous growth of the scale of Internet of Things device connection, higher requirements are put forward for the number of connections and processing capacity of the system. The monomer application system has been unable to meet the large-scale device connection, so gradually a cluster system composed of multiple application systems appears, which can effectively expand the scale of device connection.
[0003] However, in the cluster system composed of multiple application systems, if the device changes from the load of server A to the load of server B within the heartbeat period, the server A will find that the device heartbeat is timed out when polling, causing misjudgment of the device state. SUMMARY
[0004] The present application provides a device online state calculation method, device and storage medium to solve the problem of device state misjudgment when the device heartbeat load is transferred to other servers in the prior art.
[0005] To achieve the above-mentioned purpose, the present application embodiment provides a device online state calculation method applied to a remote server, which comprises:
[0006] receiving all heartbeat messages sent by all devices connected successfully with a local server; wherein each heartbeat message at least includes a device identifier and a heartbeat timestamp;
[0007] receiving a target queue sent by the local server; wherein the target queue stores target device identifiers of target devices confirmed by the local server, and the target devices are devices with heartbeat timeout among all the devices;
[0008] obtaining a target heartbeat message corresponding to the target device identifier according to all the heartbeat messages;
[0009] confirming the state of the target device according to the target heartbeat message.
[0010] As an improvement of the above-mentioned scheme, each heartbeat message further includes a heartbeat timeout time.
[0011] As an improvement of the above-mentioned scheme, the step of confirming the state of the target device according to the target heartbeat message comprises:
[0012] calculating a first time difference value between the current time and the heartbeat timestamp in the target heartbeat message;
[0013] If the first time difference value is greater than a preset first heartbeat timeout time, it is determined that the target device is in an offline state.
[0014] If the first time difference value is less than or equal to the first heartbeat timeout time, it is determined that the target device is in an online state.
[0015] As an improvement of the above scheme, the device online state calculation method further comprises:
[0016] When the number of target device identifiers stored in the target queue is greater than a preset number threshold, the target queue is split into a plurality of sub-target queues.
[0017] As an improvement of the above scheme, the target queue stores target device identifiers of target devices confirmed by the local server, and the method further comprises:
[0018] The target queue stores target device identifiers of target devices confirmed by the local server according to all heartbeat messages sent by all devices successfully connected to the local server.
[0019] To achieve the above object, an embodiment of the present application further provides a device online state calculation method applied to a local server, and the device online state calculation method comprises:
[0020] Receiving all heartbeat messages sent by all devices successfully connected to the local server, wherein each heartbeat message at least comprises a device identifier and a heartbeat timestamp;
[0021] Confirming target device identifiers of target devices according to all heartbeat messages, wherein the target devices are devices with a heartbeat timeout among all devices;
[0022] Adding the target device identifiers to a target queue, and sending the target queue to a remote server, so that the remote server confirms states of the target devices according to all heartbeat messages received from all devices successfully connected to the local server.
[0023] As an improvement of the above scheme, the confirming of the target device identifiers of the target devices according to all heartbeat messages comprises:
[0024] Calculating a second time difference value between a current time and the heartbeat timestamp in the heartbeat message;
[0025] If the second time difference value is greater than a preset second heartbeat timeout time, it is determined that the device is the target device;
[0026] If the second time difference value is less than or equal to the second heartbeat timeout time, it is determined that the device is not the target device.
[0027] As an improvement of the above scheme, the target device identifier is added to a target queue, and the target queue is sent to a remote server, so that the remote server confirms the state of the target device according to all heartbeat messages sent by all devices successfully connected to the local server.
[0028] The target device identifier is added to a target queue, and the target queue is sent to a remote server, so that the remote server acquires a target heartbeat message corresponding to the target device identifier according to all heartbeat messages sent by all devices successfully connected to the local server, and confirms the state of the target device according to the target heartbeat message.
[0029] To achieve the above object, the embodiment of the present application further provides a device online state calculation device, comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor realizes the device online state calculation method as above when executing the computer program.
[0030] To achieve the above object, the embodiment of the present application further provides a computer readable storage medium, comprising a stored computer program; wherein the computer program controls the device where the computer readable storage medium is located to execute the device online state calculation method as above when running.
[0031] Compared with the prior art, the embodiment of the present application provides a device online state calculation method, device and storage medium, wherein the local server confirms a target device identifier of a target device, adds the target device identifier to a target queue and sends the target queue to a remote server, the remote server confirms a target heartbeat message corresponding to the target device identifier according to all heartbeat messages sent by all devices successfully connected to the local server, and further confirms the state of the target device according to the target heartbeat message; wherein the target device is a heartbeat timeout device in all the devices. As can be seen, the embodiment of the present application calculates the heartbeat timeout device (target device) in the devices successfully connected to the local server by the local server, and calculates the heartbeat timeout device of the target device by the remote server, so that a heartbeat detection thread is not needed for each device to periodically detect whether the device heartbeat is timeout, the server resource occupation is reduced, the heartbeat timeout condition of the device is double judged, the condition of misjudging the state of the device when the device heartbeat is loaded to other servers is effectively avoided, and the embodiment of the present application can correctly and efficiently calculate the online state of the device. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1is a flow chart of a device online state calculation method provided by an embodiment of the present application;
[0033] Figure 2 is another flow chart of a device online state calculation method provided by an embodiment of the present application;
[0034] Figure 3 is still another flow chart of a device online state calculation method provided by an embodiment of the present application;
[0035] Figure 4 is a structural block diagram of a device online state calculation apparatus provided by an embodiment of the present application;
[0036] Figure 5 is another structural block diagram of a device online state calculation apparatus provided by an embodiment of the present application;
[0037] Figure 6 is a structural block diagram of a device online state calculation apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0039] Referring to Figure 1 , Figure 1 is a flow chart of a device online state calculation method provided by an embodiment of the present application, the device online state calculation method is applied to a remote server, and includes the following steps.
[0040] S11, receiving all heartbeat messages sent by all devices connected with a local server successfully; wherein each heartbeat message at least includes a device identifier and a heartbeat timestamp;
[0041] S12, receiving a target queue sent by the local server; wherein the target queue stores target device identifiers of target devices confirmed by the local server, and the target devices are devices with heartbeat timeout among all the devices;
[0042] S13, obtaining a target heartbeat message corresponding to the target device identifier according to all the heartbeat messages;
[0043] S14, confirming a state of the target device according to the target heartbeat message.
[0044] It can be understood that the embodiment of the present application can calculate the online state of the distributed device, when the device is successfully connected with the local server, the device sends the heartbeat message to the local server and the remote server, the local server confirms the target device identifier of the target device (the device with heartbeat timeout) according to the received heartbeat message, and adds the target device identifier into the target queue and sends it to the remote server, the remote server confirms the target heartbeat message corresponding to the target device identifier according to the received heartbeat message, confirms the state of the target device according to the target heartbeat message, can reduce the server resource occupation, and through the double judgment of the heartbeat timeout of the device, the device state misjudgment can be effectively avoided when the device heartbeat load to other servers, the embodiment of the present application can correctly and efficiently calculate the online state of the device.
[0045] In an optional embodiment, each heartbeat message further comprises: heartbeat timeout time.
[0046] In the embodiment of the present application, each heartbeat message further comprises: heartbeat timeout time; the heartbeat timeout of each device can be the same or different, the embodiment of the present application can judge the heartbeat timeout of the device according to the heartbeat timeout time carried by the heartbeat message.
[0047] In an optional embodiment, the confirming the state of the target device according to the target heartbeat message comprises:
[0048] calculating the first time difference value between the current time and the heartbeat timestamp in the target heartbeat message;
[0049] if the first time difference value is greater than the preset first heartbeat timeout time, confirming that the target device is in offline state;
[0050] if the first time difference value is less than or equal to the first heartbeat timeout time, confirming that the target device is in online state.
[0051] It can be understood that the first heartbeat timeout time corresponds to the device, the first heartbeat timeout time of each device can be the same or different. Of course, the first heartbeat timeout time can be stored in the remote server in advance, or it can be sent through the heartbeat message, and the heartbeat timeout time carried by the heartbeat message can be used as the second heartbeat timeout time.
[0052] In an optional embodiment, the device online state calculation method further comprises:
[0053] when the number of target device identifiers stored in the target queue is greater than the preset number threshold, the target queue is split into multiple sub-target queues.
[0054] It can be understood that when the number of target device identifiers stored in the target queue is too large, the processing efficiency will be affected. In order to speed up the processing efficiency, when the number of target device identifiers stored in the target queue is too large, the target queue is task-splitting, and is split into a plurality of sub-target queues, so as to avoid that the remote heartbeat detection thread always polls the target queue, thereby affecting the processing of other tasks.
[0055] In an optional embodiment, the target queue stores target device identifiers of target devices confirmed by the local server, and the target device identifiers include:
[0056] The target queue stores target device identifiers of target devices confirmed by the local server according to all heartbeat messages sent by all devices successfully connected to the local server.
[0057] It can be understood that the local server performs a judgment before the remote server performs a judgment. Specifically, the local server confirms target device identifiers of target devices (devices with heartbeat timeout) according to all heartbeat messages sent by all devices successfully connected to the local server. Then, the remote server performs a judgment again to confirm whether the target device is in heartbeat timeout, and obtains the state of the target device. Through double judgment, the embodiment of the application solves the situation that the device heartbeat load is transferred to other servers, causing misjudgment, and is more in line with the actual use scene and needs of users compared with the prior art.
[0058] In an optional embodiment, after the state of the target device is confirmed according to the target heartbeat message, the device online state calculation method further includes:
[0059] updating the state of the target device to a remote cache of the remote server.
[0060] It can be understood that the connection state of the device is also stored in the remote server, and the state of the target device is updated in the remote cache of the remote server after the state of the target device is confirmed.
[0061] In a specific embodiment, as shown in Figure 2 a heartbeat detection thread is created in the local and remote respectively;
[0062] 1. The device is successfully connected to the local server, sends a heartbeat message, and stores the device identifier, heartbeat timestamp and heartbeat timeout time to the local cache LC and the remote cache RC.
[0063] 2. The local heartbeat detection thread LT polls the device list in the local cache LC, judges whether the difference between the current time and the latest heartbeat time is greater than the heartbeat timeout time, and if yes, the device identifier is added to the target queue LQ.
[0064] 3. The remote heartbeat detection thread RT takes the device list from the target queue LQ, if the device list is too large, the device list is task split, the latest heartbeat time is taken from the remote cache RC according to the device identifier, whether the difference between the current time and the latest heartbeat time is greater than the heartbeat timeout time is judged, greater than the device is judged as offline state. At the same time, the latest online state of the device is updated in the remote cache RC.
[0065] In the embodiment of the application, the heartbeat detection thread is divided into different working responsibilities, the local heartbeat detection thread LT calculates the device list of the local cache LC heartbeat timeout, the remote heartbeat detection thread RT calculates the device list of the target queue LQ heartbeat timeout, and the resource occupation of the server by the heartbeat thread is reduced. Moreover, the local heartbeat detection thread LT and the remote heartbeat detection thread RT work through the target queue LQ and the remote cache RC, double judgment, solve the situation that the device state is misjudged when the device heartbeat packet is loaded to other servers in the distributed scenario.
[0066] Referring to Figure 3 , Figure 3 is another flowchart of a device online state calculation method provided by the embodiment of the application, the device online state calculation method is applied to a local server, and the device online state calculation method comprises the following steps:
[0067] S21, receiving all heartbeat messages sent by all devices connected successfully with the local server; wherein each heartbeat message comprises at least a device identifier and a heartbeat timestamp;
[0068] S22, confirming a target device identifier of a target device according to all heartbeat messages; wherein the target device is a heartbeat timeout device in all devices;
[0069] S23, adding the target device identifier to a target queue, and sending the target queue to a remote server, so that the remote server confirms the state of the target device according to all heartbeat messages sent by all devices connected successfully with the local server.
[0070] In an optional implementation, the step of confirming a target device identifier of a target device according to all heartbeat messages comprises:
[0071] calculating a second time difference value between the current time and the heartbeat timestamp in the heartbeat message;
[0072] if the second time difference value is greater than a preset second heartbeat timeout time, the device is confirmed as the target device;
[0073] If the second time difference value is less than or equal to the second heartbeat timeout time, it is confirmed that the device is not the target device.
[0074] It can be understood that the second heartbeat timeout time corresponds to a device, and the second heartbeat timeout time of each device can be the same or different. Of course, the second heartbeat timeout time can be stored in the local server in advance or sent through the heartbeat packet. The heartbeat timeout time carried by the heartbeat packet can be used as the second heartbeat timeout time.
[0075] In an optional embodiment, the target device identifier is added to a target queue, and the target queue is sent to a remote server, so that the remote server confirms the state of the target device according to all heartbeat packets sent by all devices successfully connected to the local server.
[0076] The target device identifier is added to a target queue, and the target queue is sent to a remote server, so that the remote server confirms the state of the target device according to all heartbeat packets sent by all devices successfully connected to the local server.
[0077] In an optional embodiment, each heartbeat packet further includes a heartbeat timeout time.
[0078] It should be noted that the embodiment is a local server corresponding to the above-mentioned method embodiment, and therefore, the related description in the above-mentioned method embodiment can be referred to, and the same beneficial effects can be achieved. In order to avoid repeated description, it will not be described here.
[0079] Referring to Figure 4 , Figure 4 is a structural block diagram of a device online state calculation device provided by an embodiment of the application, which is applied to a remote server and includes:
[0080] A first heartbeat packet receiving module 11 is configured to receive all heartbeat packets sent by all devices successfully connected to a local server, wherein each heartbeat packet at least includes a device identifier and a heartbeat timestamp.
[0081] A target queue receiving module 12 is configured to receive a target queue sent by the local server, wherein the target queue stores a target device identifier of a target device confirmed by the local server, and the target device is a heartbeat timeout device in all devices.
[0082] The target heartbeat packet acquisition module 13 is configured to acquire a target heartbeat packet corresponding to the target device identifier according to all the heartbeat packets.
[0083] The target device state confirmation module 14 is configured to confirm the state of the target device according to the target heartbeat packet.
[0084] Optionally, each heartbeat packet further comprises a heartbeat timeout time.
[0085] Optionally, the target device state confirmation module 14 is specifically configured to:
[0086] calculate a first time difference between a current time and a heartbeat timestamp in the target heartbeat packet;
[0087] if the first time difference is greater than a preset first heartbeat timeout time, confirm that the target device is in an offline state;
[0088] if the first time difference is less than or equal to the first heartbeat timeout time, confirm that the target device is in an online state.
[0089] Optionally, the device online state calculation apparatus further comprises:
[0090] The splitting module is configured to split the target queue into a plurality of sub-target queues when the number of target device identifiers stored in the target queue is greater than a preset number threshold.
[0091] Optionally, the target queue stores target device identifiers of target devices confirmed by the local server, and the target device identifiers comprise:
[0092] The target queue stores target device identifiers of target devices confirmed by the local server according to all heartbeat packets sent by all devices successfully connected to the local server.
[0093] Optionally, the device online state calculation apparatus further comprises:
[0094] The state updating module is configured to update the state of the target device to a remote cache of the remote server.
[0095] It should be noted that the device online state calculation apparatus described in the present embodiment can implement any step in the device online state calculation method applied to the remote server in the present embodiment, and achieve the same beneficial effects, which will not be described herein again.
[0096] Referring to Figure 5 , Figure 5 is another structural block diagram of a device online state calculation apparatus provided in the present embodiment, and the device online state calculation apparatus is applied to a local server, and comprises:
[0097] The second heartbeat packet receiving module 21 is configured to receive all heartbeat packets sent by all devices successfully connected with the local server, wherein each heartbeat packet at least comprises a device identifier and a heartbeat timestamp.
[0098] The target device confirming module 22 is configured to confirm a target device identifier of a target device according to all heartbeat packets, wherein the target device is a device whose heartbeat times out among all devices.
[0099] The target queue sending module 23 is configured to add the target device identifier into a target queue and send the target queue to a remote server, so that the remote server confirms a state of the target device according to all heartbeat packets received from all devices successfully connected with the local server.
[0100] Optionally, the target device confirming module 22 is specifically configured to:
[0101] calculate a second time difference value between a current time and the heartbeat timestamp in the heartbeat packet;
[0102] if the second time difference value is greater than a preset second heartbeat timeout time, confirm that the device is the target device;
[0103] if the second time difference value is less than or equal to the second heartbeat timeout time, confirm that the device is not the target device.
[0104] Optionally, the target queue sending module 23 is specifically configured to:
[0105] add the target device identifier into a target queue and send the target queue to a remote server, so that the remote server acquires a target heartbeat packet corresponding to the target device identifier according to all heartbeat packets received from all devices successfully connected with the local server, and confirms a state of the target device according to the target heartbeat packet.
[0106] Optionally, each heartbeat packet further comprises a heartbeat timeout time.
[0107] It should be noted that the device online state computing apparatus in the embodiment can implement any step in the device online state computing method applied to the local server in the embodiment of the application and achieve the same beneficial effects, which will not be described here again.
[0108] The embodiment of the present application further provides a computer readable storage medium, which comprises a stored computer program; wherein the computer program, when executed, controls a device where the computer readable storage medium is arranged to perform the device online state calculation method according to any one of the above embodiments.
[0109] Referring to Figure 6 , Figure 6 is a structural diagram of a device online state calculation device provided by the embodiment of the present application, which comprises a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. The processor 31 implements the steps in the device online state calculation method embodiments above when executing the computer program. Alternatively, the processor 31 implements the functions of the modules / units in the above device embodiments when executing the computer program.
[0110] For example, the computer program can be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor 31 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the device online state calculation device.
[0111] The device online state calculation device can comprise, but is not limited to, the processor 31 and the memory 32. Those skilled in the art can understand that the schematic diagram is only an example of the device online state calculation device, and does not limit the device online state calculation device, which can comprise more or fewer components than the diagram, or combine certain components, or different components, for example, the device online state calculation device can further comprise an input / output device, a network access device, a bus, etc.
[0112] The processor 31 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic components, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The processor 31 is the control center of the device online state computing device, and connects various parts of the device online state computing device through various interfaces and lines.
[0113] The memory 32 can be used to store computer programs and / or modules. The processor 31 realizes various functions of the device online state computing device by running or executing the computer programs and / or modules stored in the memory 32, and calling data stored in the memory 32. The memory 32 can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required for a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 32 can include a high-speed random access memory, and can also include a nonvolatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory device.
[0114] The device online state computing device integrated module / unit, if in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 31, the steps of the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, an executable file, or some intermediate form, etc. The computer-readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0115] It should be noted that the apparatus embodiments described above are merely illustrative, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e., they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiment according to actual needs. In addition, the connection relationship between the modules in the apparatus embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative labor.
[0116] The above is the preferred embodiment of the present application. It should be noted that those of ordinary skill in the art can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements are also considered within the scope of protection of the present application.
Claims
1. A method for calculating an online state of a device, the method comprising: The device is applied to a remote server, and the device online state calculation method comprises: receiving all heartbeat messages sent by all devices connected to the local server successfully; wherein each heartbeat message comprises at least: device identification, heartbeat timestamp and heartbeat timeout time; receiving a target queue sent by the local server; wherein the target queue stores target device identification of a target device confirmed by the local server according to all heartbeat messages sent by all devices connected to the local server successfully, and the target device is a device with heartbeat timeout among all the devices; obtaining a target heartbeat message corresponding to the target device identification according to all the heartbeat messages; confirming the state of the target device according to the target heartbeat message; wherein the step of confirming the state of the target device according to the target heartbeat message comprises: calculating a first time difference value between the current time and the heartbeat timestamp in the target heartbeat message; if the first time difference value is greater than a preset first heartbeat timeout time, confirming that the target device is in an offline state; if the first time difference value is less than or equal to the first heartbeat timeout time, confirming that the target device is in an online state.
2. The device online state calculation method of claim 1, wherein, The device online state calculation method further comprises: when the number of target device identifications stored in the target queue is greater than a preset number threshold, splitting the target queue into multiple sub-target queues.
3. An apparatus online state calculation method, characterized by, The device online state calculation method is applied to a local server, and the device online state calculation method comprises: receiving all heartbeat messages sent by all devices connected to the local server successfully; wherein each heartbeat message comprises at least: device identification and heartbeat timestamp; confirming target device identification of a target device according to all the heartbeat messages; wherein the target device is a device with heartbeat timeout among all the devices; adding the target device identification to a target queue, and sending the target queue to a remote server, so that the remote server confirms the state of the target device according to all heartbeat messages received from all devices connected to the local server successfully; wherein the step of confirming target device identification of a target device according to all the heartbeat messages comprises: calculating a second time difference value between the current time and the heartbeat timestamp in the heartbeat message; if the second time difference value is greater than a preset second heartbeat timeout time, confirming that the device is the target device; if the second time difference value is less than or equal to the second heartbeat timeout time, confirming that the device is not the target device; the step of adding the target device identification to a target queue, and sending the target queue to a remote server, so that the remote server confirms the state of the target device according to all heartbeat messages received from all devices connected to the local server successfully, comprises: The target device identifier is added to a target queue, and the target queue is sent to a remote server, so that the remote server obtains a target heartbeat packet corresponding to the target device identifier according to all heartbeat packets received from all devices successfully connected to the local server, and confirms the state of the target device according to the target heartbeat packet.
4. An apparatus for computing online status of a device, the apparatus comprising: The device online state calculation method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and the processor implements the device online state calculation method according to any one of claims 1-3 when executing the computer program.
5. A computer readable storage medium, characterized in that, The computer readable storage medium comprises a stored computer program; wherein the computer program controls a device where the computer readable storage medium is located to execute the device online state calculation method according to any one of claims 1-3 when running.
Citation Information
Patent Citations
Equipment survival detection method and equipment survival detection device
CN103634166A
Heartbeat package processing method and device
CN104166589A