Real-time Database Parameter Section Update Method and Device for Power Automation Monitoring System

By designing a multi-version data storage structure and process transaction lock mechanism in the relational database of the power automation monitoring system, the problems of low parameter modification efficiency and incomplete data in traditional systems are solved, and efficient and stable parameter updates and stable operation of real-time databases are achieved.

CN115576963BActive Publication Date: 2025-06-17GUODIAN NANJING AUTOMATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211107850.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-13
Publication Date
2025-06-17
Estimated Expiration
2042-09-13

AI Technical Summary

Technical Problem

Traditional power automation monitoring systems are inefficient when modifying parameters and are prone to errors and missed repairs, resulting in incomplete grid model parameters in the real-time database, affecting the stable operation of the system.

Method used

A real-time database parameter section update method is adopted for power automation monitoring system. By designing a multi-version data storage structure and process transaction lock mechanism in a relational database, the parameter modification operation is recorded in the incremental registration table, and the parameter data in the real-time database is updated according to the version number.

Benefits of technology

It realizes the efficiency and integrity of parameter modification, ensures the stability and consistency of parameter data in real-time database, and improves the reliability and security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115576963B_ABST
    Figure CN115576963B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for real-time database parameter section update of a power automation monitoring system, which includes: storing the power automation monitoring system parameter data into a relational database according to a predefined version data storage structure; when the system parameters in the relational database are modified, recording the parameter modification operation into an incremental registration form; according to the parameter version creation request, saving the parameter modification operation in the incremental registration form as a parameter section with a unique version number through a process transaction lock mechanism; updating the parameter section content in the relational database to the real-time database according to the version number and the predefined version data storage structure. The present invention can update the real-time database parameters of the power automation monitoring system by version safely, controllably and efficiently, improve the integrity and stability of the parameters in the real-time database, and ensure the stable operation of the monitoring system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method and device for updating parameter sections of a real-time database in a power automation monitoring system, and belongs to the technical field of power automation monitoring. Background Art

[0002] A power automation monitoring system is a basic platform for real-time data acquisition, switch status monitoring and remote control of a power supply and distribution system, and plays a core role in ensuring the reliability, safety, real-time performance, usability and compatibility of the power supply and distribution system. Currently, power automation monitoring systems generally adopt an architecture that combines a relational database and a real-time database. The relational database is used to store non-real-time data such as power grid models, management models, and historical data. The real-time database, as a high-speed cache of the relational database, stores information such as power grid models, management models, and real-time acquired data in memory to improve the operation speed of the monitoring system. The power grid model parameters are in one-to-one correspondence in the relational database and the real-time database. Core functions of the monitoring system such as real-time data acquisition and alarm push are based on the real-time database. Therefore, the stability of the real-time database is the key to the stable operation of the monitoring system.

[0003] In traditional power automation monitoring systems, every time a configuration parameter is changed, the same modification is made in both the relational database and the real-time database. However, in many cases, parameter modification requirements do not only involve a single parameter. For example, adding a substation or a distribution terminal to the power grid model requires a series of parameter adjustments and takes a certain amount of time to complete. If the traditional parameter modification method is used, the parameter modification efficiency is low, and it is easy to make incorrect or missed modifications. Incomplete parameters may appear in the power grid model of the real-time database. In addition, the parameters mismodified by users in this way are also forced to take effect in the real-time database, which is not conducive to the stable operation of the power automation monitoring system and may directly damage the reliability and safety of the power distribution system at the operation and maintenance level. Summary of the Invention

[0004] In view of the problems existing in the prior art, the present invention proposes a method and device for updating parameter sections of a real-time database in a power automation monitoring system, stores parameter modifications of the power automation monitoring system by version, and updates parameter data in the real-time database to ensure the integrity and reliability of each data update.

[0005] To solve the above technical problems, the present invention adopts the following technical means:

[0006] In a first aspect, the present invention proposes a method for updating parameter sections of a real-time database in a power automation monitoring system, including the following steps:

[0007] Store power automation monitoring system parameter data in a relational database according to a predefined version data storage structure;

[0008] When the system parameters in the relational database are modified, record the parameter modification operation in the incremental registration form;

[0009] Create a request according to the parameter version, and save the parameter modification operation in the incremental registration form as a parameter section with a unique version number through the process transaction lock mechanism;

[0010] Update the parameter section content in the relational database to the real-time database according to the version number and the predefined version data storage structure.

