Movatterモバイル変換


[0]ホーム

URL:


CN112910740A - State reporting method, device, equipment and computer readable storage medium - Google Patents

State reporting method, device, equipment and computer readable storage medium
Download PDF

Info

Publication number
CN112910740A
CN112910740ACN202110181924.6ACN202110181924ACN112910740ACN 112910740 ACN112910740 ACN 112910740ACN 202110181924 ACN202110181924 ACN 202110181924ACN 112910740 ACN112910740 ACN 112910740A
Authority
CN
China
Prior art keywords
equipment
grouping
reporting
target
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110181924.6A
Other languages
Chinese (zh)
Inventor
王鑫文
王沅召
宋德超
杨丰玮
葛春光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Original Assignee
Gree Electric Appliances Inc of Zhuhai
Zhuhai Lianyun Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Gree Electric Appliances Inc of Zhuhai, Zhuhai Lianyun Technology Co LtdfiledCriticalGree Electric Appliances Inc of Zhuhai
Priority to CN202110181924.6ApriorityCriticalpatent/CN112910740A/en
Publication of CN112910740ApublicationCriticalpatent/CN112910740A/en
Priority to PCT/CN2021/128480prioritypatent/WO2022170791A1/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The application discloses a state reporting method, a state reporting device, a state reporting equipment and a computer readable storage medium. The method comprises the following steps on the side of the target device: after the grouping period of each device is started, reading information of a plurality of devices to be selected returned by the server; selecting grouping equipment from the multiple equipment to be selected according to the information of the multiple equipment to be selected; in the target device and the grouping device, a reporting device is determined so as to report the states of the target device and the grouping device to a server through the reporting device in a device grouping period. The method comprises the following steps on the server side: receiving the state of the target equipment and the state of the grouping equipment reported by the reporting equipment; updating the current state of the target equipment according to the state of the target equipment; and updating the current state of the grouping device according to the state of the grouping device. According to the method and the device, the server is not required to receive the heartbeat packets respectively sent by a large number of devices and process a large number of heartbeat packets, the state reporting efficiency of the devices is effectively improved, and the heartbeat packet processing pressure of the server is reduced.

Description

