Data storage and management method and device for transformer substation network message recording and analyzing device

By loading shared data models in the recording and analysis device in the substation network message and analyzing the shared memory block, the problem of multi -process collaboration analysis difficulties is solved, and efficient data storage and management are achieved, and data timeliness and synchronization efficiency are guaranteed.

CN119377230AInactive Publication Date: 2025-01-28BEIJING SIFANG JIBAO ENG TECH +2
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411945429.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-01-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

How to realize data storage and management through the network message recording and analysis device of the substation, and solve the difficulties in multi-process collaborative analysis caused by data acquisition methods, message protocol types and engineering design in the prior art.

Method used

When the recording and analysis devices of the substation of the substation meet the preset startup conditions, load the pre -defined shared data model, define multiple shared data items, and allocate the corresponding shared memory block for each shared data item, set access permissions, wait for waiting, wait Mode, reservation cycle and storage capacity.

Benefits of technology

The efficient data storage and management of the recording and analysis devices of the substation of the substation is realized to ensure the timeliness of the data, reduce the number of reposts of the shared data of multiple processes, and improve the data synchronization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377230A_ABST
    Figure CN119377230A_ABST
Patent Text Reader

Abstract

The invention provides a data storage and management method and device for a transformer substation network message recording and analyzing device, and relates to the technical field of electric power data communication, and the method comprises the steps: loading a predefined shared data model under the condition that the transformer substation network message recording and analyzing device meets a preset starting condition; according to a data structure of the shared data model, allocating a corresponding shared memory block to each shared data item in the plurality of shared data items, and setting the shared memory blocks according to a preset mode; respectively determining the access authority and the waiting mode of each shared memory block according to the read-write requirements of different services on the shared data, and respectively determining the retention period and the storage capacity of the data in each shared memory block according to the setting mode of the shared memory block. Through the method provided by the invention, the timeliness of the data is guaranteed, and efficient storage and management of the shared data are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of electric power data communication technology, and in particular to a data storage and management method and device for a substation network message recording and analysis device. Background Art

[0002] With the development of information technology, the amount of communication data in the power system has also increased dramatically, but at the same time, abnormal transmission and reception of messages in the network can easily cause power system accidents. Therefore, it is necessary to effectively monitor, record and analyze the network communication messages of smart substations. The substation network message recording and analysis device can warn of network communication failures and hidden dangers in real time, and quickly locate the fault point and fault type, effectively preventing the occurrence of power system accidents.

[0003] Complete data records can help analysts reconstruct the actual power system communication process and provide the most detailed and correct original data for accident analysis. However, when the substation network message recording and analysis device records and analyzes network messages, due to reasons such as data collection methods, message protocol types, and engineering design, it usually requires multiple processes to collaborate to complete the correct parsing of all messages.

[0004] How to realize data storage and management through substation network message recording and analysis device is a technical problem that needs to be solved at present. Summary of the invention

[0005] The present invention provides a data storage and management method and device for a substation network message recording and analysis device, which are used to solve the defects in the prior art.

[0006] The present invention provides a data storage and management method for a substation network message recording and analysis device, comprising the following steps: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to: define multiple shared data items; According to the data structure of the shared data model, a corresponding shared memory block is allocated to each of the multiple shared data items, and the shared memory block is set according to a preset method; The access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different businesses for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0007] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, when the substation network message recording and analysis device meets a preset startup condition, before loading a predefined shared data model, the method further includes: Defining a shared data model between various business processes in the substation network message recording and analysis device, and defining necessary information contained in each of the multiple shared data items in the shared data model; Determine a set of operation modes for each shared data item in the plurality of shared data items; In the operation mode set of each shared data item, the management interface of the shared memory block is inherited; wherein the management interface includes: operation commands for creating, destroying, initializing, accessing and backing up the shared memory block.

[0008] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, the operation mode set includes: a hash table hash, an ordered set zset and an unordered set set; After determining the operation mode set of each shared data item in the plurality of shared data items, the method further includes: In a case where it is determined that the operation mode set of the shared data item is a hash table hash access mode based on a first key attribute value, a hash storage index is allocated to the shared data item based on the first key attribute value; In the case where it is determined that the operation mode set of the shared data item is an ordered set zset access mode based on a second key attribute value, a sorted storage index is allocated to the shared data item based on the second key attribute value; When it is determined that the operation mode set of the shared data item is an unordered set set access mode and hash table hash access or ordered set zset access is not required, a hash storage index and a sorted storage index are not established.