[0011] Combined with the first aspect, further, the predefined version data storage structure includes an object table, a historical object table, a relationship table, a historical relationship table, an incremental registration form, a historical incremental registration form, and a historical version table. Among them, each object table corresponds to a historical object table, and each relationship table corresponds to a historical relationship table; the object table is used to store object data in the power automation monitoring system parameters, and the object data includes an object primary key ID and an object type; the relationship table is used to store relationship data in the power automation monitoring system parameters, and the relationship data includes an object primary key ID, a relationship type, and an associated relationship object; the historical object table is used to store object data in the power automation monitoring system parameters and its corresponding version number; the historical relationship table is used to store relationship data in the power automation monitoring system parameters and its corresponding version number; the incremental registration form includes an object primary key ID, a modification type, and an object type; each historical incremental registration form corresponds to a parameter section, and the historical incremental registration form includes the object primary key ID, modification type, and object type corresponding to the parameter section. The suffix of the table name of the historical incremental registration form adopts the version number of the parameter section; the historical version table includes a version number, a version producer, and a version creation time.

[0012] Combined with the first aspect, further, the method of saving the parameter modification operation in the incremental registration form as a parameter section with a unique version number through the process transaction lock mechanism according to the parameter version creation request is as follows:

[0013] Obtain the parameter version creation request;

[0014] Enable the process transaction lock;

[0015] Add 1 to the maximum version number existing in the relational database as the new version number to be created;

[0016] Create a historical incremental registration form with the suffix of the new version number in the relational database;

[0017] Obtain the parameter modification operations during the period from the current moment to the end moment of the creation of the previous parameter version from the incremental registration form, and store the corresponding object primary key, modification type, and object type into the historical incremental registration form with the new version number;

[0018] According to the historical incremental registration form, obtain the object records and relationship records from the object table and relationship table of the relational database respectively. Combine the object records with the new version number and store them into the historical object table, and combine the relationship records with the new version number and store them into the historical relationship table;

[0019] Insert the new version number, version producer, and version creation time into the historical version table to obtain the parameter section;

[0020] Close the process transaction lock.

[0021] Combined with the first aspect, further, the opening of the process transaction lock means: using the table-level lock function to lock the incremental registration form in a relational database session; the closing of the process transaction lock means: when the parameter section is obtained, in the same relational database session where the process transaction lock is opened, empty the incremental registration form and release the table-level lock function.

[0022] Combined with the first aspect, further, the method for updating the parameter section content in the relational database to the real-time database is as follows:

[0023] Obtain the version number to be updated;

[0024] Obtain the parameter section content from the historical incremental registration form, historical object table, and historical relationship table of the relational database according to the version number;

[0025] Update the data of the same parameters in the real-time database one by one according to the parameter section content.

[0026] Combined with the first aspect, further, when the real-time database reads the data of the specified version number in the relational database, batch and parallelly read the parameter section content corresponding to the version number from the historical object table and historical relationship table respectively according to the object type and relationship type, and obtain the parameter data of the power automation monitoring system corresponding to this version; when the relational database generates a new parameter section, batch and parallelly obtain the record data from the object table and relationship table respectively according to the object type and relationship type, and write them into the historical object table and historical relationship table.

[0027] In the second aspect, the present invention proposes a device for updating the parameter section of the real-time database of a power automation monitoring system, including:

[0028] A structured storage module for storing the parameter data of the power automation monitoring system into the relational database according to a predefined version data storage structure;

[0029] An incremental registration module, which is used to record parameter modification operations in an incremental registration table when system parameters in the relational database are modified;

[0030] A parameter section module, which is used to create a request according to the parameter version, and save the parameter modification operations in the incremental registration table as a parameter section with a unique version number through a process transaction lock mechanism;

[0031] A parameter section update module, which is used to update the parameter section content in the relational database to the real-time database according to the version number and a predefined version data storage structure.

[0032] Combined with the second aspect, further, the predefined version data storage structure includes an object table, a historical object table, a relationship table, a historical relationship table, an incremental registration table, a historical incremental registration table, and a historical version table. Among them, each object table corresponds to a historical object table, and each relationship table corresponds to a historical relationship table; the object table is used to store object data in the power automation monitoring system parameters; the relationship table is used to store relationship data in the power automation monitoring system parameters; the historical object table is used to store object data in the power automation monitoring system parameters and its corresponding version number; the historical relationship table is used to store relationship data in the power automation monitoring system parameters and its corresponding version number; the incremental registration table includes an object primary key ID, a modification type, and an object type; each historical incremental registration table corresponds to a parameter section, and the historical incremental registration table includes the object primary key ID, modification type, and object type corresponding to the parameter section. The suffix of the table name of the historical incremental registration table adopts the version number of the parameter section; the historical version table includes a version number, a version producer, and a version creation time.

