Edge device status synchronization management method and device
By implementing the synchronization management method of edge device status on the gateway management platform, the loss of device status caused by unblocked data transmission between the gateway and the cloud platform is solved, and the accurate synchronization of device status and the stability of service data transmission is achieved.
Patent Information
- Application Number
- CN202210899704.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-28
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-07-28
AI Technical Summary
In the prior art, when the data transmission between the gateway and the cloud platform is not smooth, there is a defect in the loss of the online state of the sub-device, resulting in the failure of the service data transmission.
By implementing the synchronization management method of edge device status on the gateway management platform, receiving messages reported by the gateway device, and updating the status information of the target edge device in the database based on the service information, thereby ensuring accurate synchronization of the device status.
When the gateway device or edge device cannot report status due to failure or network reasons, the online status of the device is updated in a timely manner through service information, which improves the stability of equipment business data reporting and reduces the chance of failure of service data transmission.
Smart Images

Figure CN115499497B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of edge computing technology, and in particular to a method and device for synchronously managing edge device status. Background Art
[0002] In the era of big data, edge devices are located at the edge of the network close to the data source, integrating network, computing, storage, and application core capabilities to provide edge intelligent services nearby, meeting the key needs of industry digitalization in agile connectivity, real-time business, data optimization, application intelligence, security and privacy protection, and serving as a bridge connecting the physical and digital worlds.
[0003] In industry, edge computing devices are widely used in smart factories, smart grids, smart water conservancy, environmental monitoring, sewage treatment, elevator monitoring, packaging machinery, printing and dyeing machinery, engineering machinery, textile machinery, water supply equipment, thermal boilers and other industrial fields. In the above application scenarios, edge devices usually work in extremely complex local area network environments. The network between them and the management platform deployed in the cloud usually has high latency, low bandwidth, instability and other problems. When the data transmission between the gateway and the cloud management platform is not smooth, the traditional data transmission method is that the edge device sends an online message or a last words message to the cloud management platform through the gateway to update the online status or offline status of the device. Its stability is low. When the data transmission between the gateway and the cloud platform is not smooth, there is a defect of losing the online status of the sub-device, resulting in the failure of business data transmission. Summary of the invention
[0004] The present invention provides a method and apparatus for synchronously managing the status of edge devices, which are used to solve the defect in the prior art that when the data transmission between the gateway and the cloud platform is not smooth, the online status of the sub-device is lost, resulting in the failure of business data transmission.
[0005] The present invention provides a method for synchronous management of edge device status, which is applied to a gateway management platform, comprising:
[0006] Receive a first message reported by a gateway device;
[0007] After processing the business based on the business information, setting the first state information of the target edge device in the first database to an online state, and updating the second state information of the target edge device in the second database from an offline state to an online state;
[0008] Among them, the business information is obtained from the first message when it is determined that the second status information is in an offline state; the second status information is extracted from the second database based on the edge device identifier carried by the first information.
[0009] According to a method for synchronous management of edge device status provided by the present invention, after receiving the first information reported by the gateway device, the method further includes:
[0010] Based on the online information, setting the first state information and the second state information of the target edge device to an online state;
[0011] The online information is obtained based on the first message.
[0012] A method for synchronously managing edge device status provided by the present invention further includes:
[0013] When it is determined that the first message is not received within a preset time period, in response to an online identification expiration event of the third state information of the target edge device in the first database, updating the third state information from an online state to an offline state;
[0014] When it is determined that the fourth status information of the target edge device in the second database is in an online state, the fourth status information is updated from an online state to an offline state.
[0015] According to a method for synchronous management of edge device status provided by the present invention, when the first message is not received, the method further includes:
[0016] Receiving a second message reported by the gateway device;
[0017] Based on the offline information, the third state information of the target edge device in the first database and the fourth state information of the target edge device in the second database are set to an offline state;
[0018] The offline information is obtained based on the second message.
[0019] The present invention also provides a method for synchronous management of edge device status, which is applied to a gateway device, comprising:
[0020] Determine the state of the gateway device based on the operation information of the gateway device;
[0021] When it is determined that the state of the gateway device is offline, a first message carrying business information reported by the edge device is received, and after processing, the first message carrying business information is forwarded to the gateway management platform, so that the gateway management platform updates the device state of the edge device from offline to online based on the first message;
[0022] When it is determined that the gateway device status is online, a first message carrying online information reported by the edge device is received, and after verification, the first message carrying the online information is forwarded to the gateway management platform, so that the gateway management platform can set the device status of the edge device to online based on the first message.
[0023] The present invention also provides a method for synchronous management of edge device status, which is applied to edge devices and includes:
[0024] Based on the operation information of the edge device, a first message is sent to the gateway device.
[0025] The present invention also provides a device for synchronously managing the status of an edge device, which is arranged on a gateway management platform and includes:
[0026] A first receiving module, used to receive a first message reported by a gateway device;
[0027] A first online management module, configured to set the first status information of the target edge device in the first database to an online status after processing the service based on the service information, and to update the second status information of the target edge device in the second database from an offline status to an online status;
[0028] Among them, the business information is obtained from the first message when it is determined that the second status information is in an offline state; the second status information is extracted from the second database based on the edge device identifier carried by the first information.
[0029] The present invention also provides a device for synchronously managing the state of an edge device, which is arranged in a gateway device and includes:
[0030] A gateway status determination module, used to determine the status of a gateway device based on the operation information of the gateway device;
[0031] A first forwarding module is used to receive a first message carrying business information reported by an edge device when it is determined that the gateway device state is an offline state, and forward the first message carrying business information to a gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from an offline state to an online state based on the first message;
[0032] The second forwarding module is used to receive a first message carrying online information reported by an edge device when it is determined that the gateway device status is online, and forward the first message carrying the online information to the gateway management platform after verification, so that the gateway management platform can set the device status of the edge device to an online state based on the first message.
[0033] The present invention also provides a device for synchronously managing the state of an edge device, which is arranged in the edge device and includes:
[0034] The edge device online module is used to send a first message to the gateway device based on the operation information of the edge device.
[0035] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for synchronously managing the edge device status as described in any one of the above is implemented.
[0036] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for synchronously managing the edge device status as described in any one of the above is implemented.
[0037] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for synchronous management of edge device status.
[0038] The method and device for synchronous management of edge device status provided by the present invention identify and count the device status of edge devices based on the first message, execute related services through business information when it is determined that the device is in an offline state, and update the first state information and the second state information to an online state. When the gateway device or edge device is unable to transmit the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform can timely update the online status of the device according to the business information reported by the edge device through MQTT, which helps to improve the stability of device business data reporting and greatly reduce the probability of business data transmission failure. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 It is one of the flow charts of the method for synchronous management of edge device status provided by the present invention;
[0041] Figure 2 This is the second flow chart of the method for synchronous management of edge device status provided by the present invention;
[0042] Figure 3 This is the third flow chart of the method for synchronous management of edge device status provided by the present invention;
[0043] Figure 4 This is one of the overall flow diagrams of the method for synchronous management of edge device status provided by the present invention;
[0044] Figure 5 This is the second overall flow diagram of the method for synchronous management of edge device status provided by the present invention;
[0045] Figure 6 It is one of the structural schematic diagrams of the device for synchronous management of edge device status provided by the present invention;
[0046] Figure 7 This is the second structural diagram of the device for synchronously managing the edge device status provided by the present invention;
[0047] Figure 8 This is the third structural diagram of the device for synchronously managing the edge device status provided by the present invention;
[0048] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms "first", "second", etc. in this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or more.
[0051] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present invention, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0052] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0053] Figure 1 This is one of the flow charts of the method for synchronous management of edge device status provided by the present invention. Figure 1 As shown, the method for synchronous management of edge device status provided by an embodiment of the present invention is applied to a gateway management platform, and includes: step 101, receiving a first message reported by a gateway device.
[0054] It should be noted that the edge computing architecture includes the terminal layer, edge layer and cloud layer, among which:
[0055] The terminal layer refers to the layer closest to the user equipment (UE), which is composed of various IoT devices, such as sensors, smartphones, smart vehicles, smart cards, card readers, etc. In order to extend the service time provided by the terminal device, complex computing tasks should be avoided on the terminal device. Therefore, the edge device is only responsible for collecting raw data and uploading it to the upper layer for calculation and storage. The terminal layer is connected to the upper layer mainly through the cellular network.
[0056] Edge layer: The edge layer is located at the edge of the network and is composed of a large number of edge computing nodes, usually including routers, gateways, switches, access points, base stations, specific edge servers, etc. These edge computing nodes are widely distributed between edge devices and the cloud layer, and can calculate and store data uploaded by terminal devices. Since these edge computing nodes are close to users, they can run applications that are sensitive to latency, thereby meeting users' real-time requirements. Edge computing nodes can also pre-process the collected data and then upload the pre-processed data to the cloud, thereby reducing the transmission traffic of the core network. The edge layer is connected to the upper layer mainly through the Internet.
[0057] The cloud layer refers to a gateway management platform composed of multiple high-performance servers and storage devices. The platform has powerful computing and storage capabilities and can perform complex computing tasks. The gateway management platform can effectively manage and schedule edge nodes and cloud computing centers through control strategies to provide better services to users.
[0058] It should be noted that the execution subject of the edge device status synchronization management method provided in the embodiment of the present invention is an edge device status synchronization management device set in the gateway management platform of the cloud layer.
[0059] The application scenario of the synchronous management device of the edge device status is that during the online process of the edge device, the edge device communicates with the gateway management platform in the cloud through the message forwarding of the gateway device. The gateway management platform timely updates the online status of the corresponding edge device through the received edge device business information.
[0060] It should be noted that the first message refers to the communication message between the edge device and its own online process, which is forwarded to the gateway management platform after being processed accordingly by the gateway device.
[0061] The embodiment of the present invention does not specifically limit the encapsulation format of the first message.
[0062] Exemplarily, the first message is based on the Message Queuing Telemetry Transport (MQTT) protocol to achieve communication between the gateway management platform and the gateway device.
[0063] Messages transmitted by MQTT are divided into two parts: Topic and Payload:
[0064] (1) Topic, which can be the type of message. After a subscriber subscribes, he will receive the message content (i.e., payload) of the topic.
[0065] (2) Payload, which can be the content of the message, refers to the specific content that the subscriber wants to use.
[0066] Specifically, in step 101, the synchronization management device in the edge device state of the gateway management platform can receive the first message reported by the gateway device through MQTT.
[0067] Step 102: After processing the service based on the service information, the first status information of the target edge device in the first database is set to an online status, and the second status information of the target edge device in the second database is updated from an offline status to an online status.
[0068] The service information is obtained from the first message when it is determined that the second status information is in an offline state. The second status information is extracted from the second database based on the edge device identifier carried in the first information.
[0069] It should be noted that the first database may be a non-relational database. The first database is used to store state information of the gateway device and the edge devices under its supervision with a certain timeliness.
[0070] The status information includes offline status and online status.
[0071] The second database may be a relational database and is used to persistently store status information of the gateway device and the edge devices under its supervision.
[0072] It should be noted that before step 102, the synchronization management device of the edge device status in the gateway management platform parses the received first message, and verifies it according to the edge device identifier carried in the subject part of the first message. If it is determined that the edge device identifier indexes the status information of its corresponding edge device (i.e., the second status information) in the second database as being offline, the business information carried in the load part of the first message is obtained.
[0073] The embodiment of the present invention does not specifically limit the above process.
[0074] Exemplarily, after determining that the second state information of the target edge device is offline, the gateway management platform verifies the legitimacy of the first message to verify whether the target edge device is a device authenticated and authorized by the gateway management platform. If the device is legitimate, the business information is parsed from the first message. Otherwise, the abnormal device information is filtered out.
[0075] The target edge device refers to the edge device that sends the first message.
[0076] Business information refers to the business-related information that the edge device continuously sends during the business process when it fails to send online information normally or the gateway device is offline.
[0077] Specifically, in step 102, the synchronization management device in the edge device state of the gateway management platform parses the first message to determine that it carries business information, extracts the business information of the target edge device from the first message, performs related business processing, and then sets the first state information of the target edge device in the first database to an online state with a certain timeliness.
[0078] At the same time, the second status information of the target edge device in the second database is still offline because the target edge device fails to send the online message normally or the gateway device fails. Therefore, after the gateway management platform processes the business, the corresponding second status information of the target edge device in the second database is updated from the original offline state to the online state.
[0079] The embodiment of the present invention identifies and counts the device status of the edge device based on the first message, executes related services through business information when it is determined that it is in an offline state, and updates both the first state information and the second state information to an online state. When the gateway device or edge device is unable to transmit the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform will update the online status of the device in a timely manner based on the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0080] On the basis of any of the above embodiments, after receiving the first information reported by the gateway device, it also includes: based on the online information, setting the first status information and the second status information of the target edge device to an online state.
[0081] The online information is obtained based on the first message.
[0082] It should be noted that online information refers to the information sent after the target edge device can go online normally. The information is encapsulated into the first message through the MQTT protocol, and the validity of the first message is verified by the online gateway device. After verifying that its message format conforms to the online notification message, it is forwarded to the gateway management platform.
[0083] Specifically, after step 101, the synchronization management device of the edge device status in the gateway management platform parses the received first message, and after obtaining the online information carried by the load part in the first message, the first status information of the target edge device in the first database and the second status information of the target edge device in the second database are synchronously updated to the online status.
[0084] The embodiment of the present invention identifies and counts the device status of the edge device based on the first message, and sets the first status information and the second status information to the online status by receiving the online information carried by the first message. When the edge computing network communication is normal, the gateway management platform can timely update the online status of the device according to the online information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0085] Based on any of the above embodiments, it also includes: when it is determined that the first message has not been received within a preset time period, in response to an online identification expiration event of the third state information of the target edge device in the first database, updating the third state information from an online state to an offline state.
[0086] Specifically, in step 101, when the synchronization management device in the edge device state of the gateway management platform is waiting to receive the first message, if it is determined that the first message periodically reported by the edge device has not been received within the preset time period, the online identification of the third state information of the target edge device in the first database cannot be updated, thereby triggering an online identification expiration event. The management platform obtains the edge device identification of the target edge device whose online state has expired by monitoring the online identification expiration event of the target edge device, updates the third state information corresponding to the edge device identification in the first database from an online state to an offline state, and stops receiving business messages reported by this edge device.
[0087] When it is determined that the fourth status information of the target edge device in the second database is in an online state, the fourth status information is updated from an online state to an offline state.
[0088] Specifically, the synchronization management device of the edge device status in the gateway management platform updates the fourth status information from the original online status to the offline status when the status information of the corresponding edge device (i.e., the fourth status information) is indexed as an online status in the second database according to the edge device identifier of the target edge device.
[0089] If the fourth status information indexed in the second database according to the edge device identifier of the target edge device is an offline state, it is determined that the target edge device has been offline normally and no processing is performed.
[0090] Based on the failure to obtain the first message within the preset time, the embodiment of the present invention updates the third state information from the online state to the offline state through the online identification expiration event corresponding to the third state information in the first database, and synchronously updates the fourth state information to the offline state. When a gateway device or edge device fails or the network fluctuates, causing the device to be abnormally offline, and no device offline notification message is sent to the gateway management platform, the device offline operation is actively triggered according to the device online identification expiration event stored in the non-relational database, and the device online state is updated in time, which helps to improve the accuracy of the gateway management platform's edge device state management in low-bandwidth, high-latency, and unstable network environments, and greatly reduces the probability of data transmission failure of edge computing gateway services.
[0091] Based on any of the above embodiments, when the first message is not received, the method further includes: receiving a second message reported by a gateway device.
[0092] It should be noted that the second message refers to the last words message sent by the target edge device after it can go offline normally. After being encapsulated and forwarded through the MQTT protocol, the online gateway device sorts out the MQTT last words messages sent by each edge device to generate the second message, and then forwards the second message to the gateway management platform.
[0093] The embodiment of the present invention does not specifically limit the encapsulation format of the second message.
[0094] Exemplarily, the second message implements communication between the gateway management platform and the gateway device based on MQTT.
[0095] Specifically, in step 101, the synchronization management device in the edge device state of the gateway management platform can receive the second message reported by the gateway device through MQTT.
[0096] Based on the offline information, the third state information of the target edge device in the first database and the fourth state information of the target edge device in the second database are both set to an offline state.
[0097] The offline information is obtained based on the second message.
[0098] Specifically, the synchronization management device of the edge device status in the gateway management platform parses the received second message, and after obtaining the offline information carried by the load part in the second message, the third status information of the target edge device in the first database and the fourth status information of the target edge device in the second database are synchronously updated to the offline status.
[0099] The embodiment of the present invention sets both the third status information and the fourth status information to the offline status based on the offline information carried by the second message. When the edge computing network communication is normal, the gateway management platform can timely update the offline status of the device according to the offline information reported by the edge device through MQTT, which helps to improve the accuracy of the gateway management platform's edge device status management in low-bandwidth, high-latency, and unstable network environments, and greatly reduces the probability of failure of edge computing gateway service data transmission.
[0100] Figure 2 FIG. 2 is a flow chart of the method for synchronously managing the edge device status provided by the present invention. Based on any of the above embodiments, Figure 2 As shown, the method for synchronous management of edge device status provided by an embodiment of the present invention includes: step 201, determining the status of the gateway device based on the operation information of the gateway device.
[0101] It should be noted that the execution subject of the edge device status synchronization management method provided in the embodiment of the present invention is an edge device status synchronization management device arranged in a gateway device of the edge layer.
[0102] Specifically, in step 201, the synchronization management device in the edge device state in the gateway device determines the gateway device state according to its own operation information.
[0103] The gateway device status includes online status and offline status.
[0104] Step 202-1: When it is determined that the gateway device status is offline, receive a first message carrying business information reported by the edge device, and after processing, forward the first message carrying the business information to the gateway management platform, so that the gateway management platform can update the device status of the edge device from offline to online based on the first message.
[0105] Specifically, in step 202-1, when the synchronization management device in the edge device state in the gateway device determines that the gateway device state is offline, it receives the first message carrying business information reported by the edge device through MQTT, performs simple processing on the business information it carries, and then forwards the first message to the gateway management platform.
[0106] The gateway management platform receives and responds to the first message. When the edge device resumes communication with the gateway management platform, the gateway management platform updates the first status information of the target edge device in the first database and the second status information of the target edge device in the second database to an online status based on the business information in the first message and the above-mentioned abnormal online management process of the edge device.
[0107] Step 202-2: When it is determined that the gateway device status is online, receive a first message carrying online information reported by the edge device, and after verification, forward the first message carrying the online information to the gateway management platform, so that the gateway management platform can set the device status of the edge device to online based on the first message.
[0108] Specifically, in step 202-1, when the synchronization management device in the edge device state in the gateway device determines that the gateway device state is offline, it receives a first message carrying online information reported by the edge device through MQTT and verifies the first message.
[0109] If the information format of the first message can be used for online notification, the first message is forwarded to the gateway management platform. Otherwise, the online information carried by the first message is considered invalid and needs to be filtered out.
[0110] The gateway management platform receives and responds to the first message. When the edge device resumes communication with the gateway management platform, the gateway management platform updates the first status information of the target edge device in the first database and the second status information of the target edge device in the second database to an online status according to the online information in the first message and the normal online management process of the edge device mentioned above.
[0111] It can be understood that in the process of the edge device going offline, the gateway device receives the last words message reported by the target edge device through MQTT. If the gateway device is in an online state, the last words message reported by each target edge device is organized into a second message for indicating that the edge device is normally offline, and the second message is forwarded to the gateway management platform to execute the above-mentioned normal offline management process of the edge device, and the third status information of the target edge device in the first database and the fourth status information of the target edge device in the second database are updated to the offline state.
[0112] If the gateway device is in an offline state, the gateway device stops reporting information regularly and does not report to the gateway management platform for n consecutive cycles. The gateway management platform executes the above-mentioned abnormal offline management process of the edge device and updates the third state information of the target edge device in the first database and the fourth state information of the target edge device in the second database to the offline state.
[0113] Wherein, n is a positive integer greater than or equal to 3.
[0114] Based on the state of the gateway device, the embodiment of the present invention decides to send a first message carrying corresponding information content to the gateway management platform, so that the gateway management platform can identify and count the device state of the edge device according to the first message, execute related business through business information when it is determined that it is in an offline state, and update the first state information and the second state information to an online state. When the gateway device or edge device is unable to pass the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform can timely update the online state of the device according to the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0115] Figure 3 FIG. 3 is a flow chart of the method for synchronously managing the edge device status provided by the present invention. Based on any of the above embodiments, Figure 3 As shown, the method for synchronous management of edge device status provided by an embodiment of the present invention includes: step 301, sending a first message to a gateway device based on the operation information of the edge device.
[0116] It should be noted that the execution subject of the edge device status synchronization management method provided in the embodiment of the present invention is an edge device status synchronization management apparatus arranged in an edge device of the terminal layer.
[0117] Specifically, in step 301, the synchronization management device in the edge device state in the edge device sends a first message carrying online information to the gateway device when it is determined that it can go online normally based on its own operation information. If it is determined that it cannot go online normally, it sends a first message carrying service information to the gateway device.
[0118] The gateway device receives the first message carrying the online information and executes different processing procedures according to its own operating status. If the gateway device is online, the first message that passes the verification is forwarded to the gateway management platform to execute the normal online management process of the edge device mentioned above. If the gateway device is offline, it waits to receive the first message carrying the business information, and after simple processing, it is forwarded to the gateway management platform to execute the abnormal online management process of the edge device mentioned above.
[0119] It is understandable that, in the process of the edge device going offline, the synchronization management device in the edge device state in the edge device sends a last words message to the gateway device when it is determined that it can go offline normally based on its own operation information. If it is determined that it cannot go offline normally, it stops reporting service information to the gateway device.
[0120] The gateway device receives the last words message and executes different processing procedures according to its own operating status. If the gateway device is online, the last words message is organized into a second message and forwarded to the gateway management platform to execute the normal offline management process of the edge device mentioned above. If the gateway device is offline, it stops reporting business information regularly. When the gateway management platform fails to receive business messages for multiple consecutive times, it executes the abnormal offline management process of the edge device mentioned above.
[0121] The embodiment of the present invention does not specifically limit the implementation method of the method for synchronous management of edge device status. Figure 4 This is one of the overall flow diagrams of the edge device status synchronization management method provided by the present invention. Figure 4 As shown, the specific implementation process of a synchronization management method for edge device online is given below:
[0122] (1) When the edge device goes online normally, it sends an online MQTT message (i.e., the first message carrying the online information) to the gateway device through MQTT. After receiving the online MQTT message, the gateway device performs message format verification and simple processing, and then forwards the online MQTT message to the cloud gateway management platform through the cloud MQTT server.
[0123] After the gateway management platform receives the online MQTT message, it performs a second verification on the message. If the verification is successful, the first status information of the target edge device in the non-relational first database is set to the online status, and the second status information of the target edge device in the relational second database is updated from the offline status to the online status, and the business data reported by the target edge device is started to be received.
[0124] (2) During the process of going online, the edge device fails to send the online MQTT message normally due to high network latency or unstable network, or the online MQTT message sent by the edge device fails to be forwarded to the computing gateway management platform due to a failure of the gateway device. When the edge device and the gateway management platform resume communication, the gateway management platform receives the business data MQTT message forwarded by the edge device through the gateway device, saves the online identifier carried by the first status information in the non-relational first database with a certain timeliness, and determines whether the target edge device is online through the second database. If the target edge device is offline at this time, the second status information in the corresponding second database is updated from the offline state to the online state.
[0125] Figure 5 This is the second overall flow diagram of the method for synchronous management of edge device status provided by the present invention. Figure 5 As shown, the specific implementation process of a synchronous management method for offline edge devices is given below:
[0126] (1) When the edge device goes offline normally, it sends a last message to the gateway device through MQTT. After receiving the last message of the edge device, the gateway device performs a message format check, performs simple processing on the last message, and then sends an offline MQTT message (i.e., the second message) to the gateway management platform through the cloud MQTT server.
[0127] After receiving the second message, the gateway management platform verifies the message. If the verification is successful, the third status information of the target edge device in the first database is updated from offline to offline, and the corresponding fourth status information in the second database is updated from online to offline, and the business data messages reported by the target edge device are stopped.
[0128] (2) When the edge device is offline, the will message is not sent normally due to high network latency or unstable network, or the will message sent by the edge device cannot be forwarded to the gateway management platform in the cloud due to a failure of the gateway device. When the gateway management platform does not receive the regularly reported business data message for a period of time, the online identification carried by the third status information stored in the first database cannot be updated, thereby triggering the online identification expiration event. The management platform obtains the device information of the expired online status by monitoring the online identification expiration event of the sub-device, updates the corresponding fourth status information in the second database from the online status to the offline status, and stops receiving the business messages reported by the target edge device.
[0129] Based on the operation status of the edge device, the embodiment of the present invention decides to send a first message carrying corresponding information content to the gateway device, so that the gateway management platform can identify and count the device status of the edge device according to the first message, execute related services through business information when it is determined that it is in an offline state, and update the first state information and the second state information to an online state. When the gateway device or edge device is unable to pass the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform can timely update the online status of the device according to the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0130] Figure 6FIG. 1 is a schematic diagram of a structure of a synchronous management device for edge device status provided by the present invention. Figure 6 As shown, the edge device state synchronization management device provided by the embodiment of the present invention is set in the gateway management platform, including: a first receiving module 610 and a first online management module 620, wherein:
[0131] The first receiving module 610 is configured to receive a first message reported by a gateway device.
[0132] The first online management module 620 is used to set the first status information of the target edge device in the first database to an online status after processing the business based on the business information, and to update the second status information of the target edge device in the second database from an offline status to an online status.
[0133] The service information is obtained from the first message when it is determined that the second status information is in an offline state. The second status information is extracted from the second database based on the edge device identifier carried in the first information.
[0134] Specifically, the first receiving module 610 and the first online management module 620 are electrically connected in sequence.
[0135] The first receiving module 610 may receive the first message reported by the gateway device through MQTT.
[0136] After parsing the first message to determine that it carries business information, the first online management module 620 extracts the business information of the target edge device from the first message, performs related business processing, and then sets the first status information of the target edge device in the first database to an online state with a certain timeliness.
[0137] At the same time, the second status information of the target edge device in the second database is still offline because the target edge device fails to send the online message normally or the gateway device fails. Therefore, after the gateway management platform processes the business, the corresponding second status information of the target edge device in the second database is updated from the original offline state to the online state.
[0138] Optionally, the device for synchronously managing the edge device status further includes a second online management module, wherein:
[0139] The second online management module is used to set the first status information and the second status information of the target edge device to an online status based on the online information.
[0140] The online information is obtained based on the first message.
[0141] Optionally, the device for synchronously managing the edge device status further includes an event monitoring module and a first offline management module, wherein:
[0142] An event monitoring module is used to update the third state information of the target edge device from an online state to an offline state in response to an online identification expiration event of the third state information in the first database when it is determined that the first message has not been received within a preset time period.
[0143] The first offline management module is used to update the fourth status information of the target edge device from an online state to an offline state when it is determined that the fourth status information of the target edge device in the second database is an online state.
[0144] Optionally, the device for synchronously managing the edge device status further includes a second receiving module and a second offline management module, wherein:
[0145] The second receiving module is used to receive a second message reported by the gateway device.
[0146] The second offline management module is used to set the third state information of the target edge device in the first database and the fourth state information of the target edge device in the second database to an offline state based on the offline information.
[0147] The offline information is obtained based on the second message.
[0148] The edge device status synchronization management device provided in an embodiment of the present invention is used to execute the above-mentioned edge device status synchronization management method of the present invention. Its implementation method is consistent with the implementation method of the edge device status synchronization management method provided by the present invention, and can achieve the same beneficial effects, which will not be repeated here.
[0149] The embodiment of the present invention identifies and counts the device status of the edge device based on the first message, executes related services through business information when it is determined that it is in an offline state, and updates both the first state information and the second state information to an online state. When the gateway device or edge device is unable to transmit the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform will update the online status of the device in a timely manner based on the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0150] Figure 7 FIG. 2 is a second structural diagram of the device for synchronously managing the edge device status provided by the present invention. Figure 7As shown, the edge device state synchronization management device provided by the embodiment of the present invention is set in the gateway device, including: a gateway state determination module 710, a first forwarding module 720-1 and a second forwarding module 720-2, wherein:
[0151] The gateway status determination module 710 is used to determine the gateway device status based on the operation information of the gateway device.
[0152] The first forwarding module 720-1 is used to receive a first message carrying business information reported by an edge device when it is determined that the gateway device status is offline, and forward the first message carrying business information to the gateway management platform after processing, so that the gateway management platform can update the device status of the edge device from an offline state to an online state based on the first message.
[0153] The second forwarding module 720-2 is used to receive a first message carrying online information reported by an edge device when it is determined that the gateway device status is online, and forward the first message carrying online information to the gateway management platform after verification, so that the gateway management platform can set the device status of the edge device to online based on the first message.
[0154] Specifically, the gateway state determination module 710, the first forwarding module 720-1 and the second forwarding module 720-2 are electrically connected in sequence.
[0155] The gateway status determination module 710 determines the gateway device status according to its own operation information.
[0156] The gateway device status includes online status and offline status.
[0157] When determining that the gateway device state is offline, the first forwarding module 720-1 receives a first message carrying business information reported by the edge device through MQTT, performs simple processing on the business information carried by the message, and then forwards the first message to the gateway management platform.
[0158] When determining that the gateway device state is offline, the second forwarding module 720 - 2 receives a first message carrying online information reported by the edge device through MQTT, and verifies the first message.
[0159] The edge device status synchronization management device provided in an embodiment of the present invention is used to execute the above-mentioned edge device status synchronization management method of the present invention. Its implementation method is consistent with the implementation method of the edge device status synchronization management method provided by the present invention, and can achieve the same beneficial effects, which will not be repeated here.
[0160] Based on the state of the gateway device, the embodiment of the present invention decides to send a first message carrying corresponding information content to the gateway management platform, so that the gateway management platform can identify and count the device state of the edge device according to the first message, execute related business through business information when it is determined that it is in an offline state, and update the first state information and the second state information to an online state. When the gateway device or edge device is unable to pass the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform can timely update the online state of the device according to the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0161] Figure 8 FIG. 3 is a schematic diagram of the structure of the synchronous management device for edge device status provided by the present invention. Figure 8 As shown, the edge device state synchronization management device provided by the embodiment of the present invention is arranged in the edge device, including: an edge device online module 810, wherein:
[0162] The edge device online module 810 is used to send a first message to the gateway device based on the operation information of the edge device.
[0163] Specifically, the edge device online modules 810 are electrically connected in sequence.
[0164] The edge device online module 810 sends a first message carrying online information to the gateway device when it is determined that it can go online normally based on its own operation information. If it is determined that it cannot go online normally, it sends a first message carrying service information to the gateway device.
[0165] The edge device status synchronization management device provided in an embodiment of the present invention is used to execute the above-mentioned edge device status synchronization management method of the present invention. Its implementation method is consistent with the implementation method of the edge device status synchronization management method provided by the present invention, and can achieve the same beneficial effects, which will not be repeated here.
[0166] Based on the operation status of the edge device, the embodiment of the present invention decides to send a first message carrying corresponding information content to the gateway device, so that the gateway management platform can identify and count the device status of the edge device according to the first message, execute related services through business information when it is determined that it is in an offline state, and update the first state information and the second state information to an online state. When the gateway device or edge device is unable to pass the online message to the gateway management platform due to its own failure or network reasons, when the device returns to normal, the gateway management platform can timely update the online status of the device according to the business information reported by the edge device through MQTT, which helps to improve the stability of the device business data reporting and greatly reduce the probability of business data transmission failure.
[0167] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor 910, a communication interface 920, a memory 930 and a communication bus 940, wherein the processor 910, the communication interface 920 and the memory 930 complete mutual communication through the communication bus 940. The processor 910 may call the logic instructions in the memory 930 to execute the synchronous management method of the edge device status, the method comprising: receiving a first message reported by a gateway device; after processing the service based on the service information, setting the first status information of the target edge device in the first database to an online status, and updating the second status information of the target edge device in the second database from an offline status to an online status; wherein the service information is obtained from the first message when it is determined that the second status information is an offline status; and the second status information is extracted from the second database based on the edge device identifier carried by the first information. A method for synchronous management of edge device status can also be performed, the method comprising: determining the state of the gateway device based on the operation information of the gateway device; when it is determined that the state of the gateway device is offline, receiving a first message carrying business information reported by the edge device, and forwarding the first message carrying business information to the gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from an offline state to an online state based on the first message; when it is determined that the state of the gateway device is online, receiving a first message carrying online information reported by the edge device, and forwarding the first message carrying online information to the gateway management platform after verification, so that the gateway management platform can set the device state of the edge device to an online state based on the first message. A method for synchronous management of edge device status can also be performed, the method comprising: sending a first message to the gateway device based on the operation information of the edge device.
[0168] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0169] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the edge device status synchronization management method provided by the above methods, the method including: receiving a first message reported by a gateway device; after processing the business based on the business information, setting the first status information of the target edge device in the first database to an online state, and updating the second status information of the target edge device in the second database from an offline state to an online state; wherein the business information is obtained from the first message when it is determined that the second status information is an offline state; and the second status information is extracted from the second database based on the edge device identifier carried by the first information. A method for synchronous management of edge device status can also be performed, the method comprising: determining the state of the gateway device based on the operation information of the gateway device; when it is determined that the state of the gateway device is offline, receiving a first message carrying business information reported by the edge device, and forwarding the first message carrying business information to the gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from an offline state to an online state based on the first message; when it is determined that the state of the gateway device is online, receiving a first message carrying online information reported by the edge device, and forwarding the first message carrying online information to the gateway management platform after verification, so that the gateway management platform can set the device state of the edge device to an online state based on the first message. A method for synchronous management of edge device status can also be performed, the method comprising: sending a first message to the gateway device based on the operation information of the edge device.
[0170] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the edge device status synchronization management method provided by the above-mentioned methods, the method comprising: receiving a first message reported by a gateway device; after processing a business based on the business information, setting the first status information of the target edge device in the first database to an online state, and updating the second status information of the target edge device in the second database from an offline state to an online state; wherein the business information is obtained from the first message when it is determined that the second status information is an offline state; and the second status information is extracted from the second database based on the edge device identifier carried by the first information. A method for synchronous management of edge device status can also be performed, the method comprising: determining the state of the gateway device based on the operation information of the gateway device; when it is determined that the state of the gateway device is offline, receiving a first message carrying business information reported by the edge device, and forwarding the first message carrying business information to the gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from an offline state to an online state based on the first message; when it is determined that the state of the gateway device is online, receiving a first message carrying online information reported by the edge device, and forwarding the first message carrying online information to the gateway management platform after verification, so that the gateway management platform can set the device state of the edge device to an online state based on the first message. A method for synchronous management of edge device status can also be performed, the method comprising: sending a first message to the gateway device based on the operation information of the edge device.
[0171] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0172] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0173] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for synchronous management of edge device status, applied to a gateway management platform, characterized in that: include: Receive a first message reported by a gateway device; The first message includes service information, where the service information is service-related information that is continuously sent by the edge device during the service process when the edge device fails to send online information normally or when the gateway device is offline; After processing the business based on the business information, setting the first state information of the target edge device in the first database to an online state, and updating the second state information of the target edge device in the second database from an offline state to an online state; the target edge device is the edge device that sends the first message; Among them, the business information is obtained from the first message when it is determined that the second status information is in an offline state; the second status information is extracted from the second database based on the edge device identifier of the target edge device carried by the first message.
2. The method for synchronous management of edge device status according to claim 1, characterized in that: After the receiving the first message reported by the gateway device, the method further includes: Based on the online information, setting the first state information and the second state information of the target edge device to an online state; The online information is obtained based on the first message.
3. The method for synchronous management of edge device status according to claim 1, characterized in that: Also includes: When it is determined that the first message is not received within a preset time period, in response to an online identification expiration event of the third state information of the target edge device in the first database, updating the third state information from an online state to an offline state; When it is determined that the fourth status information of the target edge device in the second database is in an online state, the fourth status information is updated from an online state to an offline state.
4. The method for synchronous management of edge device status according to claim 3, characterized in that: In the case that the first message is not received, the method further includes: Receiving a second message reported by the gateway device; Based on the offline information, the third state information of the target edge device in the first database and the fourth state information of the target edge device in the second database are set to an offline state; The offline information is obtained based on the second message.
5. A method for synchronous management of edge device status, applied to a gateway device, characterized in that: include: Determine the state of the gateway device based on the operation information of the gateway device; When it is determined that the state of the gateway device is offline, a first message carrying business information reported by the edge device is received, and the first message carrying business information is forwarded to the gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from offline to online based on the first message; the business information is business related information continuously sent by the edge device during the business process when the edge device fails to send online information normally or the gateway device is offline; When it is determined that the gateway device status is online, a first message carrying online information reported by the edge device is received, and after verification, the first message carrying the online information is forwarded to the gateway management platform, so that the gateway management platform can set the device status of the edge device to online based on the first message.
6. A method for synchronous management of edge device status, applied to edge devices, characterized in that: include: Sending a first message to a gateway device based on the operation information of the edge device; Wherein, if the state of the gateway device is offline, a first message carrying business information is reported to the gateway device, so that the gateway device processes the first message carrying business information, and after processing, the first message carrying business information is forwarded to the gateway management platform, so that the gateway management platform updates the device state of the edge device from offline to online based on the first message; If the gateway device state is an online state, a first message carrying online information is reported to the gateway device, so that the gateway device verifies the first message carrying the online information, and after verification, the first message carrying the online information is forwarded to the gateway management platform, so that the gateway management platform sets the device state of the edge device to an online state based on the first message; The service information is service-related information that is continuously sent during the service process by the edge device when the edge device fails to send online information normally or the gateway device is offline.
7. A device for synchronously managing the status of an edge device, arranged on a gateway management platform, characterized in that: include: A first receiving module, used to receive a first message reported by a gateway device; The first message includes service information, where the service information is service-related information that is continuously sent by the edge device during the service process when the edge device fails to send online information normally or when the gateway device is offline; A first online management module is used to set the first state information of the target edge device in the first database to an online state after processing the business based on the business information, and to update the second state information of the target edge device in the second database from an offline state to an online state; the target edge device is the edge device that sends the first message; Among them, the business information is obtained from the first message when it is determined that the second status information is in an offline state; the second status information is extracted from the second database based on the edge device identifier of the target edge device carried by the first message.
8. A device for synchronously managing edge device status, arranged in a gateway device, characterized in that: include: A gateway status determination module, used to determine the status of a gateway device based on the operation information of the gateway device; A first forwarding module is used to receive a first message carrying business information reported by an edge device when it is determined that the gateway device state is offline, and forward the first message carrying business information to a gateway management platform after processing, so that the gateway management platform can update the device state of the edge device from an offline state to an online state based on the first message; the business information is business-related information continuously sent by the edge device during the business process when the edge device fails to send online information normally or the gateway device is offline; The second forwarding module is used to receive a first message carrying online information reported by an edge device when it is determined that the gateway device status is online, and forward the first message carrying the online information to the gateway management platform after verification, so that the gateway management platform can set the device status of the edge device to an online state based on the first message.
9. A device for synchronously managing edge device status, arranged in an edge device, characterized in that: include: An edge device online module, used to send a first message to a gateway device based on the operation information of the edge device; Wherein, if the state of the gateway device is offline, a first message carrying business information is reported to the gateway device, so that the gateway device processes the first message carrying business information, and after processing, the first message carrying business information is forwarded to the gateway management platform, so that the gateway management platform updates the device state of the edge device from offline to online based on the first message; If the gateway device state is an online state, a first message carrying online information is reported to the gateway device, so that the gateway device verifies the first message carrying the online information, and after verification, the first message carrying the online information is forwarded to the gateway management platform, so that the gateway management platform sets the device state of the edge device to an online state based on the first message; The service information is service-related information that is continuously sent during the service process by the edge device when the edge device fails to send online information normally or the gateway device is offline.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for synchronous management of edge device status according to any one of claims 1 to 6 is implemented.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for synchronously managing the edge device status according to any one of claims 1 to 6 is implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for synchronously managing the edge device status according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Edge gateway proxy method and device based on message queue telemetry transmission
CN112565030A