[0009] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, the method allocates a corresponding shared memory block to each of the multiple shared data items according to the data structure of the shared data model, and sets the shared memory block in a preset manner, including: Acquire the plurality of shared data items and necessary information contained in each of the plurality of shared data items; Allocating a corresponding shared memory block to each of the multiple shared data items through the management interface of the shared memory block; An access tag and a maximum storage capacity are set for each shared memory block respectively, and each shared memory block is initialized through a management interface of the shared memory block.

[0010] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, the access rights and waiting modes of each shared memory block are determined respectively according to the read and write requirements of different services for shared data, including: Determine the unique number corresponding to each shared memory block according to a preset order; In case that the shared memory block provided by the management interface is accessed, encapsulating and generating an access interface based on a unique number of the shared memory block; An access permission code and a waiting mode are set on the uniquely numbered access interface of the shared memory block; wherein the permission code includes: write permission and read permission, and the waiting mode includes: blocking mode and non-blocking mode.

[0011] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, after respectively determining the retention period and storage capacity of data in each shared memory block according to the setting mode of the shared memory block, the method further includes: Obtaining a dump location of a target shared memory block, and clearing data content of the dump location; The real-time data of the target shared memory block is compressed through the management interface, the compressed data is backed up to the dump location, and the data change instructions are recorded through the access interface; wherein the data change instructions include: adding, modifying and deleting data in the shared memory block.

[0012] According to a data storage and management method for a substation network message recording and analysis device provided by the present invention, after compressing the real-time data of the target shared memory block through the management interface, backing up the compressed data to the dump location, and recording the data change instruction through the access interface, the method further includes: Obtaining the backup start time and remaining dump capacity of the dump location; When the difference between the current time and the backup start time is greater than the retention period, and / or the remaining dump capacity is less than a preset capacity, stop recording data change instructions through the access interface; wherein the preset capacity is determined based on the storage capacity.

[0013] The present invention also provides a data storage and management device for a substation network message recording and analysis device, comprising the following modules: A loading module is used to load a predefined shared data model when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; an allocation module, configured to allocate a corresponding shared memory block to each of the plurality of shared data items according to the data structure of the shared data model, and to set the shared memory block in a preset manner; The storage management module is used to determine the access rights and waiting mode of each shared memory block according to the read and write requirements of different businesses for shared data, and to determine the retention period and storage capacity of the data in each shared memory block according to the setting method of the shared memory block; wherein the access rights and waiting mode are used to limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to manage the storage time and storage capacity of the data in the shared memory block.

[0014] 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 computer program, the method for storing and managing data used in a substation network message recording and analysis device as described in any one of the above-mentioned methods is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data storage and management method for a substation network message recording and analysis device as described in any one of the above.

[0016] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned data storage and management methods for a substation network message recording and analysis device.

[0017] The present invention provides a data storage and management method and device for a substation network message recording and analysis device, which loads a predefined shared data model when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; according to the data structure of the shared data model, a corresponding shared memory block is allocated to each shared data item in the multiple shared data items, and the shared memory block is set according to a preset method; the access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different services for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block. It can be seen from this that the substation network message recording and analysis device provided by the present invention can obtain the latest working status information and network messages of the equipment in a shorter time, ensure the timeliness of the data, and realize the efficient storage and management of shared data. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] 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.

[0019] Figure 1 It is a flow chart of a data storage and management method for a substation network message recording and analysis device provided by the present invention.

[0020] Figure 2 It is a complete flow chart of the data storage and management method for the substation network message recording and analysis device provided by the present invention.

[0021] Figure 3 It is a structural schematic diagram of a data storage and management device for a substation network message recording and analysis device provided by the present invention.

[0022] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] 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.

[0024] Combine the following Figure 1-Figure 4 The present invention describes a data storage and management method and device for a substation network message recording and analysis device.

[0025] Figure 1 : is a flow chart of a data storage and management method for a substation network message recording and analysis device provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 100: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to define multiple shared data items.