[0033] Combined with the second aspect, further, the operations of the parameter section module are as follows:

[0034] Obtain a parameter version creation request;

[0035] Enable a process transaction lock;

[0036] Add 1 to the maximum version number existing in the relational database as the new version number to be created;

[0037] Create a historical incremental registration table with a table name suffix of the new version number in the relational database;

[0038] Obtain the parameter modification operations during the current moment to the end moment of the previous parameter version creation from the incremental registration table, and store the corresponding object primary key, modification type, and object type into the historical incremental registration table with the new version number;

[0039] According to the historical increment registration form, obtain object records and relationship records from the object table and relationship table of the relational database respectively. Combine the object records with the new version number and store them in the historical object table, and combine the relationship records with the new version number and store them in the historical relationship table;

[0040] Insert the new version number, version producer, and version creation time into the historical version table to obtain a parameter section;

[0041] Close the process transaction lock.

[0042] In combination with the second aspect, further, the opening of the process transaction lock means: using the table-level lock function to lock the increment registration form in a relational database session; the closing of the process transaction lock means: when the parameter section is obtained, in the same relational database session where the process transaction lock is opened, empty the increment registration form and release the table-level lock function.

[0043] After adopting the above technical means, the following advantages can be obtained:

[0044] The present invention proposes a method and device for updating the parameter section of the real-time database of a power automation monitoring system. Through the storage structure design in the relational database, the parameter data modified in the relational database can be stored according to the version number. The real-time database reads the parameter data in the relational database according to the version number and updates the data. Since different version numbers distinguish tables and records, the creation of the newly modified parameter version and the access to the existing parameter versions can be completed in parallel, realizing the read-write separation of version data, which is beneficial to improving the parameter modification efficiency. At the same time, the present invention uses the table-level lock function of the relational database to make the creation process of version data have transactional characteristics, so that the version data is either created completely or not created at all, ensuring that the real-time database can only obtain complete parameter versions, and improving the integrity and stability of the parameters in the real-time database.

[0045] The present invention solves the need for a one-time and aggregated update of the parameters of the real-time database in the power automation monitoring system, and the update process is both efficient and safe, ensuring the stable operation of the real-time state of the automation monitoring system. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a step flow chart of a method for updating the parameter section of the real-time database of a power automation monitoring system according to the present invention;

[0047] Figure 2 It is a structural schematic diagram of a device for updating the parameter section of the real-time database of a power automation monitoring system according to the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0048] The technical solution of the present invention will be further described below in conjunction with the accompanying drawings:

[0049] Example 1:

[0050] The present invention proposes a method for updating the parameter section of a real-time database in a power automation monitoring system, as Figure 1 shown, which includes the following steps:

[0051] Step A: Store the parameter data of the power automation monitoring system into the relational database according to the predefined version data storage structure.

[0052] The present invention designs a multi-version data storage structure in the relational database that can store a series of modification contents of the monitoring system parameters, namely the predefined version data storage structure. This structure includes an object table, a historical object table, a relationship table, a historical relationship table, an increment registration table, a historical increment registration table, and a historical version table. Using these specific table structures can decouple the reading and writing of version data.

[0053] Generally, the parameters of the monitoring system are divided into object data and relationship data in the relational database. Among them, the object data is further divided into different object type data, and the relationship data includes the relationships between different object type data. The object data and relationship data are stored in the object table and the relationship table respectively. Specifically, the object data in the object table includes content such as the object primary key ID and object type, and the relationship data in the relationship table includes content such as the object primary key ID, relationship type, and related relationship object. In the relational database, each object table has a corresponding historical object table, and each relationship table also has a corresponding historical relationship table. Compared with the object table, the table structure of the historical object table has one more version number field than the table structure of the object table. Compared with the relationship table, the table structure of the historical relationship table has one more version number field than the table structure of the relationship table. The historical object table and the historical relationship table are mainly used to store version data.

[0054] The increment registration table is used to record the parameter modification contents in the relational database, specifically including the object primary key ID, modification type, and object type. Among them, the modification type can be further divided into: addition, deletion, and attribute modification. The modifiable attributes include the attributes in the object table and the relationship attributes of the object in the relationship table. Each historical increment registration table corresponds to a parameter section. The table structure of the historical increment registration table is the same as that of the increment registration table, including the object primary key ID, modification type, and object type corresponding to the parameter section. The suffix of the table name of the historical increment registration table uses the version number of the parameter section.