State reporting method, device, equipment and computer readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for reporting a status.
Background
Along with the continuous popularization of the internet of things technology, more and more internet of things devices enter the lives of people, and particularly in the field of intelligent home furnishing, the number of intelligent household appliances is increased rapidly. At present, in order to know whether internet of things equipment is online, the internet of things equipment is required to send heartbeat packets to a server at intervals, in the process, the server needs to interact with each piece of internet of things equipment and process the heartbeat packets sent by the internet of things equipment, but the heartbeat packets are processed by the server due to the fact that the number of the internet of things equipment is large, and pressure of the server on processing the heartbeat packets is too large.
Disclosure of Invention
The application provides a state reporting method, a state reporting device, equipment and a computer readable storage medium, which are used for solving the problem that under the condition that the number of Internet of things equipment is large, a server receives and processes heartbeat packets sent by each piece of Internet of things equipment, so that the processing pressure of the server is large.
In view of the above technical problems, the present application is implemented by the following technical solutions:
the embodiment of the application provides a state reporting method, which is executed on a target device side and comprises the following steps: after the grouping period of each device is started, reading information of a plurality of devices to be selected returned by the server; selecting grouping equipment from the multiple equipment to be selected according to the information of the multiple equipment to be selected; and determining reporting equipment in the target equipment and the grouping equipment so as to report the states of the target equipment and the grouping equipment to the server through the reporting equipment in the equipment grouping period.
Before reading information of a plurality of devices to be selected returned by the server, the method further comprises the following steps: sending the position information of the target equipment to the server so that the server can select a preset number of equipment as equipment to be selected from equipment in an online state according to the position information of the target equipment; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and receiving and storing the information of the plurality of devices to be selected returned by the server.
Wherein, according to the information of the multiple devices to be selected, selecting a grouping device from the multiple devices to be selected includes: establishing communication connection with each device to be selected according to the information of the devices to be selected; determining the network delay of each device to be selected based on the communication connection with each device to be selected; and selecting grouping equipment from the plurality of equipment to be selected according to the network delay of each equipment to be selected.
Wherein, the selecting a grouping device from the plurality of devices to be selected according to the network delay with each device to be selected includes: sequentially sending grouping requests to each device to be selected according to the sequence of network delay from small to large; receiving an agreement grouping message or a rejection grouping message returned by each device to be selected; selecting the device to be selected which returns the agreement grouping message as the grouping device so as to combine the target device and the selected grouping device into a group; wherein, the consent grouping message is returned when the device to be selected does not belong to other groups; or, the device to be selected belongs to other groups and the first network delay is less than the second network delay; the first network delay is the network delay between the device to be selected and the target device; the second network delay is the network delay between the device to be selected and the interactive device in the other group; the reject packet message is returned when the device to be selected belongs to other packets and the first network delay is greater than or equal to the second network delay.
Wherein the method further comprises: before determining the reporting device, returning a group agreement message to other devices under the condition that a group request from other devices is received, so that the target device enters a group in which the other devices are located; after the reporting equipment is determined, determining a third network delay and a fourth network delay under the condition of receiving grouping requests from other equipment; wherein the third network latency is a network latency between the target device and the other device; the fourth network delay is a network delay between the target device and the reporting device; under the condition that the third network delay is smaller than the fourth network delay, returning a group agreement message to the other equipment, and sending a group rejection message to the target equipment; and returning a rejection packet message to the other equipment when the third network delay is greater than or equal to the fourth network delay.
The server sends the information of the plurality of devices to be selected to the server; after the receiving of the grouping request from the other device, the method further comprises: extracting information of the other devices in the grouping request; determining the network delay of each device to be selected in the device to be selected list under the condition that the information of the other devices is determined not to be contained in the device to be selected list; determining the maximum network delay in the network delay of each device to be selected in the device to be selected list; and deleting the information of the equipment to be selected corresponding to the maximum network delay from the equipment to be selected list and adding the information of the other equipment to the equipment to be selected list under the condition that the third network delay is smaller than the maximum network delay.
Wherein the determining, in the target device and the grouping device, a reporting device includes: determining the online time of the target equipment; sending the online duration of the target device to the grouping device, and receiving the online duration of the grouping device sent by the grouping device; determining the device with the longest online time as the reporting device in the target device and the grouping device; and the grouping device also determines the device with the longest online time as the reporting device.
Reporting the states of the target device and the grouping device to the server through the reporting device in the device grouping period, wherein the reporting comprises: under the condition that the target equipment is determined as reporting equipment, receiving heartbeat packets reported by the grouping equipment every other preset reporting time period, and determining the state of the grouping equipment according to the received heartbeat packets; reporting the state of the target equipment and the state of the grouping equipment to the server; and under the condition that the grouping equipment is determined as reporting equipment, the target equipment sends a heartbeat packet to the reporting equipment every reporting time period, so that the reporting equipment determines the state of the target equipment according to the heartbeat packet reported by the target equipment and reports the state to the server.
Wherein, in case that the target device is determined to be a reporting device, the method further comprises: and deleting the information of the grouping equipment under the condition that the heartbeat packet reported by the grouping equipment is still not received within a preset first waiting time period from the moment that the heartbeat packet reported by the grouping equipment is not received.
Wherein, in case that the target device is determined to be a reporting device, the method further comprises: and under the condition that the communication connection with the server is determined to be disconnected, re-determining the reporting equipment in the target equipment and the grouping equipment.
The embodiment of the application provides a state reporting method, which is executed at a server side and comprises the following steps: receiving the state of the target equipment and the state of the grouping equipment reported by the reporting equipment; the reporting device is a device determined from the target device and the grouping device after a device grouping period starts; the grouping device is selected by the target device from a plurality of devices to be selected, and the information of the plurality of devices to be selected is sent to the target device by the server; updating the current state of the target equipment according to the state of the target equipment; and updating the current state of the grouping device according to the state of the grouping device.
Wherein the types of states include: an online state and an offline state; before the receiving the state of the target device and the state of the packet device reported by the reporting device, the method further includes: receiving location information from the target device; according to the position information of the target equipment, selecting a preset number of equipment as equipment to be selected from the equipment in an online state; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and returning the information of the plurality of devices to be selected to the target device, so that the target device can select the grouping device from the plurality of devices to be selected according to the information of the plurality of devices to be selected.
Wherein the method further comprises: starting from the state of the target device and the state of the grouping device which are not received and reported by the reporting device, in a preset second waiting time period, under the condition that the state of the target device and the state of the grouping device which are reported by the reporting device are still not received, updating the current states of the target device and the grouping device to be offline states.
The embodiment of the present application provides a status reporting apparatus, which is disposed on a target device side, and includes: the reading module is used for reading the information of the plurality of devices to be selected returned by the server after the grouping period of each device starts; the selection module is used for selecting grouping equipment from the plurality of equipment to be selected according to the information of the plurality of equipment to be selected; a determining module, configured to determine a reporting device in the target device and the grouping device, so that the states of the target device and the grouping device are reported to the server through the reporting device in the device grouping period.
The embodiment of the application provides a state reporting device, which is arranged on a server side and comprises: the receiving module is used for receiving the state of the target equipment and the state of the grouping equipment reported by the reporting equipment; the reporting device is a device determined from the target device and the grouping device after a device grouping period starts; the grouping device is selected by the target device from a plurality of devices to be selected, and the information of the plurality of devices to be selected is sent to the target device by the server; the updating module is used for updating the current state of the target equipment according to the state of the target equipment; and updating the current state of the grouping device according to the state of the grouping device.
The embodiment of the application provides electronic equipment, which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for finishing mutual communication through the communication bus by the memory; a memory for storing a computer program; and a processor, configured to implement the steps of the state reporting method according to any one of the above descriptions, or implement the steps of the state reporting method according to any one of the above descriptions, when executing a program stored in a memory.
An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when being executed by a processor, implements the steps of the state reporting method described in any one of the above items, or implements the steps of the state reporting method described in any one of the above items.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
in the embodiment of the application, the target device determines the group to which the target device belongs and determines the reporting device in the group in each device grouping period, and the reporting device collects the states of the devices in the group and reports the states to the server. According to the method and the device, the client does not need to establish communication connection with the server and report the heartbeat packets, and the server does not need to receive the heartbeat packets sent by a large number of devices respectively and process the heartbeat packets, so that the state reporting efficiency of the devices is effectively improved, and the heartbeat packet processing pressure of the server is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flowchart of a status reporting method executed on a target device side according to an embodiment of the present application;
fig. 2 is a flowchart of a status reporting method executed on a server side according to an embodiment of the present application;
fig. 3 is a flowchart of a status reporting method according to an embodiment of the present application;
fig. 4 is a structural diagram of a status reporting apparatus configured in a target device according to an embodiment of the present application;
fig. 5 is a structural diagram of a status reporting apparatus disposed in a server according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a state reporting method. Fig. 1 is a flowchart illustrating a status reporting method executed by a target device according to an embodiment of the present application. The target device refers to a device that completes registration with the server. Each device that completes registration at the server may execute the status reporting method of this embodiment, so as to report the status in a packet form.
Step S110, after each device grouping cycle starts, reading information of a plurality of devices to be selected returned by the server.
The device grouping period refers to a time period for reporting a state to a server by taking a grouping unit. Each packet includes at least one device. Classes of devices include, but are not limited to: intelligent household electrical appliance.
And the server is used for recording the state of each device registered in the server. A mobile terminal device. The states of the device include: an online state and an offline state.
The candidate device refers to a device which is provided by the server for the target device and can be selected by grouping.
The information of the candidate devices includes but is not limited to: the code and communication address of the candidate device. Further, the information of the plurality of devices to be selected returned by the server may be stored in the list of devices to be selected.
Step S120, selecting grouping equipment from the plurality of equipment to be selected according to the information of the plurality of equipment to be selected.
The grouping device refers to a device to be selected for forming a group with the target device. The grouping device and the target device constitute a group so as to report the state of each device in the group to the server in units of the group. The number of grouping devices is not limited. For example: the number of the devices to be selected is larger than or equal to the number of the grouping devices.
Selecting a grouping device comprising: selecting information of all devices to be selected from the information of the multiple devices to be selected, and taking all the devices to be selected as grouping devices; or randomly selecting information of preset first number of devices to be selected from the information of the plurality of devices to be selected, and taking the devices to be selected corresponding to the information of the selected devices to be selected as grouping devices; or determining the network delay of the target device and each device to be selected according to the information of the multiple devices to be selected, sequencing the devices to be selected according to the sequence of the network delays from small to large, and selecting the devices to be selected with a preset first number as grouping devices from the device to be selected with the minimum network delay; or, starting from the candidate device with the smallest network delay, selecting the candidate device which is at most preset with the first number and agrees to form a group with the target device as the grouping device.
Step S130, determining reporting devices in the target device and the grouping device, so as to report the states of the target device and the grouping device to the server through the reporting devices in the device grouping period.
The reporting device is a device for reporting the state of each device in the packet to a server.
Determining a reporting device, comprising: randomly determining one device as a reporting device in the target device and the grouping device; or, determining one device as a reporting device in the target device and the grouping device through a consensus algorithm.
Further, the consensus algorithm is mainly to determine one device as a reporting device in the target device and the grouping device by performing negotiation communication with the grouping device.
And the negotiation communication means that the target equipment and the grouping equipment exchange negotiation information, and the target equipment and the grouping equipment jointly select reporting equipment according to the received negotiation information. The negotiation information refers to information for selecting a reporting device.
Further, the types of negotiation information include: the online time of the current device, the network delay from the current device to other devices in the group, and the average network delay from the current device to other devices in the group. For example: and determining the equipment with the minimum network delay average value as the reporting equipment in the target equipment and the grouping equipment.
After determining the reporting device, the reporting device may send information of each device in the group to the server, so that the server knows the information of each device in the group.
In this embodiment, the target device determines the packet to which the target device belongs in each device packet cycle, determines the reporting device in the packet, and the reporting device collects the states of the devices in the packet and reports the states to the server. According to the method and the device, the client does not need to establish communication connection with the server and report the heartbeat packets, and the server does not need to receive the heartbeat packets sent by a large number of devices respectively and process the heartbeat packets, so that the state reporting efficiency of the devices is effectively improved, and the heartbeat packet processing pressure of the server is reduced. Based on the above status reporting method executed on the target device side, the following description is directed to a status reporting method executed on the server side.
Fig. 2 is a flowchart of a status reporting method executed on a server side according to an embodiment of the present application.
Step S210, receiving the state of the target device and the state of the packet device reported by the reporting device.
The reporting device is a device determined from the target device and the grouping device after the device grouping period starts. That is, the reporting device is included in the target device and the packet device, and the status of the reporting device is included in the status of the target device and the status of the packet device.
The grouping device is selected by the target device from a plurality of devices to be selected, and the information of the plurality of devices to be selected is sent to the target device by the server.
The types of the states include: an online state and an offline state.
Step S220, updating the current state of the target equipment according to the state of the target equipment; and updating the current state of the grouping device according to the state of the grouping device.
On the server side, an online device list may be set, and information of devices in an online state is recorded in the online device list. And removing the information of the equipment in the offline state from the online equipment list according to the current state of the target equipment and the current state of the grouping equipment.
In this embodiment, before receiving the state of the target device and the state of the packet device reported by the reporting device, location information from the target device may also be received; according to the position information of the target equipment, selecting a preset number of equipment as equipment to be selected from the equipment in an online state; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and returning the information of the plurality of devices to be selected to the target device, so that the target device can select the grouping device from the plurality of devices to be selected according to the information of the plurality of devices to be selected.
Further, in order to send information of the client near the target device to the target device, the server may determine a distance between the target device and another online device, and obtain a plurality of devices in the order from small to large as a candidate device of the target device. For example: and acquiring 50 devices as the devices to be selected of the target device according to the sequence of the distances from small to large, and sending the information of the 50 devices to the target device.
Further, the number of the target devices registered by the server is multiple, and the information of multiple candidate devices sent by the server to each target device may or may not be repeated. For example: when the target equipment is online, the target equipment sends position information to a server, and the server sends information of a plurality of equipment to be selected to the target equipment according to the position information of the target equipment; the information of the multiple devices to be selected sent to the target device is allowed to be repeated with the information of the devices to be selected sent to other devices, so that the target device can select the grouping device from the multiple devices to be selected in a request mode, and the devices in different groups are prevented from being repeated. For another example: when each device grouping period starts, the target device sends position information to the server, the server distributes a plurality of unrepeated devices to be selected for each target device according to the position information of each target device, and sends the information of the devices to be selected corresponding to each target device to the target device, so that the target device selects the information of all the devices to be selected returned by the server, and all the devices to be selected are used as grouping devices.
In this embodiment, before receiving the state of the target device and the state of the packet device reported by the reporting device, information from each device in the packet sent by the reporting device may also be received. Information for the group is maintained during the current device group period.
In this embodiment, because a network connection between the reporting device and the server may have a network failure, in view of such a situation, starting from the situation that the status of the target device and the status of the packet device reported by the reporting device are not received, in a preset second waiting time period, and under the situation that the status of the target device and the status of the packet device reported by the reporting device are still not received, the current status of the target device and the current status of the packet device are both updated to the offline status. The duration of the second waiting time period is greater than the duration of the reporting time period of the reporting device.
In this embodiment, the server receives the state of the target device and the state of the grouping device reported by the reporting device, and does not need to establish communication connection with all devices in the group where the reporting device is located, or receive the heartbeat packet sent by each device in the group where the reporting device is located, and only completes the state update of each device according to the state group (the state of the target device and the state of the grouping device) reported by the reporting device, so that the state update efficiency is high, and the information processing pressure is low.
In order to make the present embodiment clearer, the status reporting method of the present embodiment is further described below. Fig. 3 is a flowchart of a status reporting method according to an embodiment of the present application.
In step S310, after each device grouping cycle starts, the target device reads information of multiple devices to be selected returned by the server.
The time length of the equipment grouping period is longer than the period time length of the heartbeat packet reported by the equipment.
Before reading the information of a plurality of devices to be selected, the server needs to send the position information of the target device, so that the server selects a preset number of devices as the devices to be selected from the devices in an online state according to the position information of the target device; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and receiving and storing the information of the plurality of devices to be selected returned by the server.
Further, under the condition that the position of the target device is fixed, after the target device is on line, communication connection is established with the server, and the position information of the target device is sent to the server. When the location of the target device is in a mobile state, the location information of the target device is transmitted to the server at intervals.
Further, the information of the plurality of devices to be selected returned by the server is recorded in the list of the devices to be selected. The target device may maintain the list of devices to be selected, and the target device may add or delete information of the devices in the list of devices to be selected according to a requirement.
Step S320, the target device establishes a communication connection with each of the devices to be selected according to the information of the devices to be selected.
The information of the device to be selected may include a communication address of the device to be selected; the target device establishes a TCP (Transmission Control Protocol) communication connection with the device to be selected according to the communication address of the device to be selected.
Step S330, the target device determines the network delay of each device to be selected based on the communication connection with each device to be selected.
The target device may use an ICMP (Internet Control Message Protocol) Protocol to test network delay with each device to be selected.
Step S340, the target device selects a grouping device from the multiple devices to be selected according to the network delay of each device to be selected.
Since the device to be selected may already form a group with other devices, in order that the devices in different groups do not repeat, the device to be selected may sequentially send a grouping request to each of the devices to be selected in the order from small to large network delay; receiving an agreement grouping message or a rejection grouping message returned by each device to be selected; and selecting the device to be selected which returns the agreement grouping message as the grouping device so as to combine the target device and the selected grouping device into a group. Wherein the number of grouping devices is at least one. For example: the target device determines 10 devices with the shortest message round-trip time as grouping devices among the 50 candidate devices.
The group agreement message is returned when the device to be selected does not belong to other groups; or, the device to be selected belongs to other groups and the first network delay is less than the second network delay; the first network delay is the network delay between the device to be selected and the target device; the second network latency is a network latency between the device to be selected and the interactive device in the other group.
The reject packet message is returned when the device to be selected belongs to other packets and the first network delay is greater than or equal to the second network delay.
Step S350, the target device determines the online time of the target device (the target device itself); and sending the online time length of the target device to the grouping device, and receiving the online time length of the grouping device sent by the grouping device.
After the grouping device is selected, the target device and the grouping device form a group. In order to report the status of each client in a group to the server in units of groups, a reporting device may be selected in a group.
Further, for each packet device, the packet device sends negotiation information to the target device after returning an agreement packet message to the target device. The negotiation information includes the online time duration of the packet device.
Step S360, the target device determines the device with the longest online time as the reporting device in the target device and the grouping device; and the grouping device also determines the device with the longest online time as the reporting device.
The target equipment sends the negotiation information to the grouping equipment, and the grouping equipment also needs to send the negotiation information to the target equipment, so the negotiation information of the target equipment and the grouping equipment is equal, the determined reporting equipment is the same, and the information of the reporting equipment does not need to be mutually notified.
In this embodiment, in one packet, the role of the reporting device is a leader, and the other devices are fulllovers.
Step S370, the target device reports the states of the target device and the grouping device to the server through the reporting device in the device grouping period.
Under the condition that the target equipment is determined as the reporting equipment, receiving heartbeat packets reported by the grouping equipment at intervals of a preset reporting time period, and determining the state of the grouping equipment according to the received heartbeat packets; and reporting the state of the target equipment and the state of the grouping equipment to the server. And the reporting time period is a state reporting period. And reporting the time period to an empirical value or an experimental value.
Further, the state of the grouping device corresponding to the received heartbeat packet is determined as an on-line state, and the states of the remaining grouping devices are determined as an off-line state.
And under the condition that the grouping equipment is determined as the reporting equipment, the target equipment sends a heartbeat packet to the reporting equipment every reporting time period, so that the reporting equipment determines the state of the target equipment according to the heartbeat packet reported by the target equipment and reports the state to the server.
When the target device is determined to be a reporting device, deleting the information of the grouping device from the condition that a heartbeat packet reported by the grouping device is not received in a preset first waiting time period from the condition that the heartbeat packet reported by the grouping device is not received; and the duration of the first waiting time period is greater than the duration of the reporting time period. If the heartbeat packet reported by one device is not received within a certain time, it indicates that a communication fault has occurred between the target device and the grouping device or that the grouping device has been offline. In this embodiment, the status of the grouping device is marked as down status, so that the server updates the status of the grouping device to be down status, and after the grouping device recovers communication or goes online, the server recovers the on-line status again in the form of regrouping.
In step S380, the server receives the state of the target device and the state of the packet device reported by the reporting device.
The current state of each device is recorded on the server side for communication with devices in an online state.
In order to timely know whether the state of each device changes, the server needs to update the state of each device every preset reporting time period, so that the server receives the state of the target device and the state of the packet device reported by the reporting device every reporting time period.
Step 390, the server updates the current state of the target device according to the state of the target device; and updating the current state of the grouping device according to the state of the grouping device.
In the embodiment, the devices needing to be kept in the online state are grouped, the devices in the group are communicated with each other to confirm the states of the devices, and then one reporter and the server are selected every grouping period to deliver the state of each device in the group, so that the pressure of the server on keeping the heartbeat package connection with a plurality of devices simultaneously in order to confirm whether the devices are online is relieved.
Further, under the condition that the propagation speed of the electromagnetic wave is constant, the smaller the network delay is, the faster the message transmission is, so the server provides the candidate device for the target device to select according to the position information of the target device, and the communication efficiency between the target device and the candidate device is improved.
Further, the target device selects the devices to be selected with small network delay to form a group based on the network delay between the target device and each device to be selected, so that the communication timeliness between the devices in the same group is high, and the timeliness of the states of the devices in the group reported to the server is guaranteed.
Furthermore, the reporting device is determined through a consensus algorithm, the negotiation information used by the consensus algorithm is the online time, and the device with the longest online time is selected as the reporting device, so that the stability of the reporting device can be ensured, that is, the stability of state reporting is ensured, and the reporting of the device state cannot be influenced by frequent change of the reporting device.
Furthermore, the reporting device reports the state of each device in the group in which the reporting device is located, so that the reporting device only needs to be in communication connection with the server, and each device does not need to be in communication connection with the server and report the heartbeat packet.
In carrying out the present embodiment, the following points need to be noted:
and under the condition that the target equipment is determined to be the reporting equipment, under the condition that the communication connection with the server is determined to be disconnected, re-determining the reporting equipment in the target equipment and the grouping equipment. Under the condition that the reporting equipment is disconnected from the server in communication, the states of all the equipment in the group cannot be reported to the server, and under the condition, the reporting equipment needs to be elected again, and the states of all the equipment in the group are reported through new reporting equipment.
If the target device is not a newly added device of the server, the information of the target device may be sent to other devices by the server, and when the other devices determine the grouping device, a grouping request sent by the other devices may be received, and for this case, the embodiment may perform the following steps:
and returning a group grant message to the other equipment under the condition that a grouping request from the other equipment is received before the equipment for reporting is determined, so that the target equipment enters the grouping of the other equipment. In this case, the target device does not belong to any group, and may first agree to join the groups of other clients.
After the reporting equipment is determined, determining a third network delay and a fourth network delay under the condition of receiving grouping requests from other equipment; wherein the third network latency is a network latency between the target device and the other device; the fourth network delay is a network delay between the target device and the reporting device. And under the condition that the third network delay is less than the fourth network delay, returning an agreement grouping message to the other equipment, and sending a rejection grouping message to the target equipment. And returning a rejection packet message to the other equipment when the third network delay is greater than or equal to the fourth network delay.
The grouping principle of this embodiment is that network delay between devices in a group is small, so after receiving a grouping request from another device, information of the other device can be extracted from the grouping request; determining the network delay of each device to be selected in the device to be selected list under the condition that the information of the other devices is determined not to be contained in the device to be selected list; determining the maximum network delay in the network delay of each device to be selected in the device to be selected list; and deleting the information of the equipment to be selected corresponding to the maximum network delay from the equipment to be selected list and adding the information of the other equipment to the equipment to be selected list under the condition that the third network delay is smaller than the maximum network delay. Therefore, the list of the devices to be selected dynamically changes along with the increase and decrease of the device information.
The embodiment of the application also provides a state reporting device arranged on the target equipment. Fig. 4 is a structural diagram of a status reporting apparatus configured in a target device according to an embodiment of the present application.
The device for reporting the state of the target device comprises: a reading module 410, a selecting module 420 and a determining module 430.
And a reading module 410, configured to read information of the multiple candidate devices returned by the server after each device grouping period starts.
The selecting module 420 is configured to select a grouping device from the multiple devices to be selected according to information of the multiple devices to be selected.
A determining module 430, configured to determine a reporting device in the target device and the grouping device, so as to report the states of the target device and the grouping device to the server through the reporting device in the device grouping period.
The embodiment of the application also provides a state reporting device arranged on the server. Fig. 5 is a structural diagram of a status reporting apparatus installed in a server according to an embodiment of the present application.
The state reporting device arranged on the server comprises:
a receiving module 510, configured to receive a state of a target device and a state of a packet device, which are reported by a reporting device; the reporting device is a device determined from the target device and the grouping device after a device grouping period starts; the grouping device is selected by the target device from a plurality of devices to be selected, and the information of the plurality of devices to be selected is sent to the target device by the server.
An updating module 520, configured to update the current state of the target device according to the state of the target device; and updating the current state of the grouping device according to the state of the grouping device.
As shown in fig. 6, an electronic device according to an embodiment of the present application includes aprocessor 610, acommunication interface 620, amemory 630, and acommunication bus 640, where theprocessor 610, thecommunication interface 620, and thememory 630 complete communication with each other through thecommunication bus 640.
Amemory 630 for storing computer programs.
In an embodiment of the present application, theprocessor 610 is configured to implement any of the foregoing state reporting methods executed by the target device or the foregoing state reporting methods executed by the server when executing the program stored in thememory 630.
When theprocessor 610 executes the program stored in thememory 630, the method for reporting the status performed by the target device includes: after the grouping period of each device is started, reading information of a plurality of devices to be selected returned by the server; selecting grouping equipment from the multiple equipment to be selected according to the information of the multiple equipment to be selected; and determining reporting equipment in the target equipment and the grouping equipment so as to report the states of the target equipment and the grouping equipment to the server through the reporting equipment in the equipment grouping period.
Before reading information of a plurality of devices to be selected returned by the server, the method further comprises the following steps: sending the position information of the target equipment to the server so that the server can select a preset number of equipment as equipment to be selected from equipment in an online state according to the position information of the target equipment; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and receiving and storing the information of the plurality of devices to be selected returned by the server.
Wherein, according to the information of the multiple devices to be selected, selecting a grouping device from the multiple devices to be selected includes: establishing communication connection with each device to be selected according to the information of the devices to be selected; determining the network delay of each device to be selected based on the communication connection with each device to be selected; and selecting grouping equipment from the plurality of equipment to be selected according to the network delay of each equipment to be selected.
Wherein, the selecting a grouping device from the plurality of devices to be selected according to the network delay with each device to be selected includes: sequentially sending grouping requests to each device to be selected according to the sequence of network delay from small to large; receiving an agreement grouping message or a rejection grouping message returned by each device to be selected; selecting the device to be selected which returns the agreement grouping message as the grouping device so as to combine the target device and the selected grouping device into a group; wherein, the consent grouping message is returned when the device to be selected does not belong to other groups; or, the device to be selected belongs to other groups and the first network delay is less than the second network delay; the first network delay is the network delay between the device to be selected and the target device; the second network delay is the network delay between the device to be selected and the interactive device in the other group; the reject packet message is returned when the device to be selected belongs to other packets and the first network delay is greater than or equal to the second network delay.
Wherein the method further comprises: before determining the reporting device, returning a group agreement message to other devices under the condition that a group request from other devices is received, so that the target device enters a group in which the other devices are located; after the reporting equipment is determined, determining a third network delay and a fourth network delay under the condition of receiving grouping requests from other equipment; wherein the third network latency is a network latency between the target device and the other device; the fourth network delay is a network delay between the target device and the reporting device; under the condition that the third network delay is smaller than the fourth network delay, returning a group agreement message to the other equipment, and sending a group rejection message to the target equipment; and returning a rejection packet message to the other equipment when the third network delay is greater than or equal to the fourth network delay.
The server sends the information of the plurality of devices to be selected to the server; after the receiving of the grouping request from the other device, the method further comprises: extracting information of the other devices in the grouping request; determining the network delay of each device to be selected in the device to be selected list under the condition that the information of the other devices is determined not to be contained in the device to be selected list; determining the maximum network delay in the network delay of each device to be selected in the device to be selected list; and deleting the information of the equipment to be selected corresponding to the maximum network delay from the equipment to be selected list and adding the information of the other equipment to the equipment to be selected list under the condition that the third network delay is smaller than the maximum network delay.
Wherein the determining, in the target device and the grouping device, a reporting device includes: determining the online time of the target equipment; sending the online duration of the target device to the grouping device, and receiving the online duration of the grouping device sent by the grouping device; determining the device with the longest online time as the reporting device in the target device and the grouping device; and the grouping device also determines the device with the longest online time as the reporting device.
Reporting the states of the target device and the grouping device to the server through the reporting device in the device grouping period, wherein the reporting comprises: under the condition that the target equipment is determined as reporting equipment, receiving heartbeat packets reported by the grouping equipment every other preset reporting time period, and determining the state of the grouping equipment according to the received heartbeat packets; reporting the state of the target equipment and the state of the grouping equipment to the server; and under the condition that the grouping equipment is determined as reporting equipment, the target equipment sends a heartbeat packet to the reporting equipment every reporting time period, so that the reporting equipment determines the state of the target equipment according to the heartbeat packet reported by the target equipment and reports the state to the server.
Wherein, in case that the target device is determined to be a reporting device, the method further comprises: and deleting the information of the grouping equipment under the condition that the heartbeat packet reported by the grouping equipment is still not received within a preset first waiting time period from the moment that the heartbeat packet reported by the grouping equipment is not received.
Wherein, in case that the target device is determined to be a reporting device, the method further comprises: and under the condition that the communication connection with the server is determined to be disconnected, re-determining the reporting equipment in the target equipment and the grouping equipment.
When theprocessor 610 executes the program stored in thememory 630, the method for reporting the state executed by the server includes: receiving the state of the target equipment and the state of the grouping equipment reported by the reporting equipment; the reporting device is a device determined from the target device and the grouping device after a device grouping period starts; the grouping device is selected by the target device from a plurality of devices to be selected, and the information of the plurality of devices to be selected is sent to the target device by the server; updating the current state of the target equipment according to the state of the target equipment; and updating the current state of the grouping device according to the state of the grouping device.
Wherein the types of states include: an online state and an offline state; before the receiving the state of the target device and the state of the packet device reported by the reporting device, the method further includes: receiving location information from the target device; according to the position information of the target equipment, selecting a preset number of equipment as equipment to be selected from the equipment in an online state; wherein the distance between the selected device and the target device is smaller than the distance between the unselected device and the target device; and returning the information of the plurality of devices to be selected to the target device, so that the target device can select the grouping device from the plurality of devices to be selected according to the information of the plurality of devices to be selected.
Wherein the method further comprises: starting from the state of the target device and the state of the grouping device which are not received and reported by the reporting device, in a preset second waiting time period, under the condition that the state of the target device and the state of the grouping device which are reported by the reporting device are still not received, updating the current states of the target device and the grouping device to be offline states.
An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the status reporting method provided in any one of the foregoing method embodiments.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is merely exemplary of the present application and is presented to enable those skilled in the art to understand and practice the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (17)