[0026] Figure 2 This is a complete flow chart of the data storage and management method for the substation network message recording and analysis device provided by the present invention. Figure 2 The data storage and management method for the substation network message recording and analysis device provided by the present invention is described.

[0027] It should be noted that the substation network message recording and analysis device is mainly used in smart substations to monitor, capture, analyze, store and count various network messages in the entire station in real time.

[0028] Before step 100, it is necessary to construct a data set and an operation set of a multi-process shared data model: that is, according to the data operation requirements of the substation network message recording and analysis device for each business, define the data set and operation set of the data sharing data model. Specifically, it includes: Step S110: define a shared data model between various business processes in the substation network message recording and analysis device, and define necessary information contained in each of the multiple shared data items in the shared data model.

[0029] Step S120: Determine an operation mode set for each shared data item in the multiple shared data items.

[0030] It should be noted that the operation mode set includes: a hash table hash, an ordered set zset and an unordered set set.

[0031] After step S120, the method further includes: In a case where it is determined that the operation mode set of the shared data item is a hash table hash access mode based on a first key attribute value, a hash storage index is allocated to the shared data item based on the first key attribute value; In the case where it is determined that the operation mode set of the shared data item is an ordered set zset access mode based on a second key attribute value, a sorted storage index is allocated to the shared data item based on the second key attribute value; When it is determined that the operation mode set of the shared data item is an unordered set set access mode and hash table hash access or ordered set zset access is not required, a hash storage index and a sorted storage index are not established.

[0032] Step S130: Inheriting the management interface of the shared memory block in the operation mode set of each shared data item; wherein the management interface includes: operation commands for creating, destroying, initializing, accessing and backing up the shared memory block.

[0033] In one embodiment, the above steps are described in detail.

[0034] 1) Define the shared data model between each business process of the substation network message recording and analysis device. The shared data model specifically includes: equipment management information, business process status information, message cache information, alarm information, self-test information, data analysis results, network message data, etc.

[0035] 2) Define the necessary information that each data item needs to contain in the shared data model, including the unique name of the shared data item, the maximum number of entries in the shared data, and the maximum capacity of a single shared data item.

[0036] 3) Count the set of operations required for each multi-process shared data, including hash table, ordered set zset and unordered set set.

[0037] 4) If the shared data needs to include a hash access method based on the key attribute value, a hash storage index is allocated based on the key attribute value.

[0038] 5) If a multi-process shared data needs to include an ordered set access method based on a key attribute value, a sorted storage index is allocated based on the key attribute value.

[0039] 6) If a multi-process shared data needs to include unordered set access methods and does not require hash or ordered set access, then hash index and sorted storage index are not created.

[0040] 7) In each multi-process shared data operation set, the shared memory block management interface is inherited: managed_shared_memory.

[0041] 8) The managed_shared_memory in step 7) contains five operation commands: creation, destruction, initialization, opening (access), and backup of shared memory blocks.

[0042] Step 200: allocate a corresponding shared memory block to each of the multiple shared data items according to the data structure of the shared data model, and set the shared memory block in a preset manner.

[0043] Specifically, step 200 includes: Step 210: Acquire the multiple shared data items and necessary information contained in each of the multiple shared data items.

[0044] Step 220: Allocate a corresponding shared memory block to each of the multiple shared data items through the management interface of the shared memory block.

[0045] Step 230: Set an access tag and a maximum storage capacity for each shared memory block respectively, and initialize each shared memory block through the management interface of the shared memory block.

[0046] In one embodiment, the above steps are described in detail.

[0047] 1) Obtain basic information of all multi-process shared data items, including the shared data item list described in the above embodiment and necessary information of each shared data item.

[0048] 2) Create a shared memory block for each multi-process shared data item through managed_shared_memory in the above embodiment.

[0049] 3) Shared memory block access label setting: Set a unique name for the shared data item for each shared memory block.

[0050] 4) Setting the maximum storage capacity of a shared memory block: The maximum storage capacity of each shared memory block is determined by the product of the maximum number of entries required to be stored and the maximum storage capacity required to store each entry.

[0051] 5) Shared memory block initialization: Set the initial value of each shared memory block to 0 through managed_shared_memory.