[0055] The fields of the historical version table include version number, version producer, and version creation time.

[0056] When the electric power automation monitoring system is started for the first time, the parameter data in its relational database and real-time database remain consistent and generate an initial version number 1. During the subsequent system operation, whenever the parameters in the relational database are modified, the user can choose to start the parameter version creation process, which will save the parameter modification content in the relational database as a parameter section with a unique version number and store it in the historical incremental registration table, historical object table, and historical relationship table. Finally, the real-time database obtains the section parameter content from the relational database according to the version number, which is used to update the real-time library parameter section data and realize the data unification of the two databases.

[0057] Step B: The present invention proposes a set of parallel and batch version data creation and reading methods, so that the version data can be efficiently maintained. When the system parameters in the relational database are modified, incremental registration is performed, and the parameter modification operation is recorded in the incremental registration table.

[0058] In an embodiment of the present invention, the records of all modified objects are stored in the same incremental registration table, and the record of any object primary key ID only appears once in the incremental registration table. If an object is added, a new object registration is immediately made in the incremental registration table. Thereafter, before a new version is created, no additional registration will be made for the modification of the attributes of the object. If the object is deleted thereafter, the registration information of the object will be deleted from the incremental registration table. When deleting a non-newly added object, before a new version is created, if the object has had its attributes modified, it is necessary to delete the attribute modification registration of the object in the incremental registration table, and then add a deletion object registration. If the object has not been modified, a deletion registration is directly added to the incremental registration table. When modifying the attributes of an object, if the incremental registration table does not contain a record of the object's primary key ID, a record containing the object's primary key ID will be added. Before a new version is created, each object in the relational database can be modified multiple times, but is only registered once. In this way, all objects whose attributes are added, deleted or modified during the entire parameter modification process will be fully and uniquely registered in the incremental registration table. When subsequent versions are created, the final result data of the modified objects will be stored in the new version data.

[0059] Step C: according to the parameter version creation request, the parameter modification operation in the incremental registration table is saved as a parameter section with a unique version number through the process transaction lock mechanism.

[0060] Step C01: Obtain a parameter version creation request. A user modifies configuration parameters in the electric power automation monitoring system, and after completing the modification at the current stage, can choose to create a new parameter version and generate a parameter version creation request.

[0061] Step C02. Open the process transaction lock: Create a relational database session. In this relational database session, use the table-level lock function to lock the incremental registration table, blocking all parameter modification operations in the relational database. This session is called the lock table session.

[0062] Step C03. Obtain the maximum version number existing in the relational database (historical version table) at the current moment, and add 1 to the current maximum version number as the new version number to be created.

[0063] Step C04. Create a historical incremental registration table in the relational database with the new version number as the table name suffix.

[0064] Step C05. Obtain the parameter modification operations during the period from the current moment to the end time of the previous parameter version creation from the incremental registration table, and store the corresponding object primary key, modification type, and object type into the historical incremental registration table with the new version number. Specifically, create a relational database session. In the session, use the SQL statement in the form of "CREATE TABLE AS SELECT" to transfer the information in the incremental registration table to the corresponding historical incremental registration table. This session is called the main session.

[0065] Step C06. According to the historical incremental registration table, obtain the object records and relationship records from the object table and relationship table in the relational database respectively. Combine the object records with the new version number and store them into the historical object table, and combine the relationship records with the new version number and store them into the historical relationship table. Specifically, in the main session, query the corresponding object records from the object table according to the object type and object primary key in the historical incremental registration table. Divide the object records into two categories: those with the modification type of addition or attribute modification are in one category, called non-deletion category, and those with the modification type of deletion are in the other category, called deletion category; use the SQL statement in the form of "INSERT INTO SELECT" to transfer the non-deletion category object records from the object table to the corresponding historical object table, and transfer the relationship records corresponding to these objects from the relationship table to the corresponding historical relationship table. The version number fields of these transferred records are all filled with the new version number. In Step C06, each object type corresponds to a relational database session, and all the relationship data of all object types correspond to one relational database session, and the transfer process is executed in batches.

[0066] Step C07. Obtain the version producer (user) and version creation time according to the parameter version creation request, and insert a version record with the new version number into the historical version table, that is, the new version number, version producer, and version creation time, complete the parameter version creation, and obtain a new parameter section.