CN202110181924.6A2021-02-092021-02-09State reporting method, device, equipment and computer readable storage mediumPendingCN112910740A (en)

Priority Applications (2)

Application NumberPriority DateFiling DateTitle
CN202110181924.6ACN112910740A (en)2021-02-092021-02-09State reporting method, device, equipment and computer readable storage medium
PCT/CN2021/128480WO2022170791A1 (en)2021-02-092021-11-03State reporting method and apparatus, device, and computer-readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110181924.6ACN112910740A (en)2021-02-092021-02-09State reporting method, device, equipment and computer readable storage medium

Publications (1)

Publication NumberPublication Date
CN112910740Atrue CN112910740A (en)2021-06-04

Family

ID=76123352

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110181924.6APendingCN112910740A (en)2021-02-092021-02-09State reporting method, device, equipment and computer readable storage medium

Country Status (2)

CountryLink
CN (1)CN112910740A (en)
WO (1)WO2022170791A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2022170791A1 (en)*2021-02-092022-08-18珠海格力电器股份有限公司State reporting method and apparatus, device, and computer-readable storage medium
CN115714776A (en)*2023-01-092023-02-24杭州涂鸦信息技术有限公司Method for receiving reported data from equipment and method for reporting data by equipment
CN119629225A (en)*2024-12-042025-03-14珠海格力电器股份有限公司 Device status reporting method, system, device, equipment and storage medium
CN119629225B (en)*2024-12-042025-10-17珠海格力电器股份有限公司Method, system, device, equipment and storage medium for reporting equipment state

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN118713976B (en)*2024-08-262024-12-03天翼视联科技有限公司 Device management method, device, electronic device and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20140181295A1 (en)*2012-12-212014-06-26Tanium Inc.Creation and Maintenance of Self-Organizing Communication Orbits in Distributed Networks
CN104270466A (en)*2014-10-222015-01-07中国建设银行股份有限公司Data reporting method and related equipment
CN105553685A (en)*2015-10-132016-05-04福州开发区慧聚通信技术有限公司Network equipment online state monitoring system and method
CN109005528A (en)*2018-07-062018-12-14杭州涂鸦信息技术有限公司A kind of bluetooth mesh gateway data polymerization report method
CN109150588A (en)*2018-07-252019-01-04河北华沃通信科技有限公司device management method and device
CN109788068A (en)*2019-02-142019-05-21腾讯科技(深圳)有限公司Heartbeat state information report method, device and equipment and computer storage medium
CN110798349A (en)*2019-10-282020-02-14国家计算机网络与信息安全管理中心Configuration distribution and receiving method, equipment and computer readable storage medium
US10565227B1 (en)*2016-08-312020-02-18Amazon Technologies, Inc.Leadership lease protocol for data replication groups
CN111130920A (en)*2019-11-262020-05-08网宿科技股份有限公司Hardware information acquisition method, device, server and storage medium
WO2020125168A1 (en)*2018-12-182020-06-25杭州光启人工智能研究院Heartbeat packet-based data sending and receiving method, and storage medium and processor
CN112073473A (en)*2020-08-182020-12-11浙江鸿城科技有限责任公司Internet of things equipment heartbeat packet data acquisition method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN108055321B (en)*2017-12-112021-06-11中国电子科技集团公司第二十八研究所High-reliability cluster construction method based on localization platform
CN112910740A (en)*2021-02-092021-06-04珠海格力电器股份有限公司State reporting method, device, equipment and computer readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20140181295A1 (en)*2012-12-212014-06-26Tanium Inc.Creation and Maintenance of Self-Organizing Communication Orbits in Distributed Networks
CN104270466A (en)*2014-10-222015-01-07中国建设银行股份有限公司Data reporting method and related equipment
CN105553685A (en)*2015-10-132016-05-04福州开发区慧聚通信技术有限公司Network equipment online state monitoring system and method
US10565227B1 (en)*2016-08-312020-02-18Amazon Technologies, Inc.Leadership lease protocol for data replication groups
CN109005528A (en)*2018-07-062018-12-14杭州涂鸦信息技术有限公司A kind of bluetooth mesh gateway data polymerization report method
CN109150588A (en)*2018-07-252019-01-04河北华沃通信科技有限公司device management method and device
WO2020125168A1 (en)*2018-12-182020-06-25杭州光启人工智能研究院Heartbeat packet-based data sending and receiving method, and storage medium and processor
CN109788068A (en)*2019-02-142019-05-21腾讯科技(深圳)有限公司Heartbeat state information report method, device and equipment and computer storage medium
CN110798349A (en)*2019-10-282020-02-14国家计算机网络与信息安全管理中心Configuration distribution and receiving method, equipment and computer readable storage medium
CN111130920A (en)*2019-11-262020-05-08网宿科技股份有限公司Hardware information acquisition method, device, server and storage medium
CN112073473A (en)*2020-08-182020-12-11浙江鸿城科技有限责任公司Internet of things equipment heartbeat packet data acquisition method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李领治等: "一种分布式的选播组管理方案", 《应用科学学报》*

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2022170791A1 (en)*2021-02-092022-08-18珠海格力电器股份有限公司State reporting method and apparatus, device, and computer-readable storage medium
CN115714776A (en)*2023-01-092023-02-24杭州涂鸦信息技术有限公司Method for receiving reported data from equipment and method for reporting data by equipment
CN119629225A (en)*2024-12-042025-03-14珠海格力电器股份有限公司 Device status reporting method, system, device, equipment and storage medium
CN119629225B (en)*2024-12-042025-10-17珠海格力电器股份有限公司Method, system, device, equipment and storage medium for reporting equipment state