[0052] Step 300, determine the access rights and waiting mode of each shared memory block according to the read and write requirements of different businesses for shared data, and determine the retention period and storage capacity of the data in each shared memory block according to the setting method of the shared memory block; wherein the access rights and waiting mode are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0053] Specifically, in step 300, the access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different services for shared data, including: Step 310: Determine the unique number corresponding to each shared memory block according to a preset order.

[0054] Step 320: When the shared memory block provided by the management interface is accessed, encapsulate and generate an access interface based on the unique number of the shared memory block.

[0055] Step 330: Set an access permission code and a waiting mode on the uniquely numbered access interface of the shared memory block; wherein the permission code includes: write permission and read permission, and the waiting mode includes: blocking mode and non-blocking mode.

[0056] In one embodiment, the above steps are described in detail.

[0057] 1) Number all shared memory blocks in sequence.

[0058] 2) Bind the number to the corresponding shared memory block.

[0059] 3) Based on the shared memory block opening (access) provided by managed_shared_memory, an opening (access) interface operator_shared_memory based on the memory block number is encapsulated.

[0060] 4) Furthermore, an access permission code is added to the access interface operator_shared_memory. The permission code can be divided into write permission (WO) and read permission (RO).

[0061] 5) Furthermore, a waiting mode for access is added to the access interface operator_shared_memory. The waiting mode can be divided into blocking mode and non-blocking mode.

[0062] 6) Further, if the shared memory block needs to be accessed with read permission, operator_shared_memory will determine whether the write permission of the shared memory block is activated and whether there is a request for write permission.

[0063] 7) Further, if the write permission is not activated or there is no write permission request, the read permission is directly activated, and data is read after activation, and the read permission is released after the reading is completed; if the write permission is activated or there is a write permission request, the read operation mode is further determined.

[0064] 8) Further, if the read waiting mode is a non-blocking mode, the resource occupancy is returned; if the read mode is a blocking mode, the process waits until there is no write permission request and the write permission is released, and then returns to step 8) to continue execution.

[0065] 9) If the shared memory block needs to be accessed with write permission, operator_shared_memory will determine whether the shared memory block has write permission activated or read permission activated.

[0066] 10) Further, if the write permission is not activated and the read permission is not activated, the write permission is directly activated, data is written after activation, and the write permission is released after the writing is completed; if the write permission is activated or the read permission is activated, the read operation mode is further determined.

[0067] 11) Furthermore, if the waiting mode for writing is non-blocking mode, the resource occupancy is returned; if the reading mode is blocking mode, write permission is requested and waits until the write permission is released, data is written, and the write permission is released after the writing is completed.

[0068] Specifically, after respectively determining the retention period and storage capacity of the data in each shared memory block according to the setting mode of the shared memory block in step 300, the method further includes: Step 410: Obtain the dump location of the target shared memory block, and clear the data content of the dump location.

[0069] Step 420, compress the real-time data of the target shared memory block through the management interface, back up the compressed data to the dump location, and record the data change instructions through the access interface; wherein the data change instructions include: adding, modifying and deleting data in the shared memory block.

[0070] Step 430: Obtain the backup start time and remaining dump capacity of the dump location.

[0071] Step 440: When the difference between the current time and the backup start time is greater than the retention period, and / or the remaining dump capacity is less than a preset capacity, stop recording data change instructions through the access interface; wherein the preset capacity is determined based on the storage capacity.

[0072] In one embodiment, the above steps are described in detail.

[0073] 1) Set the configuration parameters for data dump, including the shared memory block number to be dumped, the dump location, the maximum dump period (i.e. the retention period mentioned above), and the maximum dump capacity (i.e. the storage capacity mentioned above).

[0074] 2) Empty everything already in the dump location.

[0075] 3) Further, it is determined through the read interface of operator_shared_memory whether the shared memory block has been created. If not, it is created and initialized according to the above embodiment.

[0076] 4) All real-time data of the specified shared memory block is compressed through managed_shared_memory, and the backup value dump location is backed up, and the backup start time is registered at the dump location.

[0077] 5) Furthermore, in operator_shared_memory, a data recording function is enabled for instructions involving data changes (including the addition, modification, and deletion of all or part of the data in the shared memory block).

[0078] 6) When operator_shared_memory receives a data change instruction, the data recording function stores the data change time, change source (reason), change range, and the changed content in the transfer storage location.

