Data updating method and system for substation model of transformer substation
By matching and checking the name of the data record and comparing and contents of the data record when the substation factory model is updated, the data records that are not matched, updated and maintained are solved, and the problem of historical records and advanced functions cannot be used, realizing the unique identification of the data record and normal update of the model data.
Patent Information
- Application Number
- CN202411872755.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
The existing technology causes history and advanced functions to be unused or viewed when the substation factory model is updated, mainly because the historical data cannot match the new data after the compatible version model is updated.
By transferring the new substation model data to the main site's setting model file, extracting and matching the data records with name matching and content comparison verification, marking and processing unmatched, updated and maintained data records, ensuring that the unique identification of the data records remains unchanged.
After the substation factory model is updated, the normal use and viewing of history and advanced functions is realized, ensuring that the unique identification of data records in the database remains unchanged, and avoiding the matching problems of history and advanced functions.
Smart Images

Figure CN119807212A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of substation plant model data iteration, and in particular relates to a substation plant model data updating method and system. Background Art
[0002] With the development of power systems, the internal functions and structures of substations are becoming increasingly complex, and the various connected devices are constantly being added, updated, and retired. This often directly causes the model in the station to change, resulting in the iteration of the plant models of various master station systems connected to the substation (that is, the overall model changes due to the difference in model data before and after the iteration).
[0003] At present, the communication protocols used in substations are usually IEC61850 and IEC103. The models used by these two protocols are different. For the convenience of use, each manufacturer will establish a compatible model in the database (this compatible model is applicable to both IEC61850 and IEC103). Due to the safety requirements of the power grid system, this model will be established in areas 1 and 3 at the same time, and the model data in areas 1 and 3 will be kept consistent.
[0004] When the model is updated, the more common method is to directly delete the original model in the database, and then re-enter the new model (i.e., first delete the model data before the update in the database, and then re-import the updated model data into the database). However, this method may cause the model data of the model associated with the historical records or advanced functions to be unable to match the updated model data because the re-imported model data is different from the model data before the update (i.e., because the model data before and after the update may have changed, it is impossible to find the corresponding data record in the updated model data through the model data information before the update, or it is impossible to find the corresponding data record in the historical model data through the model data information after the update), thereby making the historical records and some advanced functions unusable or unviewable. Summary of the invention
[0005] The purpose of the present invention is to provide a data updating method and system for a substation plant model, which is used to solve the problem in the prior art that historical records and some advanced functions cannot be used or viewed due to model updating of a compatible version model.
[0006] In order to achieve the above object, the present invention provides a data updating method for a substation plant model, the method comprising: After transferring the new substation model data to the setting model file of the master station, extract the data records corresponding to the protocol information from the model file and the model data of the master station database according to the file name containing the protocol information; the fields of the data records of the same primary device, the same secondary device and the same device measurement point in the model file and the model data correspond one to one; According to classifying and arranging the data records of the primary equipment, the secondary equipment under the same primary equipment, and the equipment measuring points under the same secondary equipment in the model file and the model data, the model file and the model data are classified and sorted in the same manner; the data records in the classified and arranged model file and the model data are stored respectively, and a memory index containing the data record names determined in the same manner according to the data record contents in the model file and the model data respectively is set; Perform name matching on the model data and the data records in the model file according to the data record names, and mark the data records in the model data that have not completed name matching for deletion; mark the data records remaining in the model file after the name matching has not been completed; perform content comparison and verification on the model data and the data records in the model file that have completed name matching, mark the data records in the model data that are consistent with the verification as maintenance, and mark the data records that are inconsistent with the verification as update; delete the data records marked for deletion from the model data in the database; add the data records marked for addition to the model data in the database; update the data records marked for update according to the data records in the model file that have completed the name matching; and do not process the data records marked for maintenance.
[0007] Beneficial effect: The present invention provides a new data update method for a substation plant model. The method first transfers the new substation model data to the setting model file of the master station, extracts the data records stored in the model file and the database respectively and whose fields have completed one-to-one correspondence; after the extraction is completed, the data records are name matched (that is, matching is performed according to the names of the data records, and the data records in the model data that have not completed the name matching are marked for deletion, and the data records remaining after the name matching in the model file are marked for addition), that is, considering that if the names of two data records from the model file and the model data can match each other, then it can be basically considered that the two correspond to the same primary device and the same Secondary equipment and the same measuring point (referred to as the corresponding same measuring point), therefore, the pairs of data records corresponding to the same measuring point are screened out through name matching; then the content of the data records that have completed the name matching is compared and verified; and marked according to the verification results (the data records with the same verification results are marked as maintenance marks, and the data records with different verification results are marked as update marks), and then imported into the database in a corresponding manner according to the marks; that is, the data records marked for update are updated according to the data records in the model file that match their completed names, the data records marked for maintenance are not processed, the data records marked for deletion are deleted from the database, and the data records marked for addition are added to the database. Through such a setting, the contents of each pair of data records corresponding to the same measuring point screened by name matching are compared, and the data records whose contents have not changed compared with the newly acquired model file are maintained by maintaining the marks, and the data records whose contents have changed compared with the newly acquired model file are updated by updating the marks while retaining the unique identifier of the data record, thereby ensuring that the unique identifier of the data record in the database will not change regardless of whether the content has changed or not, and the data records with changed contents in the database can be updated in time; the data records with deletion marks are deleted from the database, and the data records with addition marks are added to the database, which can ensure that the data records added in the new model are updated to the database in time, and the data records that are redundant in the current model data compared with the new model are deleted in whole to achieve normal update of the model data in the database.The device or measuring point corresponding to the data record marked for deletion is no longer included in the updated model, and its historical record no longer needs to be paid attention to in the updated model, so it can be deleted during the update process; the device or measuring point corresponding to the data record marked for addition did not exist before the model was updated, and its historical record did not exist either, so there is no need to search for it, so it can be directly added to the database, and there is no mismatch between the data records of the new and old models when operating on it; when viewing historical data or applying advanced functions, since this method can basically ensure that the unique identifier of the data record in the database will not change, it is possible to directly locate the latest data record and historical data of a certain measuring point of a certain secondary device under a certain primary device by searching the unique identifier of the data record in the model data stored in the database, or apply advanced functions based on the precise positioning, thereby solving the problem that the existing method of deleting the entire thing and then re-entering the database causes the model data of the model associated with the historical record or advanced function to be unable to match the updated model data, making the historical record and some advanced functions unable to be used or viewed. That is, this method can keep the unique identifier of the data record unchanged as much as possible during the model update process, so as to ensure that the data records in the database can always be matched through the unique identifier before and after the model is updated. Even if the model is updated, the data records in the database can be found normally. When viewing historical records in the database or using some advanced functions, since the model is always matched, the corresponding operations can be performed normally (that is, viewing historical records or using some advanced functions are not affected).
[0008] Furthermore, the method of storing the data records in the model file and the model data separately includes: classifying and arranging the data records of the primary equipment, the secondary equipment under the same primary equipment, and the equipment measurement points under the same secondary equipment in the model file and the model data, respectively, and classifying and sorting the model file and the model data in the same way; and storing the classified and arranged data records in the model file and the model data separately.
[0009] Further, the method of storing the data records in the model file and the model data respectively, and setting a memory index containing the data record name determined in the model file and the model data according to the data record content in the same manner includes: The data records in the classified and arranged model files and model data are divided into blocks, respectively, and stored in the form of record blocks, and a memory index containing the data record name is set; the memory index also contains a data record pointer, a record block length and a data record length; The block division results include primary equipment, secondary equipment and equipment measurement point record blocks; the primary equipment record block includes the data record of the primary equipment, the secondary equipment record block under it and the equipment measurement point record block under the secondary equipment record block; the secondary equipment record block includes the data record of the secondary equipment and the equipment measurement point record block under it; the equipment measurement point record block includes the data record of the equipment measurement point; The method of performing content comparison and verification on the model data and the data with completed name matching in the model file includes: performing content comparison and verification on the result obtained by dividing the data records with completed name matching in the model data and the model file into blocks.
[0010] Further, the maintenance mark includes a block maintenance mark and a record maintenance mark; The methods of performing content comparison and verification on the data records with matching names in the model data and the model file, marking the data records with consistent verification in the model data for maintenance, and marking the data records with inconsistent verification for update include: The primary device record block where the data record of the primary device that has completed the name matching is located is subjected to content comparison verification including block comparison verification and is marked accordingly; the secondary device record block of the secondary device that has completed the name matching in the primary device record block with inconsistent block verification is subjected to content comparison verification including block comparison verification and is marked accordingly; the device measurement point record block of the device measurement point that has completed the name matching in the secondary device record block with inconsistent block verification is subjected to block comparison verification or the data record of the device measurement point is subjected to record comparison verification and is marked accordingly; the method of performing content comparison verification including block comparison verification and making corresponding marks includes: In the model data and the model file respectively, according to the data record pointer and the data record block length in the memory index corresponding to the data record name, after searching for the corresponding record block, a block comparison check is performed on the contents of the respectively found record blocks; For the primary device record block and the secondary device record block, if the block comparison verification is inconsistent, then the data record content of the device corresponding to the record block found in the model data and model file stored in the database according to the data record pointer and data record length in the memory index is compared and verified; otherwise, the data record block is marked as a block maintenance; If the records are consistent, the data record is marked as maintained; otherwise, the data record is marked as updated; The following methods are not used to process data records marked for maintenance: The model data stored in the database corresponding to the record block with the block maintenance mark and the model data stored in the database corresponding to the data record with the record maintenance mark are not processed.
[0011] Furthermore, the name matching includes: 1) If the data record names of a data record in the model file and a data record in the model data are exactly the same, the two data records are matched; If the data record name of a data record in the model file contains the data record name of a data record in the model data, the two data records are matched to complete the name matching; If the data record name of a data record in the model data contains the data record name of a data record in the model file, the two data records are matched to complete the name matching; 2) If the data record does not meet the condition of 1), the data record in the model data and the data record in the model file are manually matched one-to-one, and the data record name of the data record in the model data is replaced with the data record name of the data record in the model file that matches the data record; 3) Repeat 1)-2) until the matching stops, and the remaining unmatched data records are regarded as data records with incomplete name matching.
[0012] Furthermore, the method of performing block comparison verification on the contents of the respectively found record blocks includes: verifying whether the contents of the two data record blocks are the same by comparing whether the MD5 values of the record blocks respectively found in the model data and the model file are the same.
[0013] Furthermore, the method of performing record comparison and verification on the content of the found data record includes: comparing the MD5 values of the data records found in the model data and the model file to see whether they are the same, so as to verify whether the contents of the two data records are the same.
[0014] Furthermore, the master station database is a database of a certain area of the master station; the data update method further comprises: performing content comparison verification on the model data in the database of a certain area of the master station and the data records with completed name matching in the model file, marking the data records in the model data that are consistent with the verification as maintenance, marking the data records that are inconsistent with the verification as update, and writing the marks made on the data records into the model file; Delete the data records marked as maintenance in the model file, and keep the data records marked as update and addition in the model file; The unique identifier and data record name generated when the data record marked for deletion in the model file is transferred are retained, and other data of the data record is deleted; The marked model file in this area is transferred to another area. In the database of the other area, the data records marked for deletion are deleted from the model data stored in the database; the data records marked for addition are added to the model data stored in the database; the data records marked for update are updated according to the data records in the model file that match their completed names while retaining the preset unique identifier of the data records; the data records marked for maintenance are not processed.
[0015] Furthermore, the method of extracting each data record from the model data stored in the model file and the main station database includes: determining the protocol corresponding to the model data stored in the model file and the main station database according to the file name containing the protocol information; removing the fields corresponding to other protocols other than the protocol corresponding to the model data stored in the model file and the main station database from the data records of the model data stored in the model file and the main station database, and using the data records after the removal as the data records extracted from the model data stored in the model file and the main station database.
[0016] The present invention also provides a data updating system for a substation plant model, the system comprising a processor, the processor being used to execute a computer program to implement the steps of the above-mentioned data updating method for the substation plant model.
[0017] The data updating system of the substation plant model can achieve the same beneficial effects as the data updating method of the substation plant model mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 An example diagram of a file format for setting a model file in an embodiment of a method for updating data of a substation plant model; Figure 2 An example diagram of a storage structure for storing model files and model data after classification and arrangement in an embodiment of a data updating method for a substation plant model; Figure 3 This is a diagram showing an example of a structure of a memory index in an embodiment of a method for updating data of a substation plant model; Figure 4 A schematic diagram of the process of performing name matching and content comparison verification in an embodiment of a data updating method for a substation plant model; Figure 5 This is an application example diagram of updating the data of the substation plant model in the master station area 1 and the master station area 3 in the data updating method embodiment of the substation plant model. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0020] Embodiment of data updating method for substation plant model The present embodiment provides a technical solution for a data updating method of a substation plant model. The method first extracts data records collected by each device from a model file in which substation model data is transferred and a master station database, respectively, and matches the fields of each data record in the model file and the database one by one; then performs name matching on the stored data records, and makes corresponding marks on some of the data records: marks the data records that are not matched in the model file for deletion, and marks the data records that are not matched in the database for addition; after the marking is completed, the data records with completed name matching are verified, and some of the data records are marked accordingly: marks the data records that are consistent with the verification in the database for maintenance, and marks the data records that are inconsistent with the verification for update; at this time, all markings are completed, and corresponding operations are performed on the data records according to the marks, that is, the data records with maintenance marks are not processed; the data records marked with deletion in the model data of the database are deleted, and the data records marked with addition in the model file are added to the model data; for the data records marked with update in the model data, on the premise of ensuring that their preset unique identifiers remain unchanged, they are replaced with the data records in the model file that match their completed names to overwrite the original data records. This method can ensure that the following conditions are met after the model is updated: a) Keep the marked data records unchanged, and the corresponding historical records can be searched normally before and after the model is updated, and some advanced functions can be performed on them; b) The data record marked for update can not only be used to find the correct data record according to its unchanging unique identifier (such as the ID of the data record) after the model is updated, but also the historical data record corresponding to the data record can be accurately found in the historical model data according to the unique identifier; c) The data records marked for deletion have been transformed into data records that do not need to be paid attention to in the updated model data. There is no need to find the corresponding historical data or perform advanced functions on these data records. Therefore, even if they disappear in the database, there is no impact and interference with other data can be avoided; d) There is no historical model data for the data record to be marked, and there is no need to find the corresponding historical data for this part of the data record. To operate advanced functions, it is only necessary to operate based on the model after the update.
[0021] In summary, this method can not only ensure that the corresponding data records can be found through the unique identifier after the model is updated, so as to perform some advanced functions on it; it can also realize the viewing of the required historical data records in the historical model data.
[0022] In this embodiment, the method specifically includes: transferring the new substation model data to the setting model file of the master station (the file format of the setting model file follows Figure 1 The source of the set model file is: after the model is summoned from the substation to the main station, the model data of the model is transferred to the general model file to obtain the set model file), each data record is extracted from the model file and the model data stored in the main station database (that is, the object of data update, the model data is the real-time model data stored in the main station database, and has nothing to do with historical data); the fields of the data records in the model file and the model data of the same primary device, the same secondary device and the same device measurement point correspond one to one; by Figure 1 Take the file content shown in the figure as an example, where the entire data record starting with "BUS" represents a data record of a primary device; the entire data record starting with "DEVICE" represents a data record of a secondary device; the entire data record starting with "SETTING" represents a data record of a device measurement point. In addition, in the present embodiment, the method of extracting each data record from the model data stored in the model file and the main station database includes: determining the protocol corresponding to the model data stored in the model file and the main station database according to the file name containing protocol information (i.e., calling the model from the substation to the main station through the 103 and 61850 protocols, and then transferring the model data of the model to the general model file to obtain a set model file; the set model file has a file name in the format of "plant name_protocol_model.xml"; wherein the "protocol" part is filled with the name of the protocol used, and this file content format can make the relevant information required by the two protocols 103 and 61850 compatible together); in the data records of the model data stored in the model file and the main station database, fields corresponding to other protocols other than the protocol corresponding to the model data stored in the model file and the main station database are eliminated, and the eliminated data records are used as the data records extracted from the model data stored in the model file and the main station database respectively.
[0023] For example, refer to Figure 1 , taking the data record starting with "DEVICE" as an example, due to Figure 1The model file shown in has determined that 61850 is the protocol corresponding to the model file, so the fields corresponding to the 103 protocol need to be removed from the data record, that is, the three fields of _103GROUP, _103ITEM and _103ADDR. By removing the fields corresponding to other protocols in this way, the parts that are not related to the model update can be removed from the content comparison and verification before making each mark, so as to avoid the subsequent content comparison and verification being affected by the values of the fields corresponding to other protocols, resulting in inconsistent content comparison and verification only due to different values of the fields corresponding to other protocols, and then updating the data records with different values of the fields corresponding to other protocols, resulting in repeated meaningless judgments and operations when the data records are processed accordingly. Therefore, it can not only improve the speed and efficiency of model updates by reducing the amount of data, but also effectively reduce the risk of update errors due to misjudgment.
[0024] like Figure 2 As shown, the data records in the model file and the model data are stored separately (they can be stored back in the model file and the database, or the data records in the model file and the model data can be copied and stored separately in a third-party storage space), and set as follows Figure 3 The memory index (i.e., the primary device index, the secondary device index, and the index of each device measurement point) of the data record name determined in the same manner in the model file and the model data according to the data record content; Figure 3 Taking the first group of indexes of a device index as an example, the name 1 in the specific content of the index is the data record name. The data record name is determined according to the data record content, for example, Figure 1 The data record name of the data record starting with "BUS" is determined according to the value "220kV bus" of the "NAME" field in the data record content. For example, the value of the "NAME" field is directly used as the data record name of the data record.
[0025] like Figure 4As shown, the model data and the data records in the model file are matched according to the data record names, and the data records in the model data that have not completed the name matching are marked for deletion; the data records remaining in the model file after the incomplete name matching are marked for addition; the model data and the data records in the model file that have completed the name matching are compared and verified, and the data records in the model data that are consistent with the verification are marked for maintenance, and the data records that are inconsistent with the verification are marked for update; the data records marked for deletion are deleted from the model data in the database; the data records marked for addition are added to the model data in the database; the data records marked for update are updated according to the data records in the model file that have completed the name matching while retaining the preset unique identifier of the data record; the data records marked for maintenance are not processed. Reference Figure 1 In this embodiment, the preset unique identifier of the data record is obtained from the field corresponding to the id in the content of the data record itself, for example Figure 1 "NET Table_id", "BUS Table_id", etc. in the table may be directly referred to as id in this embodiment; in other embodiments, other forms of preset unique identifiers may also be used; in this embodiment, the unique identifier is usually established when the data record is stored as model data of the main station database (that is, when stored in the main station database), and only has a corresponding relationship with the data record; therefore, it is a preset unique identifier; in other embodiments, the unique identifier of the data record may also be preset at other time nodes to ensure that the preset unique identifier only has a corresponding relationship with the single data record it targets.
[0026] In this embodiment, name matching includes: 1) If the data record names of a data record in the model file and a data record in the model data are exactly the same, the two data records are matched; If the data record name of a data record in the model file contains the data record name of a data record in the model data, the two data records are matched to complete the name matching; If the data record name of a data record in the model data contains the data record name of a data record in the model file, the two data records are matched to complete the name matching; That is, only one of the three conditions proposed in 1) (the data record name of a data record in the model file and the data record name of a data record in the model data are exactly the same, the data record name of a data record in the model file contains the data record name of a data record in the model data, and the data record name of a data record in the model data contains the data record name of a data record in the model file) is required to satisfy the matching of the name of a data record in the model file and the data record in the model data.
[0027] 2) If the data record does not meet the condition of 1), the data record in the model data and the data record in the model file are manually matched one-to-one, and the data record name of the data record in the model data is replaced with the data record name of the data record in the model file that matches the data record; the specific method adopted in this embodiment is to manually identify and manually match the same data one-to-one on the matching interface, replace the name of the data record in the model data with the name of the data record in the model file, and the name finally in the database and corresponding to the data record is the replaced name, that is, the correct name after updating. It should be noted that manual matching often determines which data record in the model data and which data record in the model file to match based on engineering practice experience or a preset name change method (such as a renaming rule). For example, the preset renaming rule is to change character A in the data record name to character B. Then, for a data record with a data record name of Axxx in the model data, it is matched with a data record with a data record name of Bxxx in the model file during manual matching. Although this matching method is more likely to cause matching errors than a matching method that satisfies any of the three conditions proposed in 1), considering that in most cases, the amount of data records that need to be manually matched is very small (unless the data record names are changed in batches, this situation can be solved by other existing measures and is not within the scope of consideration of the update method of this embodiment), manual matching errors can be regarded as errors within an acceptable range, and the impact of manual matching errors can usually be solved by existing remedial measures, which will not be repeated here.
[0028] 3) Repeat 1)-2) until the matching stops, and the remaining unmatched data records are regarded as data records with incomplete name matching.
[0029] Specifically, Figure 4 Taking the name matching process in as an example, when performing name matching, the data records in the model data and the data records in the model file are automatically matched according to the data record names (that is, the data record names are used as the basis for matching the data records). After a simple automatic matching, the very small part of the data records in the model data and the model file that are not matched are matched according to engineering experience or other principles. The matching operation is guaranteed to be correct as much as possible. If a matching error is inadvertent, the part of the data records with incorrect matching can also enter the model data through subsequent addition or update operations to participate in the correct update.
[0030] The data record corresponding to name 1 in the database data record memory index (i.e., the memory index of the data record name determined according to the data record content in the model data) and the data record corresponding to name 1 in the model file data record memory index (i.e., the memory index of the data record name determined according to the data record content in the model file) complete name matching. The data record corresponding to name n in the database data record memory index does not complete name matching (i.e., no consistent name is found in the model file data record memory index); at this time, the data record in the model data that has not completed name matching (i.e., the data record corresponding to name n in the database data record memory index) is marked as delete (i.e., a delete mark), and the remaining data records in the model file after the incomplete name matching (e.g., name n in the model file data record memory index) are marked as add (i.e., an add mark). After marking, the data records in the model data and the model file that have completed name matching are compared and verified, and the data records in the model data that are consistent with the verification are marked as maintenance, and the data records that are inconsistent with the verification are marked as update (i.e., an update mark).
[0031] When all markings are completed, set operations are performed on the data records corresponding to each mark in the model data according to each mark, which is divided into the following four cases: A) If the data record is marked as delete, the data record is deleted from the model data in the database; B) If the data record is marked as add, then the data record is added to the model data of the database; C) If the data record is marked as update, then under the premise of ensuring that the unique identifier preset for the data record remains unchanged, the data record is updated according to the data record in the model file that matches its completed name, that is, the data record in the model file that matches its completed name is used to replace the data record in the original model data; in this embodiment, the unique identifier is generated when the new substation model data is transferred to the setting model file of the master station, and in other embodiments, the unique identifier can also be added to each data record after the transfer; D) If the data record is marked as maintained, no processing is done on it.
[0032] After the operations corresponding to the above four situations, the following results will be obtained: The data records marked as delete have been deleted (that is, these data records have disappeared from the model data in the database). However, since these data records are obsolete data records (that is, unused data records) for the updated model, there is no need to operate or pay attention to them, and there is no need to view their corresponding historical data records. Therefore, even if these data records disappear from the database, there will be no impact.
[0033] Data records marked as add are entered into the database only after the model is updated. There is no corresponding historical model data and historical data records for these data records, so there is no need to view their historical data records. When performing operations corresponding to advanced functions on these data records, it can be completed based on the identity information after the model is updated.
[0034] The data records marked as update are actually the data records that need to be paid special attention to before and after the model is updated, because these data records not only exist before the model is updated, but also remain after the model is updated. For these data records, since only the data record content contained in them is updated when the model is updated, and their preset unique identifier remains unchanged, after the model is updated, the correct and updated data records can still be found for these data records based on the unique identifier to perform operations corresponding to advanced functions on them; and since the unique identifier remains unchanged, it can also meet the needs of finding its historical data records based on the unique identifier in the historical model data.
[0035] As for the data records marked for maintenance, since no processing is done on them during the model update, the model update has no impact on the normal search for historical data records of this part of the data records and the execution of operations corresponding to advanced functions on them.
[0036] If a data record in the model data should match another data record in the model file during name matching, but the two are not correctly matched in the set matching operation, the data record is marked as deleted at this time, and the status of the data record in the model file that should have been correctly matched with the data record but was not matched has the following two possibilities: ① When the name matching process ends, the name matching is not completed and is marked as add. In this case, the data record will eventually execute the operation corresponding to B), that is, it will be added to the model data of the database; and the original data record marked as delete will be deleted from the database, that is, the update of the data record is completed through the above-mentioned addition and deletion operations.
[0037] ② It incorrectly matches another data record in the model data. Due to the incorrect match, the data record will be marked as update during content comparison and verification. In this case, the data record will eventually execute the operation corresponding to C), that is, replace the data record in the model data that matches its completed name. The data record in the original model data is permanently overwritten and disappears in the database. That is, the update of the data record is completed through the above-mentioned update (replacement) operation.
[0038] In summary, regardless of whether the data record is successfully matched when the name is matched, it can enter the database and complete the update of the data record in different ways. However, the data records updated by operations ① and ② are actually data records with incorrect name matching, which account for a very small proportion in engineering practice; although the id is inconsistent with the model before the update, the number of samples is very small, which does not affect the underlying logic of this embodiment. In the subsequent steps, it can be searched and compared (for example, manually comparing the content of the data record field by field), which will not be repeated here.
[0039] like Figure 2 As shown, the method of storing the data records in the model file and the model data separately includes: classifying and arranging the data records of the primary equipment, the secondary equipment under the same primary equipment, and the equipment measurement points under the same secondary equipment in the model file and the model data, respectively, and classifying and sorting the model file and the model data in the same way; storing the classified and arranged data records in the model file and the model data separately.
[0040] In this embodiment, the data records in the model file and the model data are stored separately, and a memory index containing the data record name determined in the same manner in the model file and the model data according to the data record content is set, including: the data records in the model file and the model data after classification and arrangement are divided into blocks (when the block division is performed here, in order to ensure that the block division results are the same, the block division method of the data records in the model file and the model data must also be consistent), stored separately in the form of record blocks, and a memory index containing the data record name is set; the memory index also contains a data record pointer, a record block length and a data record length; Figure 3 Taking the first group of indexes of a device index as an example, the specific contents of the index include record pointer 1 (ie, data record pointer), record length 1 (ie, data record length), and block length 1 (ie, record block length).
[0041] like Figure 2 As shown, the result of block division includes primary equipment, secondary equipment and equipment measurement point record block (the equipment measurement point record block contains data records of equipment measurement points such as fixed value, analog quantity and soft pressure plate); the primary equipment record block includes the data record of the primary equipment, the secondary equipment record block under it and the equipment measurement point record block under the secondary equipment record block, that is, the primary equipment record block contains not only the data record of its own primary equipment, but also the secondary equipment record block under it and the equipment measurement point record block under the secondary equipment record block; similarly, the secondary equipment record block includes the data record of the secondary equipment and the equipment measurement point record block under it; the equipment measurement point record block includes the data record of the equipment measurement point; The method of performing content comparison and verification on the model data and the data with completed name matching in the model file includes: performing content comparison and verification on the result obtained by dividing the data records with completed name matching in the model data and the model file into blocks.
[0042] In this embodiment, the maintenance flags are mainly divided into two types, including a block maintenance flag (i.e., same_full) and a record maintenance flag (i.e., same_record); The methods of performing content comparison and verification on the data records with matching names in the model data and the model file, marking the data records with consistent verification in the model data for maintenance, and marking the data records with inconsistent verification for update include: The primary device record block containing the data record of the primary device that has completed the name matching is checked for content comparison and verified, and marked accordingly (i.e. Figure 4 In the embodiment, for data records whose names have been matched, the content of the data record block located by the data record pointer and the record block length is firstly used to perform a content comparison and verification on the entire primary device record block to which the data record belongs (including its subordinate secondary device record blocks and the device measurement point record blocks under the secondary device record blocks).
[0043] Performing content comparison verification including block comparison verification on the secondary device record blocks of the secondary devices that have completed name matching in the primary device record blocks with inconsistent block verification and making corresponding marks; performing block comparison verification on the device measurement point record blocks of the device measurement points that have completed name matching in the secondary device record blocks with inconsistent block verification, or performing record comparison verification on the data records of the device measurement points that have completed name matching in the secondary device record blocks with inconsistent block verification and making corresponding marks; The method of performing content comparison verification including block comparison verification and making corresponding marks includes: In the model data and the model file respectively, according to the data record pointer and the data record block length in the memory index corresponding to the data record name, after searching for the corresponding record block, a block comparison check is performed on the contents of the respectively found record blocks; For the primary device record block and the secondary device record block, if the block comparison verification is inconsistent, the data record content of the device corresponding to the record block found in the database and model file according to the data record pointer and data record length in the memory index is compared and verified (that is, if the block comparison verification is inconsistent, the content comparison verification of the subordinate data records of the record block is performed); otherwise, the data record block is marked as same_full; If the records are verified to be consistent, the data record is marked as same_record; otherwise, the data record is marked as update; The following methods are not used to process data records marked for maintenance: The model data of the database corresponding to the record block with the block maintenance mark and the model data of the database corresponding to the data record with the record maintenance mark are not processed.
[0044] Therefore, by dividing the data records in the classified and arranged model files and model data into blocks and storing them separately in the form of record blocks, the scattered data records in the model files or model data are actually integrated for processing; for example, the data records of a primary device, the secondary devices under the primary device, and the equipment measurement points under the secondary device are integrated into a primary device record block. When performing content comparison and verification, the data records integrated in the primary device record block can be directly verified (that is, all data records that need to be paid attention to are concentrated on this record block), without having to search for the corresponding data records from the model files and model data for verification, which greatly simplifies the verification process and effectively improves the speed and efficiency of the verification process and the entire model update process.
[0045] In this embodiment, the method of performing block comparison verification on the contents of the respectively found record blocks includes: comparing the MD5 values of the record blocks respectively found in the model data and the model file to verify whether the contents of the two data record blocks are the same.
[0046] Specifically, this embodiment verifies the content of the found record block through MD5 (Message-Digest Algorithm 5), that is, the MD5 check values of the record blocks found in the model data and the model file are compared to achieve verification. If the MD5 check values are the same, it means that the contents of the two are the same; otherwise, it means that the contents of the two are different.
[0047] The method of performing record comparison and verification on the content of the found data record includes: comparing the MD5 values of the data records found in the model data and the model file to see whether they are the same, so as to verify whether the contents of the two data records are the same.
[0048] Specifically, the method of performing record comparison verification on the content of the found data record is the same as the method of verifying the content of the found record block through MD5.
[0049] like Figure 5As shown, in this embodiment, the master station database is a database of a certain area of the master station (i.e., a database of area 1 of the master station in this embodiment); the data update method further comprises: performing content comparison verification on the model data in the database of a certain area of the master station and the data records with completed name matching in the model file, marking the data records in the model data that are consistent with the verification as maintenance, marking the data records that are inconsistent with the verification as update, and writing the marks made on the data records into the model file; Delete the data records marked as maintenance in the model file, and keep the data records marked as update and addition in the model file; The unique identifier and data record name generated when the data record marked for deletion in the model file is transferred are retained, and other data of the data record is deleted; The marked model file in this area is transferred to another area (i.e., area 3 of the master station). In the database of the other area, the data records marked for deletion are deleted from the model data of the database; the data records marked for addition are added to the model data of the database; the data records marked for update are updated according to the data records in the model file that match their completed names; the data records marked for maintenance are not processed.
[0050] Taking the model transmission between the master station area 1 and the master station area 3 as an example, the model data in the database of the master station area 1 and the data records with complete name matching in the model file are compared and verified, and the data records with consistent verification in the model data are marked as maintenance (that is, the data records with consistent blocks are marked as same_full; the data sets with consistent records are marked as same_record), and the data records with inconsistent verification are marked as update, and the above marks are written into the model file; Delete the data records marked as same_full and same_record in the model file, and keep the data records marked as update and add in the model file; The data records marked as delete in the first zone are the data records that need to be deleted. Therefore, the processing method for the data records marked as delete in the model data of the third zone database of the master station is: retain the unique identifier (i.e., id, which does not change with the model update) and data record name generated when the data record marked as delete in the model file is transferred, and delete the other data contained in the data record. Similarly, the data records marked as add in the first zone are added to the model data of the third zone; the data records marked as update are updated according to the data records in the model file that match their completed names (i.e., the data records in the model file that match the completed names of the data records are replaced, and the data records are overwritten); the data records marked as same_full and same_record are not processed and are directly transmitted. Since the deleted or replaced content is redundant data, deleting or replacing it has no effect on the corresponding operations in the third zone of the master station. Therefore, the above operations can reduce the size of the files transmitted between the first and third zones, thereby reducing the pressure of file transmission in the first and third zones.
[0051] When updating the model in the third area of the main station, the data in the model file after the above processing (that is, the data records after all markings are completed) can be directly used, and the third area of the main station only needs to perform corresponding operations on each data record according to the mark to realize the model update, without the need for name matching and content comparison and verification.
[0052] Embodiment of data updating system for substation plant model This embodiment provides a data update system for a substation plant model, which includes a processor having executable program instructions stored therein, and the executable program instructions are used to implement the data update method for the substation plant model in the above-mentioned data update method embodiment for the substation plant model.
[0053] Since the specific working mode and working principle of the data updating system of the substation plant model of this embodiment have been described in detail in the above-mentioned data updating method embodiment of the substation plant model, they will not be repeated here.
[0054] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, but do not constitute a limitation to the present invention.
Claims
1. A data updating method for a substation plant model, characterized in that: include: After transferring the new substation model data to the setting model file of the master station, extract each data record from the model file and the model data stored in the master station database respectively; the fields of the data records of the same primary device, the same secondary device and the same device measurement point in the model file and the model data correspond one to one; The data records in the model file and the model data are stored separately, and a memory index containing the data record names determined in the same manner in the model file and the model data according to the data record contents is set; Perform name matching on the model data and the data records in the model file according to the data record names, and mark the data records in the model data that have not completed name matching as deleted; mark the remaining data records in the model file that have not completed name matching as added; perform content comparison and verification on the model data and the data records in the model file that have completed name matching, mark the data records in the model data that are consistent with the verification as maintained, and mark the data records that are inconsistent with the verification as updated; delete the data records marked for deletion from the model data stored in the database; Add the data record with the addition mark to the model data stored in the database; For data records marked for update, they are updated according to the data records in the model file that match their completed names, while retaining the preset unique identifier for the data record; data records marked for maintenance are not processed.
2. The data updating method of the substation plant model according to claim 1 is characterized in that: The method of storing the data records in the model file and the model data separately includes: classifying and arranging the data records of the primary equipment, the secondary equipment under the same primary equipment, and the equipment measurement points under the same secondary equipment in the model file and the model data respectively, and classifying and sorting the model file and the model data in the same way; storing the classified and arranged data records in the model file and the model data separately.
3. The data updating method of the substation plant model according to claim 2 is characterized in that: The method of storing the data records in the model file and the model data separately and setting a memory index containing the data record name determined in the same manner according to the data record content in the model file and the model data respectively includes: The data records in the classified and arranged model files and model data are divided into blocks, respectively, and stored in the form of record blocks, and a memory index containing the data record name is set; the memory index also contains a data record pointer, a record block length and a data record length; The block division results include primary equipment, secondary equipment and equipment measurement point record blocks; the primary equipment record block includes the data record of the primary equipment, the secondary equipment record block under it and the equipment measurement point record block under the secondary equipment record block; the secondary equipment record block includes the data record of the secondary equipment and the equipment measurement point record block under it; the equipment measurement point record block includes the data record of the equipment measurement point; The method of performing content comparison and verification on the model data and the data with completed name matching in the model file includes: performing content comparison and verification on the result obtained by dividing the data records with completed name matching in the model data and the model file into blocks.
4. The data updating method of the substation plant model according to claim 3 is characterized in that: The maintenance mark includes a block maintenance mark and a record maintenance mark; The methods of performing content comparison and verification on the data records with matching names in the model data and the model file, marking the data records with consistent verification in the model data for maintenance, and marking the data records with inconsistent verification for update include: The primary device record block where the data record of the primary device that has completed the name matching is located is subjected to content comparison verification including block comparison verification and is marked accordingly; the secondary device record block of the secondary device that has completed the name matching in the primary device record block with inconsistent block verification is subjected to content comparison verification including block comparison verification and is marked accordingly; the device measurement point record block of the device measurement point that has completed the name matching in the secondary device record block with inconsistent block verification is subjected to block comparison verification or the data record of the device measurement point is subjected to record comparison verification and is marked accordingly; the method of performing content comparison verification including block comparison verification and making corresponding marks includes: In the model data and the model file respectively, according to the data record pointer and the data record block length in the memory index corresponding to the data record name, after searching for the corresponding record block, a block comparison check is performed on the contents of the respectively found record blocks; For the primary device record block and the secondary device record block, if the block comparison verification is inconsistent, then the data record content of the device corresponding to the record block found in the model data and model file stored in the database according to the data record pointer and data record length in the memory index is compared and verified; otherwise, the data record block is marked as a block maintenance; If the records are consistent, the data record is marked as maintained; otherwise, the data record is marked as updated; The following methods are not used to process data records marked for maintenance: The model data stored in the database corresponding to the record block with the block maintenance mark and the model data stored in the database corresponding to the data record with the record maintenance mark are not processed.
5. The data updating method of the substation plant model according to any one of claims 1 to 4, characterized in that: The name matching includes: 1) If the data record names of a data record in the model file and a data record in the model data are exactly the same, the two data records are matched; If the data record name of a data record in the model file contains the data record name of a data record in the model data, the two data records are matched to complete the name matching; If the data record name of a data record in the model data contains the data record name of a data record in the model file, the two data records are matched to complete the name matching; 2) If the data record does not meet the condition of 1), the data record in the model data and the data record in the model file are manually matched one-to-one, and the data record name of the data record in the model data is replaced with the data record name of the data record in the model file that matches the data record; 3) Repeat 1)-2) until the matching stops, and the remaining unmatched data records are regarded as data records with incomplete name matching.
6. The data updating method of the substation plant model according to claim 4 is characterized in that: The method of performing block comparison verification on the contents of the respectively found record blocks includes: comparing the MD5 values of the record blocks respectively found in the model data and the model file to see whether they are the same, so as to verify whether the contents of the two data record blocks are the same.
7. The data updating method of the substation plant model according to claim 4 is characterized in that: The method of performing record comparison and verification on the content of the found data record includes: comparing the MD5 values of the data records found in the model data and the model file to see whether they are the same, so as to verify whether the contents of the two data records are the same.
8. The data updating method of the substation plant model according to any one of claims 1 to 4, characterized in that: The master station database is a database of a certain area of the master station; the data update method further comprises: performing content comparison verification on the model data in the database of a certain area of the master station and the data records with completed name matching in the model file, marking the data records in the model data that are consistent with the verification as maintenance, marking the data records that are inconsistent with the verification as update, and writing the marks made on the data records into the model file; Delete the data records marked as maintenance in the model file, and keep the data records marked as update and addition in the model file; The unique identifier and data record name generated when the data record marked for deletion in the model file is transferred are retained, and other data of the data record is deleted; The marked model file in this area is transferred to another area. In the database of the other area, the data records marked for deletion are deleted from the model data stored in the database; the data records marked for addition are added to the model data stored in the database; the data records marked for update are updated according to the data records in the model file that match their completed names while retaining the preset unique identifier of the data records; the data records marked for maintenance are not processed.
9. The data updating method of the substation plant model according to any one of claims 1 to 4, characterized in that: The method of extracting each data record from the model data stored in the model file and the main station database includes: determining the protocol corresponding to the model data stored in the model file and the main station database according to the file name containing protocol information; removing fields corresponding to protocols other than the protocol corresponding to the model data stored in the model file and the main station database from the data records of the model data stored in the model file and the main station database, and using the data records after the removal as the data records extracted from the model data stored in the model file and the main station database.
10. A data updating system for a substation plant model, comprising a processor, characterized in that: The processor is used to execute a computer program to implement the steps of the data updating method of the substation plant model described in any one of claims 1-9.