Also Published As

Publication numberPublication date
WO2022170791A1 (en)2022-08-18

Similar Documents

PublicationPublication DateTitle
CN112910740A (en)State reporting method, device, equipment and computer readable storage medium
CN107872402B (en)Global flow scheduling method and device and electronic equipment
CN113709839A (en)Multi-gateway network switching method, device and system, electronic equipment and storage medium
CN102158346A (en)Information acquisition system and method based on cloud computing
CN107404541B (en)Method and system for selecting neighbor node in peer-to-peer network transmission
EP3148156A1 (en)Sending method and apparatus and computer storage medium of notification message
CN112911520B (en)Method, device and storage medium for determining master node in ad hoc network
CN110661836A (en)Message routing method, device and system, and storage medium
CN108064439A (en)A kind of network path optimization method, system, control server-side and networking end
CN102769867B (en)Method for network access
CN107770754A (en)A kind of notice sending method, device and system
CN113518125A (en)Offline data uploading method and system, storage medium and electronic device
CN111884875A (en)Offline device determination method and device
CN110213213B (en)Timing task processing method and system for application
CN116996865A (en)Method, device, equipment and storage medium for upgrading over-the-air
CN113905050A (en)Method, device and system for detecting internet access information
CN110601989A (en)Network traffic balancing method and device
US20180124576A1 (en)Method and apparatus for implementing member resource processing
CN103763206A (en)Network scheduling method and gateway
CN106411713B (en)State notification method and server
KR20120138546A (en)Apparatus and method for discovery based on priority in distributed network and method for determining discovery backoff time
CN112910997B (en)Resource acquisition method of local area network
CN110119314A (en)A kind of server calls method, apparatus, server and storage medium
CN110839061B (en)Data distribution method, device and storage medium
CN110109933A (en)Information maintenance method, configuration management database system and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20210604


[8]ページ先頭

©2009-2025 Movatter.jp