[0079] 7) Furthermore, when the remaining capacity for dumping is insufficient, the difference between the current time and the backup start time is greater than the longest period, or the recorder actively stops data recording, the data recording function is turned off.

[0080] The data storage and management method for the substation network message recording and analysis device provided by the embodiment of the present invention constructs a shared data model between business processes by decomposing the business relationship of the substation network message recording and analysis device, and instantiates relevant data elements in the shared memory; at the same time, the shared memory block is encapsulated through the read and write operations of the shared memory block to form an operation set of the business layer on the shared memory block, and on this basis, the shared memory block historical data is recorded by incremental storage. Through the data storage and management method for the substation network message recording and analysis device provided by the embodiment of the present invention, not only can the device record the historical status information of the device, but also can use the historical message information for simulation analysis, and reduce the number of times the substation network message recording and analysis device forwards the shared data of each business module, so as to realize the efficient storage and data synchronization of the substation network message recording and analysis device. And finally, the substation network message recording and analysis device can obtain the latest working status information and network message of the device in a shorter time, ensuring the timeliness of the data.

[0081] The above is a step description of the data storage and management method for the substation network message recording and analysis device provided by the present invention. From the description of the above steps, it can be seen that according to the data storage and management method for the substation network message recording and analysis device provided by the present invention, a predefined shared data model is loaded when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; according to the data structure of the shared data model, a corresponding shared memory block is allocated to each shared data item in the multiple shared data items, and the shared memory block is set according to a preset method; the access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different services for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access to the shared memory block by multiple processes, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block. It can be seen that the substation network message recording and analysis device provided by the present invention can obtain the latest working status information and network messages of the equipment in a shorter time, ensure the timeliness of the data, and realize the efficient storage and management of shared data.

[0082] The data storage and management device for the substation network message recording and analysis device provided by the present invention is described below. The data storage and management device for the substation network message recording and analysis device described below and the data storage and management method for the substation network message recording and analysis device described above can be referenced to each other.

[0083] Figure 3 Schematic diagram of the structure of the data storage and management device for substation network message recording and analysis device provided by the present invention, such as Figure 3 As shown, the data storage and management device for substation network message recording and analysis device provided by the present invention includes: The loading module 301 is used to load a predefined shared data model when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; An allocation module 302, configured to allocate a corresponding shared memory block to each of the plurality of shared data items according to the data structure of the shared data model, and to set the shared memory block in a preset manner; The storage management module 303 is used to determine the access rights and waiting mode of each shared memory block according to the read and write requirements of different businesses for shared data, and to determine the retention period and storage capacity of the data in each shared memory block according to the setting method of the shared memory block; wherein the access rights and waiting mode are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0084] The data storage and management device for the substation network message recording and analysis device provided by the present invention loads a predefined shared data model when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; according to the data structure of the shared data model, a corresponding shared memory block is allocated to each shared data item in the multiple shared data items, and the shared memory block is set according to a preset method; the access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different services for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block. It can be seen from this that the substation network message recording and analysis device provided by the present invention can obtain the latest working status information and network messages of the equipment in a shorter time, ensure the timeliness of the data, and realize the efficient storage and management of shared data.

[0085] Based on the above embodiment, in this embodiment, the device further includes a definition module, which is specifically used to: When the substation network message recording and analysis device meets the preset startup conditions, before loading the predefined shared data model, define the shared data model between each business process in the substation network message recording and analysis device, and define the necessary information contained in each of the multiple shared data items in the shared data model; Determine a set of operation modes for each shared data item in the plurality of shared data items; In the operation mode set of each shared data item, the management interface of the shared memory block is inherited; wherein the management interface includes: operation commands for creating, destroying, initializing, accessing and backing up the shared memory block.

[0086] Based on the above embodiment, in this embodiment, the operation mode set includes: a hash table hash, an ordered set zset and an unordered set set; The device also includes a determination module, specifically configured to: After determining the operation mode set of each shared data item in the plurality of shared data items, when it is determined that the operation mode set of the shared data item is a hash table hash access mode based on a first key attribute value, assigning a hash storage index to the shared data item based on the first key attribute value; In the case where it is determined that the operation mode set of the shared data item is an ordered set zset access mode based on a second key attribute value, a sorted storage index is allocated to the shared data item based on the second key attribute value; When it is determined that the operation mode set of the shared data item is an unordered set set access mode and hash table hash access or ordered set zset access is not required, a hash storage index and a sorted storage index are not established.

