Edge gateway and edge gateway subscription data storage method
Through the edge gateway subscription data storage method, data storage modules, model storage modules and device storage modules are generated, which solves the problem of not being plug-and-play when equipment changes, and realizes a simplified data subscription process and reduces operation and maintenance costs.
Patent Information
- Application Number
- CN202411584841.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-03-18
AI Technical Summary
The existing edge gateway subscription data storage method causes the device to be unable to plug and play when changes are made, and the installation and debugging time is long.
An edge gateway subscription data storage method is provided, by obtaining model names, subscription data storage modes and data set information from the subscribed data packets, generating data storage modules, model storage modules and device storage modules, and updating device registration flags in the device information table when new or replaced on the device is updated to realize plug-and-play of the device.
It simplifies the data subscription process, realizes plug-and-play equipment, reduces operation and maintenance costs, improves compatibility between edge gateways and edge clusters, and reduces installation and debugging time.
Smart Images

Figure CN119652967A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular relates to an edge gateway and a method for edge gateway to subscribe to data storage. Background Art
[0002] With the continuous advancement of the application of Internet of Things technology in power systems, new requirements have been put forward for improving the compatibility between edge gateways and edge clusters, reducing the installation and debugging time of edge gateways, increasing the master station access rate of edge gateways, and improving operational efficiency and service levels. At present, when the power dispatching master station or edge cluster communicates with the edge gateway, the forwarding data model adopted is a negotiated forwarding table. The subscription data to be forwarded is stored in the forwarding table, and the forwarding table is stored in the local file or database of the edge gateway. When new equipment is installed in the substation or old equipment is replaced, the forwarding table needs to be modified, resulting in the master station needing to re-send the data subscription message to the edge gateway, and the forwarding data between all edge gateway devices and the master station needs to be re-checked for bilateral consistency, which fails to achieve plug-and-play of the equipment, and the installation and debugging time is long when the equipment is changed. Summary of the invention
[0003] The object of the present invention is to provide an edge gateway and an edge gateway subscription data storage method, so as to solve the problem that the existing edge gateway subscription data storage method cannot be plug-and-play when the device is changed.
[0004] In order to solve the above technical problems, the present invention provides an edge gateway subscription data storage method, comprising:
[0005] Obtain the model name, subscription data storage mode and corresponding data set information from the subscription data message, where the subscription data storage mode includes the model subscription storage mode;
[0006] In the model subscription storage mode, the model registration time and all device information using the model in the model subscription storage mode are obtained according to the model name; the data storage module is generated according to the model name and the corresponding data set information, the model storage module is generated according to the model name, model registration time and data storage module index, and the device storage module is generated according to the device information using the model, the model name, the subscription data storage mode and the model storage module index used by the device; the device information includes the device ID, the device registration flag and the device registration time; the device registration flag is used to determine whether to report the device information.
[0007] Furthermore, all device information using the model in the model subscription storage mode is obtained from the device information table locally registered by the edge gateway.
[0008] Furthermore, when a device is new or replaced, the device registration mark of the device in the device information table is updated to associate the device with the model storage module used.
[0009] Furthermore, CRC check codes are also provided in the data storage module, the model storage module and the device storage module; wherein, the CRC check code of the data storage module is calculated based on the corresponding entire data set information; the CRC check code of the model storage module is calculated based on the model name and the model registration time; the CRC check code of the device storage module is calculated based on the device ID, the device registration time, the usage model name and the subscription data storage mode.
[0010] Furthermore, the method further comprises:
[0011] When a new subscription data message is received, the subscription information is obtained from the subscription data message, the subscription information includes the model name, the subscription data storage mode and the corresponding data set information;
[0012] Determine whether there is subscription information on the edge gateway. If so, and the subscription data storage mode is the model subscription storage mode, determine whether the stored model storage block and data storage block are the same as the newly subscribed one. If not, update the device storage block, model storage block, and data storage block.
[0013] If it does not exist and the subscription data storage mode is the model subscription storage mode, the device storage module, model storage module and data storage module are generated according to the new subscription data message, device information and model registration time.
[0014] Furthermore, the method for determining whether the stored model storage block and data storage block are the same as those newly subscribed is as follows: calculating a first CRC check code based on the model name and model registration time in the subscription information, calculating a second CRC check code based on the corresponding data set information in the subscription information, and determining the CRC check code in the corresponding data storage module based on the data storage module index in the model storage module; comparing the calculated first CRC check code with the CRC check code of the model storage module, and comparing the calculated second CRC check code with the CRC check code in the data storage module; if any difference is found in the comparison result, it is determined that the stored model storage block and data storage block are different from those newly subscribed.
[0015] Furthermore, the subscription data storage mode also includes a single-device subscription storage mode, in which the device ID is obtained from the subscription data message, and then the device information of the device is queried from the device information table locally registered by the edge gateway according to the device ID; a data storage module is generated according to the corresponding data set information, and a device storage module is generated according to the device information of the device, the usage model name, the subscription data storage mode and the data storage module index used by the device.
[0016] Furthermore, the method also includes: after the edge gateway is powered on and restarted, directly loading the model storage module, the device storage module and the data storage module stored before powering off.
[0017] Furthermore, the data set information includes the data set name, trigger options, cycle time and data member information of each data set, and the data member information includes the total number of members in the data set and the identifier of the data member, the dead zone type and the dead zone value.
[0018] The beneficial effects of the above technical solution are as follows: the present invention is a pioneering invention, which adds a function to support the storage of subscription data according to the model to the edge gateway, and generates a data storage module, a model storage module and a device storage module according to the subscription data message sent by the master station or the edge cluster. When in use, the subscription storage mode of the master station or the edge cluster is set to the model subscription storage mode, so that all device data associated with the model storage module can be subscribed. Therefore, when adding a new device or changing a device, there is no need for the master station or the edge cluster to re-send the subscription data message to the edge gateway to subscribe to the device information. It is only necessary to update the registration mark of the device in the device information table, and the edge gateway will directly report the data information of all devices to the master station or the edge cluster, thereby simplifying the data subscription process, not affecting the operation of the equipment that has been put into operation, realizing plug-and-play of the equipment, and reducing the operation and maintenance costs.
[0019] In order to solve the above technical problems, the present invention also provides an edge gateway, including a processor, wherein the processor is used to execute computer program instructions to implement the above-mentioned edge gateway subscription data storage method.
[0020] The beneficial effects of the above technical solution are as follows: the present invention is a pioneering invention, which adds a function to support the storage of subscription data according to the model to the edge gateway, and generates a data storage module, a model storage module and a device storage module according to the subscription data message sent by the master station or the edge cluster. When in use, the subscription storage mode of the master station or the edge cluster is set to the model subscription storage mode, so that all device data associated with the model storage module can be subscribed. Therefore, when adding a new device or changing a device, there is no need for the master station or the edge cluster to re-send the subscription data message to the edge gateway to subscribe to the device information. It is only necessary to update the registration mark of the device in the device information table, and the edge gateway will directly report the data information of all devices to the master station or the edge cluster, thereby simplifying the data subscription process, not affecting the operation of the equipment that has been put into operation, realizing plug-and-play of the equipment, and reducing the operation and maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a schematic diagram of the structure of the model subscription storage mode of the method embodiment of the present invention;
[0022] Figure 21 is a schematic diagram of a single device subscription storage mode structure of an embodiment of the method of the present invention;
[0023] Figure 3 It is a flow chart of edge gateway subscription to data storage in an embodiment of the method of the present invention;
[0024] Figure 4 It is a flow chart of loading and subscribing data when the edge gateway is powered on according to the method embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present invention more clear, the specific implementation methods of the present invention are further described below in conjunction with the accompanying drawings.
[0026] The present invention adds a function of supporting subscription data storage according to a model to the edge gateway, and generates a data storage module, a model storage module and a device storage module according to a subscription data message sent by a master station or an edge cluster. When in use, the subscription storage mode of the master station or the edge cluster is set to the model subscription storage mode, so that all device data associated with the model storage module can be subscribed. Therefore, when a new device is added or changed, there is no need for the master station or the edge cluster to re-send the subscription data message subscribing to the device information to the edge gateway. It only needs to update the registration mark of the device in the device information table, and the edge gateway will directly report the data information of all devices to the master station or the edge cluster, thereby simplifying the data subscription process, not affecting the operation of the equipment that has been put into operation, realizing plug-and-play of the equipment, reducing the operation and maintenance cost, improving the compatibility between the edge gateway and the edge cluster, reducing the installation and debugging time of the edge gateway, and then improving the master station access rate of the edge gateway, improving the operation efficiency and service level.
[0027] Method Embodiment
[0028] The edge gateway subscription data storage method of the present invention supports subscription data storage according to the subscription data storage mode, and the subscription data storage mode includes a model subscription storage mode, such as Figure 1 As shown, multiple device storage modules of the same device type correspond to a model storage module, and each model storage module corresponds to a data storage module. The subscription data storage mode also includes a single device subscription storage mode, such as Figure 2 As shown, when the device type is single, the single device subscription storage mode can be selected, in which each device storage module corresponds to a data storage module.
[0029] The device storage module includes device information, usage model name and subscription data storage mode. The device information includes: device ID (device unique identifier in the edge gateway), device registration flag and device registration time. The device registration flag is used to determine whether to report the device information. The model subscription storage mode also includes the model storage module index used by the device (used to directly locate the model storage module), and the single device subscription storage mode also includes the data storage module index used by the device (used to directly locate the data storage module).
[0030] The model storage module includes: model name (unique within the edge gateway), model registration time, and data storage module index corresponding to the model.
[0031] The data storage module includes the model name and the corresponding data set information. The data set information includes the data set name, trigger option, cycle time and data member information of each data set. The data member information includes the total number of members in the data set and the identification of the data member, the dead zone type and the dead zone value. The data set includes the analog data set, the input data set, the pulse data set, the control data set and the parameter (protection setting) data set.
[0032] The implementation principle of this method is as follows Figure 3 As shown, the detailed description is given below.
[0033] 1. Get the model name, subscription data storage mode and corresponding data set information from the subscription data message.
[0034] The master station or edge cluster sends a subscription data message, which includes: model name, subscription data storage mode AllDev (1: model subscription storage mode 0: single device subscription storage mode), device ID (the subscription message must contain device ID in the single device subscription storage mode), and corresponding data set information (model corresponding data set information or single device corresponding data set information). The edge gateway parses the message to obtain the model name, subscription data storage mode, and corresponding data set information.
[0035] 2. Apply for memory to store device information, model information (model name, model registration information) and data set information, and query the model registration time in the locally registered model information table according to the model name.
[0036] 3. Perform different operations based on the value of the subscribed data storage mode AllDev to obtain device information.
[0037] When AllDev is 1, all device information using this model is obtained from the device information table registered locally on the edge gateway;
[0038] When AllDev is 0, the device ID is obtained from the subscription data message, and the device information of the device is queried in the device information table locally registered on the edge gateway.
[0039] 4. Generate data storage module, model storage module and device storage module.
[0040] When AllDev is 1, that is, in the model subscription storage mode, the model storage module is generated according to the model name, model registration time and data storage module index; the device storage module is generated according to the device information using the model, the model name used, the subscription data storage mode and the model storage module index used by the device; the data storage module is generated according to the model name and the corresponding data set information.
[0041] When AllDev is 0, that is, in single device subscription storage mode, the device information is queried from the device information table locally registered by the edge gateway according to the device ID, and the device storage module is generated according to the device information, usage model name, subscription data storage mode, and data storage module index used by the device. The data storage module is generated according to the corresponding data set information.
[0042] Furthermore, CRC check codes are also provided in the data storage module, model storage module and device storage module. Among them, the CRC check code of the data storage module is calculated based on the corresponding information of all data sets; the CRC check code of the model storage module is calculated based on the model name and model registration time; the CRC check code of the device storage module is calculated based on the device ID, device registration time, usage model name and subscription data storage mode. The corresponding data set information is structured and serialized, the CRC check code of the data storage module is calculated, the data storage module is traversed, and it is determined whether there is a data storage module with the same CRC. If so, the index of the corresponding data storage module is obtained, and if not, the data storage module is generated.
[0043] When the master station or edge cluster subscribes to all devices that use the model in accordance with the model subscription storage mode, when a device is new or replaced, it is only necessary to update the device registration mark of the device in the device information table and associate the device with the model storage module used. Then, after the new device is powered on, there is no need for the master station or edge cluster to send a subscription data message. The edge gateway will report the data of all devices under the model to ensure that the data subscribed to the edge gateway can be stored safely and reliably, and that the new device only needs to be debugged for a single device when it is put into operation, without affecting the operation of the equipment already in operation, thus realizing plug-and-play of the equipment, ensuring the safe and stable operation of the system, and reducing the operation and maintenance costs.
[0044] like Figure 4As shown, the method also includes: after the edge gateway is powered on and restarted, the model storage module, device storage module and data storage module stored before power off are directly loaded, and device information, model information, data set information and dependency relationships between devices and models, models and data, and devices and data are constructed in memory. Two types of device models with subscription modes are created according to the value of the device's subscription storage mode AllDev: AllDev is 1 for model subscription storage mode, device subscription depends on model subscription, and a dependency relationship between model and data is established; AllDev is 0 for single device subscription storage mode, device subscription depends on data subscription, and a dependency relationship between device and data is established.
[0045] When a new subscription data message is received, the subscription information is obtained from the subscription data message, the subscription information includes the model name, device ID, subscription data storage mode and corresponding data set information, and it is determined whether the edge gateway has the subscription information;
[0046] If it exists and the subscription data storage mode is the model subscription storage mode, determine whether the stored model storage block and data storage block are the same as the newly subscribed ones. If they are not the same, update the device, model and data subscription information, and update the device storage block, model storage block and data storage block; if it does not exist and the subscription data storage mode is the model subscription storage mode, generate the device storage module, model storage module and data storage module according to the new subscription data message, device information and model registration time.
[0047] If it exists and the subscription data storage mode is a single device subscription storage mode, determine whether the stored data storage block is the same as the new subscription. If not, update the device subscription information and data subscription information, update the device storage block and data storage block. If it does not exist and the subscription data storage mode is a single device subscription storage mode, generate a device storage module and a data storage module according to the new subscription data message and device information.
[0048] The method to determine whether the stored model storage block and data storage block are the same as the newly subscribed ones is:
[0049] In the model subscription storage mode, a first CRC check code is calculated based on the model name and model registration time in the subscription information, a second CRC check code is calculated based on the corresponding data set information in the subscription information, and the CRC check code in the corresponding data storage module is determined based on the data storage module index in the model storage module; the calculated first CRC check code is compared with the CRC check code of the model storage module, and the calculated second CRC check code is compared with the CRC check code in the data storage module. If any difference is found in the comparison results, it is determined that the stored model storage block and data storage block are different from the newly subscribed ones.
[0050] In the single-device subscription storage mode, the second CRC check code is calculated based on the corresponding data set information in the subscription information, and the CRC check code in the corresponding data storage module is determined based on the data storage module index in the device storage module; the calculated second CRC check code is compared with the CRC check code in the data storage module, and if they are different, it is determined that the stored data storage block is different from the newly subscribed one.
[0051] Edge Gateway Example
[0052] An edge gateway of the present invention includes a processor, which is used to execute computer program instructions to implement an edge gateway subscription data storage method. The method is the edge gateway subscription data storage method described in the above method embodiment and is not described in detail here.
Claims
1. A method for storing edge gateway subscription data, characterized in that: include: Obtain the model name, subscription data storage mode and corresponding data set information from the subscription data message, where the subscription data storage mode includes the model subscription storage mode; In the model subscription storage mode, the model registration time and all device information using the model in the model subscription storage mode are obtained according to the model name; the data storage module is generated according to the model name and the corresponding data set information, the model storage module is generated according to the model name, model registration time and data storage module index, and the device storage module is generated according to the device information using the model, the model name, the subscription data storage mode and the model storage module index used by the device; the device information includes the device ID, the device registration flag and the device registration time; the device registration flag is used to determine whether to report the device information.
2. The edge gateway subscription data storage method according to claim 1, characterized in that: Get all device information that uses the model in model subscription storage mode from the device information table registered locally on the edge gateway.
3. The edge gateway subscription data storage method according to claim 2, characterized in that: When a device is new or replaced, the device registration mark of the device in the device information table is updated to associate the device with the model storage module used.
4. The edge gateway subscription data storage method according to claim 1, characterized in that: CRC check codes are also provided in the data storage module, model storage module and device storage module; wherein, the CRC check code of the data storage module is calculated based on the corresponding entire data set information; the CRC check code of the model storage module is calculated based on the model name and model registration time; the CRC check code of the device storage module is calculated based on the device ID, device registration time, usage model name and subscription data storage mode.
5. The edge gateway subscription data storage method according to claim 4, characterized in that: The method further includes: When a new subscription data message is received, the subscription information is obtained from the subscription data message, the subscription information includes the model name, the subscription data storage mode and the corresponding data set information; Determine whether there is subscription information on the edge gateway. If so, and the subscription data storage mode is the model subscription storage mode, determine whether the stored model storage block and data storage block are the same as the newly subscribed one. If not, update the device storage block, model storage block, and data storage block. If it does not exist and the subscription data storage mode is the model subscription storage mode, the device storage module, model storage module and data storage module are generated according to the new subscription data message, device information and model registration time.
6. The edge gateway subscription data storage method according to claim 5, characterized in that: The method for judging whether the stored model storage block and data storage block are the same as those newly subscribed is as follows: calculating a first CRC check code based on the model name and model registration time in the subscription information, calculating a second CRC check code based on the corresponding data set information in the subscription information, and determining the CRC check code in the corresponding data storage module based on the data storage module index in the model storage module; comparing the calculated first CRC check code with the CRC check code of the model storage module, and comparing the calculated second CRC check code with the CRC check code in the data storage module. If any difference is found in the comparison results, it is judged that the stored model storage block and data storage block are different from those newly subscribed.
7. The edge gateway subscription data storage method according to claim 1, characterized in that: The subscription data storage mode also includes a single-device subscription storage mode, in which the device ID is obtained from the subscription data message, and then the device information of the device is queried from the device information table locally registered by the edge gateway according to the device ID; a data storage module is generated according to the corresponding data set information, and a device storage module is generated according to the device information of the device, the usage model name, the subscription data storage mode and the data storage module index used by the device.
8. The edge gateway subscription data storage method according to claim 1, characterized in that: The method also includes: after the edge gateway is powered on and restarted, directly loading the model storage module, the device storage module and the data storage module stored before powering off.
9. The edge gateway subscription data storage method according to claim 1, characterized in that: The data set information includes the data set name, trigger options, cycle time and data member information of each data set. The data member information includes the total number of members in the data set and the identifier of the data member, the dead zone type and the dead zone value.
10. An edge gateway, comprising a processor, characterized in that: The processor is used to execute computer program instructions to implement the edge gateway subscription data storage method as described in any one of claims 1-9.