[0067] Step C08. Close the process transaction lock: In the same relational database session where the process transaction lock is opened (i.e., the lock table session corresponding to Step C02), clear the incremental registration table and release the table-level lock function. These operations are completed within one transaction.

[0068] Step D. Update the parameter cross-section content in the relational database to the real-time database according to the version number and the predefined version data storage structure.

[0069] Step D01. Obtain the version number to be updated.

[0070] Step D02. Obtain the parameter cross-section content from the historical incremental registration table, historical object table, and historical relationship table in the relational database according to the version number. The parameter content includes the updated object data and relationship data.

[0071] Step D03. Update the data of the same parameters in the real-time database one by one according to the parameter cross-section content to ensure that the parameter data in the real-time database is exactly the same as the parameter data in the parameter cross-section (latest version) of the relational database.

[0072] Distinguish according to the object type and modification type recorded in the historical incremental registration table of the new version number. Delete the object data with the same primary key ID in the real-time database according to the primary key ID of the deletion type object, create an object with the same primary key ID in the real-time database according to the primary key ID of the creation type object, and modify the object with the same primary key ID in the real-time database according to the primary key ID of the modification type object. The written content of the object data and relationship data of the creation and modification type objects is consistent with the recorded data corresponding to the new version number in the historical object table and historical relationship table.

[0073] In the embodiment of the present invention, an efficient version data reading and writing method is adopted:

[0074] When the real-time database reads the data of the specified version number in the relational database, batch and parallelly read the parameter cross-section content corresponding to the version number from the historical object table and historical relationship table respectively according to the object type and relationship type, and obtain the parameter data of the power automation monitoring system corresponding to this version. Among them, batch reading of data means that no matter how many modified objects there are in a certain object type in the version data, only one SQL statement is executed on the corresponding historical object table to query and obtain all records of the same type of objects, without querying one by one according to the object primary key ID.

[0075] When the relational database generates a new parameter cross-section, batch and parallelly obtain the record data from the object table and relationship table respectively according to the object type and relationship type, and write them into the historical object table and historical relationship table.

[0076] Embodiment 2:

[0077] A real-time database parameter section update method for a power automation monitoring system based on transactional version management, comprising the following steps:

[0078] (1) The initial parameter section of the real-time database is kept consistent with the parameter section of the relational database, and the version numbers of the initial parameter sections of the relational database and the real-time database are 1.

[0079] (2) Make the following modifications to the parameters in the relational database in the power automation monitoring system: Modify the attributes of 50 telemetry points, and the object primary key IDs in the corresponding telemetry object table are telemetry ID1, telemetry ID2,..., telemetry ID50; Delete 10 telemetry points, and the IDs in the corresponding telemetry object table are telemetry ID51, telemetry ID52,..., telemetry ID60; Create 100 telemetry points, and the IDs in the corresponding telemetry object table are telemetry ID61, telemetry ID62,..., telemetry ID160; Modify the attributes of 100 telemetry signal points, and the IDs in the corresponding telemetry signal object table are telemetry signal ID1, telemetry signal ID2,..., telemetry signal ID100; Delete 5 telemetry signal points, and the IDs in the corresponding telemetry signal object table are telemetry signal ID101, telemetry signal ID102,..., telemetry signal ID105, and create 10 telemetry signal points, and the IDs in the corresponding telemetry signal object table are: telemetry signal ID106, telemetry signal ID107,..., telemetry signal ID115. All the above object primary key IDs, object types, and modification types (addition, deletion, modification) are recorded in the incremental registration form during the modification process.

[0080] (3) Create a relational database session, and use the table-level lock function of the relational database to lock the incremental registration form in the session. This session is called the lock table session.

[0081] (4) Create another relational database session. In this session, obtain the current parameter version number as 1, then the newly created version number should be 2; Use the SQL statement of the CREATE TABLE AS SELECT clause to transfer all the records in the incremental registration form (i.e., the modification process in step (2)) to a newly created historical incremental registration form 2. This session is called the main session.

[0082] (5) Classify the records in the historical increment registration form 2 in the backbone statement according to the object type and modification type: First, classify them into telemetry and teleindication according to the object type; for the telemetry type, divide the telemetry points into non-deleted and deleted types. Among them, the non-deleted type includes the modified and created telemetry object points, that is, telemetry ID1, telemetry ID2,..., telemetry ID50 and telemetry ID61, telemetry ID62,..., telemetry ID160, and the deleted type includes the deleted telemetry object points, that is, telemetry ID51, telemetry ID52,..., telemetry ID60; for the teleindication type, divide the teleindication points into non-deleted and deleted types. The non-deleted type includes the modified and created teleindication object points, that is, teleindication ID1, teleindication ID2,..., teleindication ID100 and teleindication ID106, teleindication ID107,..., teleindication ID115, and the deleted type includes the deleted teleindication object points, that is, teleindication ID101, teleindication ID102,..., teleindication ID105.