[0087] Based on the above embodiment, in this embodiment, the allocation module 302 is specifically used for: Acquire the plurality of shared data items and necessary information contained in each of the plurality of shared data items; Allocating a corresponding shared memory block to each of the multiple shared data items through the management interface of the shared memory block; An access tag and a maximum storage capacity are set for each shared memory block respectively, and each shared memory block is initialized through a management interface of the shared memory block.

[0088] Based on the above embodiment, in this embodiment, the allocation module 302 is specifically used for: Determine the unique number corresponding to each shared memory block according to a preset order; In case that the shared memory block provided by the management interface is accessed, encapsulating and generating an access interface based on a unique number of the shared memory block; An access permission code and a waiting mode are set on the uniquely numbered access interface of the shared memory block; wherein the permission code includes: write permission and read permission, and the waiting mode includes: blocking mode and non-blocking mode.

[0089] Based on the above embodiment, in this embodiment, the device further includes a dump module, which is specifically used to: After respectively determining the retention period and storage capacity of the data in each shared memory block according to the setting mode of the shared memory block, obtaining the dump location of the target shared memory block, and clearing the data content of the dump location; The real-time data of the target shared memory block is compressed through the management interface, the compressed data is backed up to the dump location, and the data change instructions are recorded through the access interface; wherein the data change instructions include: adding, modifying and deleting data in the shared memory block.

[0090] Based on the above embodiment, in this embodiment, the dump module is specifically used for: The real-time data of the target shared memory block is compressed through the management interface, the compressed data is backed up to the dump location, and after the data change instruction is recorded through the access interface, the backup start time and the remaining dump capacity of the dump location are obtained; When the difference between the current time and the backup start time is greater than the retention period, and / or the remaining dump capacity is less than a preset capacity, stop recording data change instructions through the access interface; wherein the preset capacity is determined based on the storage capacity.

[0091] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may be a robot or other electronic device, and the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the data storage and management method for the substation network message recording and analysis device, including: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to: define multiple shared data items; According to the data structure of the shared data model, a corresponding shared memory block is allocated to each of the multiple shared data items, and the shared memory block is set according to a preset method; The access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different businesses for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0092] In addition, the logic instructions in the above-mentioned memory 430 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 this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of 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.

[0093] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the data storage and management method for the substation network message recording and analysis device provided by the above methods, including: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to: define multiple shared data items; According to the data structure of the shared data model, a corresponding shared memory block is allocated to each of the multiple shared data items, and the shared memory block is set according to a preset method; The access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different businesses for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0094] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to execute the data storage and management method for the substation network message recording and analysis device provided by the above methods, including: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to: define multiple shared data items; According to the data structure of the shared data model, a corresponding shared memory block is allocated to each of the multiple shared data items, and the shared memory block is set according to a preset method; The access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different businesses for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

[0095] 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.

[0096] 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, 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.

[0097] 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 data storage and management method for a substation network message recording and analysis device, characterized in that: include: When the substation network message recording and analysis device meets the preset startup conditions, a predefined shared data model is loaded; wherein the shared data model is used to: define multiple shared data items; According to the data structure of the shared data model, a corresponding shared memory block is allocated to each of the multiple shared data items, and the shared memory block is set according to a preset method; The access rights and waiting modes of each shared memory block are determined according to the read and write requirements of different businesses for shared data, and the retention period and storage capacity of the data in each shared memory block are determined according to the setting method of the shared memory block; wherein the access rights and waiting modes are used to: limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to: manage the storage time and storage capacity of the data in the shared memory block.

2. The data storage and management method for substation network message recording and analysis device according to claim 1, characterized in that: When the substation network message recording and analysis device meets the preset startup conditions, before loading the predefined shared data model, the method further includes: Defining a shared data model between various business processes in the substation network message recording and analysis device, and defining necessary information contained in each of the multiple shared data items in the shared data model; Determine a set of operation modes for each shared data item in the plurality of shared data items; In the operation mode set of each shared data item, the management interface of the shared memory block is inherited; wherein the management interface includes: operation commands for creating, destroying, initializing, accessing and backing up the shared memory block.