[0083] (6) According to the classification results in step (5), create three database sessions. In the first session, transfer the records of non-deleted telemetry points from the telemetry object table to the corresponding historical telemetry table and the version number fields of the relevant records are all 2. In the second session, transfer the records of non-deleted teleindication points from the teleindication object table to the corresponding historical teleindication table and the version number fields of the relevant records are all 2. In the third session, transfer the relationship data of non-deleted telemetry points and non-deleted teleindication points from the relationship table to the historical relationship table. These three processes are carried out concurrently and completed in batches using SQL statements in the INSERT INTO SELECT format.

[0084] (7) In the lock table session, add a new version information record with version number 2 to the historical version table, empty the increment registration form, and release the table-level lock. This process is completed in a transaction.

[0085] (8) Update the real-time database to version 2 for the parameter section. Delete the object points classified as the deletion type in the historical increment registration form 2 in the real-time database. Batch read all non-deleted telemetry records with version number 2 from the historical telemetry table, batch read all non-deleted teleindication records with version number 2 from the historical teleindication table, and batch read all relationship records of non-deleted telemetry points and non-deleted teleindication points with version number 2 from the historical relationship table. The newly created points in the version section are created in the real-time database and the attribute values are written according to the read object data and relationship data. The newly modified points in the version section are written with the attribute values according to the read object data and relationship data in the real-time database. After this process is completed, record the real-time database version number as 2, indicating that the real-time database has completed the update from parameter section 1 to parameter section 2.

[0086] Example 3:

[0087] The present invention also provides a real-time database parameter section update device for a power automation monitoring system, as Figure 2 shown, which includes a structured storage module, an incremental registration module, a parameter section module, and a parameter section update module.

[0088] The structured storage module is mainly used to store the power automation monitoring system parameter data into a relational database according to a predefined version data storage structure.

[0089] In the embodiment of the present invention, the predefined version data storage structure includes an object table, a historical object table, a relationship table, a historical relationship table, an incremental registration table, a historical incremental registration table, and a historical version table. Among them, each object table corresponds to a historical object table, and each relationship table corresponds to a historical relationship table; the object table is used to store the object data in the power automation monitoring system parameters; the relationship table is used to store the relationship data in the power automation monitoring system parameters; the historical object table is used to store the object data in the power automation monitoring system parameters and its corresponding version number; the historical relationship table is used to store the relationship data in the power automation monitoring system parameters and its corresponding version number; the incremental registration table includes an object primary key ID, a modification type, and an object type; each historical incremental registration table corresponds to a parameter section, and the historical incremental registration table includes the object primary key ID, modification type, and object type corresponding to the parameter section. The suffix of the table name of the historical incremental registration table adopts the version number of the parameter section; the historical version table includes a version number, a version producer, and a version creation time.

[0090] The incremental registration module is mainly used to record the parameter modification operation into the incremental registration table when the system parameters in the relational database are modified.

[0091] The parameter section module is mainly used to save the parameter modification operation in the incremental registration table as a parameter section with a unique version number through a process transaction lock mechanism according to a parameter version creation request.

[0092] The specific operation of the parameter section module is as follows:

[0093] Obtain a parameter version creation request; Start a process transaction lock: Use the table-level lock function in a relational database session to lock the incremental registration table; Add 1 to the maximum version number existing in the relational database as the new version number to be created; Create a historical incremental registration table in the relational database with the table name suffixed with the new version number; Obtain the parameter modification operations during the period from the current moment to the end moment of the previous parameter version creation from the incremental registration table, and store the corresponding object primary key, modification type, and object type into the historical incremental registration table with the new version number; According to the historical incremental registration table, obtain object records and relationship records from the object table and relationship table in the relational database respectively, combine the object records with the new version number and store them into the historical object table, and combine the relationship records with the new version number and store them into the historical relationship table; Insert the new version number, version producer, and version creation time into the historical version table to obtain a parameter section; Close the process transaction lock: After obtaining the parameter section, in the same relational database session where the process transaction lock was started, clear the incremental registration table and release the table-level lock function.

[0094] In the parameter section module, according to the object type and object primary key in the historical incremental registration table, query the corresponding object records from the object table. Divide the object records into two categories: Those with the modification type of addition or attribute modification are classified into one category, called non-deletion category, and those with the modification type of deletion are classified into another category, called deletion category; Use the SQL statement of the INSERT INTO SELECT clause to transfer the non-deletion category object records from the object table to the corresponding historical object table, and transfer the corresponding relationship records from the relationship table to the corresponding historical relationship table. Fill the version number field of these transferred records with the new version number.

[0095] The parameter section update module is mainly used to update the parameter section content in the relational database to the real-time database according to the version number and the predefined version data storage structure. Distinguish according to the object type and modification type recorded in the historical incremental registration table with the new version number. Delete the object data with the same primary key ID in the real-time database according to the primary key ID of the deletion type object, create an object with the same primary key ID in the real-time database according to the primary key ID of the creation type object, modify the object with the same primary key ID in the real-time database according to the primary key ID of the modification type object. The written content of the object data and relationship data of the creation and modification type objects is consistent with the record data corresponding to the new version number in the historical object table and historical relationship table.

[0096] In view of the prior art, the parameters of the real-time library are updated in a manner that the corresponding parameters are modified immediately in the real-time library after each relationship library parameter is modified. As a result, when a series of relationship library parameter modifications are required, the real-time library may be operated in an unexpected and unstable parameter section. In addition, when the user accidentally modifies a relationship library parameter by mistake, the real-time library immediately follows with an erroneous parameter modification. This deviated from the expected and unstable real-time library section state may last for days or even weeks, which is not conducive to the real-time operation of the automatic monitoring system and reduces the reliability and security of the system. The present invention proposes a new parameter section management method, which waits for a series of relationship library parameter modifications or erroneous parameters to be corrected, and then collectively updates the modified parameters to the real-time library in the form of sections, so that the real-time library can directly transition from one complete section to another. The present invention designs a version data storage structure and a process transaction lock mechanism, which not only ensures that the reading of the old version parameter section data and the writing of the new version parameter section data can be performed concurrently and in batches, but also makes the creation process of the new version parameter section have transactional characteristics, that is, the new version parameter section is either completely generated or not generated, which effectively avoids the risk of incomplete parameter sections being updated to the real-time library. The entire real-time library parameter update process has both efficiency and security, ensuring the reliability and security of the automated monitoring system.

[0097] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for updating the parameter section of a real-time database in a power automation monitoring system, characterized in that, It includes the following steps: Store the power automation monitoring system parameter data into the relational database according to the predefined version data storage structure; When the system parameters in the relational database are modified, record the parameter modification operation into the incremental registration form; Create a request according to the parameter version, and save the parameter modification operation in the incremental registration form as a parameter section with a unique version number through the process transaction lock mechanism; Update the content of the parameter section in the relational database to the real-time database according to the version number and the predefined version data storage structure; Among them, the step of creating a request according to the parameter version and saving the parameter modification operation in the incremental registration form as a parameter section with a unique version number through the process transaction lock mechanism is as follows: Obtain the parameter version creation request; Enable the process transaction lock; Add 1 to the maximum version number existing in the relational database as the new version number to be created; Create a historical incremental registration form with the new version number as the table name suffix in the relational database; Obtain the parameter modification operations during the period from the current moment to the end moment of the previous parameter version creation from the incremental registration form, and store the corresponding object primary key, modification type, and object type into the historical incremental registration form with the new version number; According to the historical incremental registration form, obtain the object records and relationship records from the object table and relationship table in the relational database respectively, combine the object records with the new version number and store them into the historical object table, and combine the relationship records with the new version number and store them into the historical relationship table; Insert the new version number, version producer, and version creation time into the historical version table to obtain the parameter section; Disable the process transaction lock.

2. The method for updating the parameter section of a real-time database in a power automation monitoring system according to claim 1, characterized in that, The predefined version data storage structure includes an object table, a historical object table, a relationship table, a historical relationship table, an incremental registration form, a historical incremental registration form, and a historical version table. Among them, each object table corresponds to a historical object table, and each relationship table corresponds to a historical relationship table; the object table is used to store the object data in the power automation monitoring system parameters, and the object data includes the object primary key ID and object type; the relationship table is used to store the relationship data in the power automation monitoring system parameters, and the relationship data includes the object primary key ID, relationship type, and related relationship object; the historical object table is used to store the object data in the power automation monitoring system parameters and its corresponding version number; the historical relationship table is used to store the relationship data in the power automation monitoring system parameters and its corresponding version number; the incremental registration form includes the object primary key ID, modification type, and object type; each historical incremental registration form corresponds to a parameter section, and the historical incremental registration form includes the object primary key ID, modification type, and object type corresponding to the parameter section, and the table name suffix of the historical incremental registration form uses the version number of the parameter section; the historical version table includes the version number, version producer, and version creation time.