3. The data storage and management method for substation network message recording and analysis device according to claim 2 is characterized in that: The operation mode set includes: hash table hash, ordered set zset and unordered set set; After determining the operation mode set of each shared data item in the plurality of shared data items, the method further includes: In a case where it is determined that the operation mode set of the shared data item is a hash table hash access mode based on a first key attribute value, a hash storage index is allocated to the shared data item based on the first key attribute value; In the case where it is determined that the operation mode set of the shared data item is an ordered set zset access mode based on a second key attribute value, a sorted storage index is allocated to the shared data item based on the second key attribute value; When it is determined that the operation mode set of the shared data item is an unordered set set access mode and hash table hash access or ordered set zset access is not required, a hash storage index and a sorted storage index are not established.

4. The data storage and management method for substation network message recording and analysis device according to claim 2 is characterized in that: The method of allocating a corresponding shared memory block to each of the multiple shared data items according to the data structure of the shared data model, and setting the shared memory block in a preset manner includes: Acquire the plurality of shared data items and necessary information contained in each of the plurality of shared data items; Allocating a corresponding shared memory block to each of the multiple shared data items through the management interface of the shared memory block; An access tag and a maximum storage capacity are set for each shared memory block respectively, and each shared memory block is initialized through a management interface of the shared memory block.

5. The data storage and management method for substation network message recording and analysis device according to claim 4 is characterized in that: Determining the access rights and waiting mode of each shared memory block according to the read and write requirements of different services on shared data includes: Determine the unique number corresponding to each shared memory block according to a preset order; In case that the shared memory block provided by the management interface is accessed, encapsulating and generating an access interface based on a unique number of the shared memory block; An access permission code and a waiting mode are set on the uniquely numbered access interface of the shared memory block; wherein the permission code includes: write permission and read permission, and the waiting mode includes: blocking mode and non-blocking mode.

6. The data storage and management method for substation network message recording and analysis device according to claim 5, characterized in that: After respectively determining the retention period and storage capacity of the data in each shared memory block according to the setting mode of the shared memory block, the method further includes: Obtaining a dump location of a target shared memory block, and clearing data content of the dump location; The real-time data of the target shared memory block is compressed through the management interface, the compressed data is backed up to the dump location, and the data change instructions are recorded through the access interface; wherein the data change instructions include: adding, modifying and deleting data in the shared memory block.

7. The data storage and management method for substation network message recording and analysis device according to claim 6, characterized in that: After compressing the real-time data of the target shared memory block through the management interface, backing up the compressed data to the dump location, and recording the data change instruction through the access interface, the method further includes: Obtaining the backup start time and remaining dump capacity of the dump location; When the difference between the current time and the backup start time is greater than the retention period, and / or the remaining dump capacity is less than a preset capacity, stop recording data change instructions through the access interface; wherein the preset capacity is determined based on the storage capacity.

8. A data storage and management device for a substation network message recording and analysis device, characterized in that: include: A loading module is used to load a predefined shared data model when the substation network message recording and analysis device meets the preset startup conditions; wherein the shared data model is used to: define multiple shared data items; an allocation module, configured to allocate a corresponding shared memory block to each of the plurality of shared data items according to the data structure of the shared data model, and to set the shared memory block in a preset manner; The storage management module is used to determine the access rights and waiting mode of each shared memory block according to the read and write requirements of different businesses for shared data, and to determine the retention period and storage capacity of the data in each shared memory block according to the setting method of the shared memory block; wherein the access rights and waiting mode are used to limit and manage the access of multiple processes to the shared memory block, and the retention period and storage capacity are used to manage the storage time and storage capacity of the data in the shared memory block.

9. 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 computer program, it implements the data storage and management method for the substation network message recording and analysis device as described in any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the data storage and management method for the substation network message recording and analysis device as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Fast transmission method for shared data between processes

    CN106126359A

  • Method for communication between courses, storage medium and computer equipment

    CN107229530A

  • Data processing method and device, server and storage medium

    CN112306369A

  • Method and device for managing and controlling authority of shared memory

    CN116775324A

  • Access control method and apparatus for shared memory, electronic device and autonomous vehicle

    US20230120580A1