3. The method for updating the parameter section of a real-time database in a power automation monitoring system according to claim 1, characterized in that, The enabling of the process transaction lock means: using the table-level lock function to lock the incremental registration form in a relational database session; the disabling of the process transaction lock means: when the parameter section is obtained, in the same relational database session where the process transaction lock is enabled, empty the incremental registration form and release the table-level lock function.

4. The method for updating the parameter section of a real-time database in a power automation monitoring system according to claim 1, characterized in that, The steps to update the parameter section content in the relational database to the real-time database are as follows: Obtain the version number to be updated; Obtain the parameter section content from the historical incremental registration table, historical object table, and historical relationship table in the relational database according to the version number; Update the data of the same parameters in the real-time database one by one according to the parameter section content.

5. The method for updating the parameter section of a real-time database in a power automation monitoring system according to claim 1, characterized in that, When the real-time database reads the data of the specified version number in the relational database, batch and parallelly read the parameter section content corresponding to the version number from the historical object table and historical relationship table respectively according to the object type and relationship type, and obtain the parameter data of the power automation monitoring system corresponding to this version; when the relational database generates a new parameter section, batch and parallelly obtain the record data from the object table and relationship table respectively according to the object type and relationship type, and write them into the historical object table and historical relationship table.

6. A device for updating the parameter section of a real-time database in a power automation monitoring system, characterized in that, Including: A structured storage module for storing the parameter data of the power automation monitoring system into the relational database according to the predefined version data storage structure; An incremental registration module for recording parameter modification operations in the incremental registration table when the system parameters in the relational database are modified; A parameter section module for saving the parameter modification operations in the incremental registration table as a parameter section with a unique version number through a process transaction lock mechanism according to a parameter version creation request; A parameter section update module for updating the parameter section content in the relational database to the real-time database according to the version number and the predefined version data storage structure; Among them, the operations of the parameter section module are: Obtain a parameter version creation request; Enable a process transaction lock; Add 1 to the existing maximum version number in the relational database as the new version number to be created; Create a historical incremental registration table in the relational database with the table name suffixed with the new version number; Obtain the parameter modification operations during the current time to the end time of the previous parameter version creation from the incremental registration table, and store the corresponding object primary key, modification type, and object type into the historical incremental registration table with the new version number; According to the historical incremental registration table, obtain the object records and relationship records from the object table and relationship table in the relational database respectively, combine the object records with the new version number and store them into the historical object table, and combine the relationship records with the new version number and store them into the historical relationship table; Insert the new version number, version producer, and version creation time into the historical version table to obtain a parameter section; Disable the process transaction lock.

7. An apparatus for updating a parameter section of a real-time database of a power automation monitoring system according to claim 6, characterized in that, The predefined version data storage structure includes an object table, a historical object table, a relationship table, a historical relationship table, an incremental registration table, a historical incremental registration table, and a historical version table. Among them, each object table corresponds to a historical object table, and each relationship table corresponds to a historical relationship table. The object table is used to store object data in the parameters of the power automation monitoring system. The relationship table is used to store relationship data in the parameters of the power automation monitoring system. The historical object table is used to store object data in the parameters of the power automation monitoring system and its corresponding version number. The historical relationship table is used to store relationship data in the parameters of the power automation monitoring system and its corresponding version number. The incremental registration table includes an object primary key ID, a modification type, and an object type. Each historical incremental registration table corresponds to a parameter section. The historical incremental registration table includes the object primary key ID, modification type, and object type corresponding to the parameter section. The suffix of the table name of the historical incremental registration table uses the version number of the parameter section. The historical version table includes a version number, a version producer, and a version creation time.

8. An apparatus for updating a parameter section of a real-time database of a power automation monitoring system according to claim 7, characterized in that, The opening process transaction lock refers to: using the table-level lock function to lock the incremental registration table in a relational database session. The closing process transaction lock refers to: after obtaining the parameter section, in the same relational database session where the opening process transaction lock is used, empty the incremental registration table and release the table-level lock function.

Citation Information

Patent Citations

  • Electric power automatization system real time database multi-domain group multi-section accomplishing method

    CN101286178A

  • Transaction exchange platform with watchdog microservice

    US20210191801A1