Method and device for matching nodes of different systems based on the longest common subsequence

By using the longest common subsequence (LCS) algorithm to match node names in the power system and classifying nodes based on voltage level and type, the difficulties in comprehensive data analysis caused by different naming of output data from different systems are solved, and the efficiency of data integration is improved.

CN118981488BActive Publication Date: 2025-09-30CHINA SOUTHERN POWER GRID COMPANY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411015985.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2025-09-30
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

In the prior art, the output data of different systems in the power system have different node names, which makes comprehensive data analysis difficult.

Method used

By obtaining the output data of different systems in the power system, matching node names using the longest common subsequence (LCS) algorithm, classifying nodes based on voltage level and type, and calculating association index and matching uniqueness index, node matching is achieved.

Benefits of technology

It improves the integration efficiency of different system data in the power system and solves the problem of difficulty in comprehensive data analysis caused by different node naming.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981488B_ABST
    Figure CN118981488B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for matching nodes of different systems based on the longest common subsequence, the method comprising: performing interface matching on the first target data in the format of the second target data to obtain the third target data; performing data parsing on the third target data and the second target data to obtain the fourth target data and the fifth target data; classifying the fourth target data and the fifth target data according to the node voltage level and the node type to obtain the first classification information and the second classification information; if they are consistent, determining the longest common subsequence between the first node name and the second node name through the LCS algorithm; calculating the association index and the matching uniqueness index based on each longest common subsequence, further calculating the node correlation, and completing the node matching based on the node correlation and the matching uniqueness index. This method solves the problem in the prior art that the output data of different systems have different node names, which makes data comprehensive analysis difficult.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, computer-readable storage medium, processor and power simulation system for matching different system nodes based on the longest common subsequence. Background Art

[0002] In today's highly information-based and automated power system environment, the DSP power system calculation and analysis software independently developed by the Southern Power Grid Research Institute plays a key role. DSP (Digital Signal Process) boasts powerful versatility, encompassing core power system calculation functions such as power flow calculation, electromechanical transient calculation, short-circuit current calculation, and dynamic equivalents, providing crucial support for power system simulation calculations.

[0003] The Operation Control System (OCS) within the integrated power grid operation intelligent system (OS2) plays a crucial role in daily dispatch and emergency response. Together with the OMS and POC / SOC, it forms an intelligent platform that comprehensively covers the entire grid operation and management process. The real-time and historical data in the OCS, with high minute-level accuracy, is crucial for guiding actual power system operations and decision-making analysis.

[0004] Although the DSP and OCS systems each perform different computational and analytical tasks, in actual power system operations, the combined results of both are needed for comparative analysis to better assist in grid operation decision-making. This is due to their different data sources: the DSP primarily collects typical data from historical or planning scenarios, while the OCS draws directly from the real-time dispatch database. Different staff members fill in the underlying data, resulting in different naming conventions, especially for nodes, making it impossible to compare and analyze the data one-to-one. Summary of the Invention

[0005] The main purpose of this application is to provide a method, device, computer-readable storage medium, processor and power simulation system for matching nodes of different systems based on the longest common subsequence, so as to at least solve the problem of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system in the prior art.

[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for matching different system nodes based on the longest common subsequence is provided, including: obtaining first target data and second target data, performing interface matching on the first target data in the format of the second target data to obtain third target data, the first target data and the second target data are output data of different systems in the power system, and the output data include node data, transformer data and line data; performing data parsing on the third target data and the second target data respectively to obtain fourth target data and fifth target data, the fourth target data includes the node name, node voltage level and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level and node type of the node in the second target data; matching the node in the fourth target data according to the node voltage level and the node type The nodes are classified to obtain first classification information, and the fifth target data is classified according to the node voltage level and the node type to obtain second classification information; when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, the longest common subsequence between the first node name and the second node name is determined by the LCS algorithm, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; according to each of the longest common subsequences, the association index and the matching uniqueness index between the corresponding first node name and the second node name are calculated, the node correlation is calculated according to the association index and the matching uniqueness index, and the node matching of each of the nodes in the fourth target data and the fifth target data is completed according to the node correlation and the matching uniqueness index.

[0007] Optionally, the nodes in the fourth target data are classified according to the node voltage level and the node type to obtain first classification information, including: classifying the nodes in the fourth target data according to the node voltage level to obtain third classification information; classifying the nodes according to the node type under each category in the third classification information to obtain the first classification information, and the node type includes at least input nodes, effect nodes, delay nodes and output nodes.

[0008] Optionally, when the first classification information corresponding to the first node name is consistent with the first classification information corresponding to the second node name, the longest common subsequence between the first node name and the second node name is determined by the LCS algorithm, including: an acquisition step, acquiring any one of the first node names and determining it as the first target name, traversing the second classification information corresponding to each second node name according to the first classification information corresponding to the first target name, and determining the second target node name as the second target name when the first classification information and the second classification information are consistent; a backtracking step, constructing corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traversing the characters in the first target name and the corresponding second target names according to each of the two-dimensional arrays and updating the two-dimensional arrays, and backtracking according to each of the two-dimensional arrays to obtain the corresponding longest common subsequence; repeating the acquisition step and the backtracking step at least once in sequence until the longest common subsequence between all the first target names and the corresponding second target names is obtained.

[0009] Optionally, corresponding two-dimensional arrays are constructed according to the first target name and the corresponding second target names, the characters in the first target name and the corresponding second target names are traversed according to each of the two-dimensional arrays and the two-dimensional arrays are updated, and backtracking is performed according to each of the two-dimensional arrays to obtain the corresponding longest common subsequence, including: constructing a two-dimensional table with the characters in the first target name as row labels and the characters in the second target name as column labels to obtain the two-dimensional array; determining the first row and first column of the two-dimensional table as the initial position, and initializing the initial position coordinates to obtain target position information, and traversing each cell of the two-dimensional array in turn; when the characters corresponding to the first target name and the second target name in the cell are the same, updating the target position information and storing the target position information in the current cell; when the characters corresponding to the first target name and the second target name in the cell are different, determining the longest common subsequence according to the target position information.

[0010] Optionally, the association index and matching uniqueness index between the corresponding first node name and the second node name are calculated based on each of the longest common subsequences, including: obtaining a first preset parameter, calculating the ratio of each of the longest common subsequences to the first preset parameter to obtain the corresponding association index; obtaining a second preset parameter, recording the number of times the length of the longest common subsequence corresponding to the first node name is greater than the second preset parameter to obtain the matching uniqueness index corresponding to the first node name.

[0011] Optionally, calculating the node correlation according to the association index and the matching uniqueness index includes: calculating a ratio of the association index to the corresponding matching uniqueness index to obtain the node correlation.

[0012] Optionally, node matching of each of the nodes in the fourth target data and the fifth target data is completed according to the node correlation and the matching uniqueness index, including: when the node correlation index is 1, determining that the nodes corresponding to the first node name and the second node name are the same node; when the node correlation index is not 1 and the matching uniqueness index is 1, determining the node corresponding to the first node name and the node corresponding to the second node name as first similar nodes; when the node correlation index is not 1 and the matching uniqueness index is greater than 1, determining the node corresponding to the second node name with the largest node correlation and the node corresponding to the second node name as second similar nodes; when the matching uniqueness index is 0, determining that the node corresponding to the first node name has no corresponding node.

[0013] According to another aspect of the present application, a device for matching different system nodes based on the longest common subsequence is provided, the device comprising: an acquisition unit for acquiring first target data and second target data, performing interface matching on the first target data in the format of the second target data to obtain third target data, the first target data and the second target data being output data of different systems in the power system, the output data comprising node data, transformer data and line data; a parsing unit for performing data parsing on the third target data and the second target data respectively to obtain fourth target data and fifth target data, the fourth target data comprising the node name, node voltage level and node type of the node in the third target data, the fifth target data comprising the node name, node voltage level and node type of the node in the second target data; a classification unit for classifying the nodes in the fourth target data according to the node voltage level and the node type. The nodes are classified to obtain first classification information, and the fifth target data are classified according to the node voltage level and the node type to obtain second classification information; a determining unit is used to determine the longest common subsequence between the first node name and the second node name by an LCS algorithm when the first classification information corresponding to the first node name is consistent with the first classification information corresponding to the second node name, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; a matching unit is used to calculate the association index and the matching uniqueness index between the corresponding first node name and the second node name according to each of the longest common subsequences, calculate the node correlation according to the association index and the matching uniqueness index, and complete the node matching of each of the nodes in the fourth target data and the fifth target data according to the node correlation and the matching uniqueness index.

[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.

[0015] According to another aspect of the present application, a power simulation system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of the methods described.

[0016] Applying the technical solution of the present application, in a method for matching nodes of different systems based on the longest common subsequence, first, first target data and second target data are obtained, and the first target data is interface matched in the format of the second target data to obtain third target data, the first target data and the second target data are output data of different systems in the power system, and the output data include node data, transformer data and line data; then, the third target data and the second target data are respectively parsed to obtain fourth target data and fifth target data, the fourth target data include the node name, node voltage level and node type of the node in the third target data, and the fifth target data include the node name, node voltage level and node type of the node in the second target data; thereafter, the nodes in the fourth target data are classified according to the node voltage level and the node type. Obtain first classification information, and classify the fifth target data according to the node voltage level and the node type to obtain second classification information; then, when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name through the LCS algorithm, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; finally, calculate the association index and matching uniqueness index corresponding to the first node name and the second node name according to each of the longest common subsequences, calculate the node correlation according to the association index and the matching uniqueness index, and complete the node matching of each of the nodes in the fourth target data and the fifth target data according to the node correlation and the matching uniqueness index. The present application classifies nodes by the consistency of the voltage level and node type of each node in the power system, determines the longest common subsequence based on the node names corresponding to the nodes of the same type using the LCS algorithm, and matches the node names based on the longest common subsequence to complete the node matching in the data records of different systems, thereby improving the efficiency of data integration. This method solves the problem in the prior art of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 The following is a block diagram showing the hardware structure of a mobile terminal according to a method for matching nodes of different systems based on the longest common subsequence provided in an embodiment of the present application;

[0018] Figure 2 A schematic flow chart of a method for matching nodes of different systems based on the longest common subsequence according to an embodiment of the present application is shown;

[0019] Figure 3 A structural block diagram of a device for matching different system nodes based on the longest common subsequence provided according to an embodiment of the present application is shown.

[0020] The above drawings include the following reference numerals:

[0021] 102. Processor; 104. Memory; 106. Transmission device; 108. Input / output device. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] As introduced in the background technology, in the prior art, different systems in the power system output data have different names for the same node, which makes it difficult for staff to analyze. In order to solve the problem of difficulty in comprehensive data analysis caused by different node names for output data of different systems in the power system in the prior art, the embodiments of the present application provide a method, device, computer-readable storage medium, processor and power simulation system for matching different system nodes based on the longest common subsequence.

[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present invention.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal according to an embodiment of the present invention, which is a method for matching nodes of different systems based on the longest common subsequence. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.

[0028] The memory 104 can be used to store computer programs, such as software programs and modules of application software, such as the computer program corresponding to the device information display method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0029] In this embodiment, a method for matching different system nodes based on the longest common subsequence is provided, which runs on a mobile terminal, a computer terminal, or a similar computing device. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] Figure 2 Flowchart of the method for matching nodes of different systems based on the longest common subsequence according to an embodiment of the present application. Figure 2 As shown, the method includes the following steps:

[0031] Step S201: obtaining first target data and second target data, and performing interface matching on the first target data in the format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0032] Specifically, the first target data, namely the OCS system data (stored in text format and filled in using the CIM-E standard, including site information, transformer information, line information, etc., with a file suffix of "*.csv"), is obtained. The second target data, also stored in text format and including node information, transformer information, line information, etc., with a file suffix of "*.dat") is also obtained. The OCS system data is converted into DSP system data through interface matching to obtain the third target data.

[0033] Step S202: Parsing the third target data and the second target data to obtain fourth target data and fifth target data, respectively. The fourth target data includes the node name, node voltage level, and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level, and node type of the node in the second target data.

[0034] Specifically, the second target data and the third target data are respectively selected as input files and parsed according to the format specified by dat, and split into node name, node voltage level, node type and node remark information to obtain the fourth target data and the fifth target data.

[0035] Step S203, classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0036] Specifically, although different systems use different node naming methods, the voltage level and function type of the same node are definitely the same. Therefore, for large-scale OCS and DSP network data with thousands or even tens of thousands of nodes, this application first classifies the nodes according to node type and voltage level to improve matching efficiency, thereby obtaining the above-mentioned first classification information and the above-mentioned second classification information.

[0037] Step S204: when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name using an LCS algorithm, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0038] Specifically, the node names of nodes in the OCS and DSP systems under the same voltage level and node type are taken as input data, and the longest common subsequence between the two names is found using the LCS algorithm to obtain the longest common subsequence.

[0039] Step S205: Calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0040] Specifically, the association index and the matching uniqueness index are calculated based on the longest common subsequence, and the node correlation is calculated, and the node matching is completed based on the node correlation.

[0041] Through this embodiment, first, the first target data and the second target data are obtained, and the interface matching of the first target data is performed in the format of the second target data to obtain the third target data. The first target data and the second target data are output data of different systems in the power system, and the output data include node data, transformer data and line data; then, the third target data and the second target data are respectively parsed to obtain the fourth target data and the fifth target data, the fourth target data include the node name, node voltage level and node type of the node in the third target data, and the fifth target data include the node name, node voltage level and node type of the node in the second target data; thereafter, the nodes in the fourth target data are classified according to the node voltage level and the node type to obtain the first classification information, and according to the The node voltage level and the node type are used to classify the fifth target data to obtain second classification information; then, when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, the longest common subsequence between the first node name and the second node name is determined by the LCS algorithm, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; finally, the association index and the matching uniqueness index corresponding to the first node name and the second node name are calculated according to each of the longest common subsequences, the node correlation is calculated according to the association index and the matching uniqueness index, and the node matching of each of the above nodes in the fourth target data and the fifth target data is completed according to the node correlation and the matching uniqueness index. The present application classifies nodes by the consistency of the voltage level and node type of each node in the power system, determines the longest common subsequence based on the node names corresponding to the nodes of the same type using the LCS algorithm, and matches the node names based on the longest common subsequence to complete the node matching in the data records of different systems, thereby improving the efficiency of data integration. This method solves the problem in the prior art of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system.

[0042] In order to process the fourth target data and the fifth target data set, in an optional implementation manner, the step S203 includes:

[0043] Step S2031, classifying the nodes in the fourth target data according to the node voltage levels to obtain third classification information;

[0044] Specifically, the fourth target data is classified according to voltage levels. During the specific implementation process, it is first divided into four major types of nodes: 10kV and below, 110kV, 220kV, and 500kV and above.

[0045] Step S2032: Classify the nodes according to the node types in each category of the third classification information to obtain the first classification information. The node types at least include input nodes, effect nodes, delay nodes, and output nodes.

[0046] Specifically, based on the above voltage level classification, further classification is performed, that is, the nodes corresponding to the four voltage levels of 10kV and below, 110kV, 220kV, and 500kV and above are classified according to B node (input node), BE node (effect node), BD node (delay node), and BS node (output node) to obtain the above first classification information.

[0047] In order to obtain the longest common subsequence using the LCS algorithm, in an optional implementation, step S204 includes:

[0048] Step S2041, an acquisition step, acquiring any one of the first node names and determining it as the first target name, traversing the second classification information corresponding to each of the second node names based on the first classification information corresponding to the first target name, and determining the second target node name as the second target name when the first classification information and the second classification information are consistent;

[0049] Specifically, the first target name is determined based on any node name in the above-mentioned fourth target data, and further traversed in the above-mentioned fifth target data according to the first classification information corresponding to the first target name, and the node name with the same classification as the node, that is, the above-mentioned second classification information is consistent with the above-mentioned first classification information, is determined as the second target name.

[0050] Step S2042, a backtracking step, constructing corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traversing the characters in the first target name and the corresponding second target names according to the two-dimensional arrays and updating the two-dimensional arrays, and backtracking according to the two-dimensional arrays to obtain the corresponding longest common subsequence;

[0051] Specifically, according to the above-mentioned first target name and all corresponding second target names, corresponding two-dimensional arrays are constructed one by one, and the characters in the first target name and the second target name are traversed according to the two-dimensional array, and backtracking is performed according to the traversed two-dimensional array to obtain the above-mentioned longest common subsequence.

[0052] Step S2043 , repeating the above-mentioned obtaining step and the above-mentioned backtracking step at least once in sequence, until the above-mentioned longest common subsequence between all the above-mentioned first target names and the corresponding second target names is obtained.

[0053] Specifically, the above-mentioned acquisition step and backtracking step are repeated to complete the determination of the longest common subsequence between all first target names and corresponding second target names.

[0054] In order to construct the common subsequence according to the two-dimensional array, in an optional implementation, step S2042 includes:

[0055] Step S20421, constructing a two-dimensional table using the characters in the first target name as row labels and the characters in the second target name as column labels to obtain the two-dimensional array;

[0056] The LCS algorithm, which stands for the Longest Common Subsequence (LCS), is a computer science algorithm used to find the longest common subsequence between two or more sequences. The primary purpose of applying the LCS algorithm here is to achieve highly accurate node name matching within the DAT files of OCS and DSP system data sources, resolving issues with node name mismatches caused by different naming practices, such as keyword extraction and numbering.

[0057] Specifically, the LCS algorithm is usually implemented through dynamic programming. Let the number of characters in the first target name be m, and let the number of characters in the second target name be n. The two-dimensional table is traversed, and the intermediate results are stored in a two-dimensional array.

[0058] Step S20422: Determine the first row and first column of the two-dimensional table as the initial position, initialize the initial position coordinates to obtain target position information, and traverse each cell of the two-dimensional array in sequence;

[0059] Specifically, the two-dimensional array dp[i][j] represents the length of the longest common subsequence of the first i characters of sequence X and the first j characters of sequence Y. That is, the target position information mentioned above is initialized to dq[0][0] before starting the traversal.

[0060] Step S20423, when the characters corresponding to the first target name and the second target name in the cell are the same, updating the target position information and storing the target position information in the current cell;

[0061] Specifically, if X[i]==Y[j], that is, the current characters are the same, then dp[i][j]=dp[i-1][j-1]+1, and the above target position information is updated.

[0062] Step S20424, when the characters corresponding to the above-mentioned cell in the above-mentioned first target name and the above-mentioned second target name are different, determine the above-mentioned longest common subsequence according to the above-mentioned target position information.

[0063] Specifically, if X[i]!= Y[j], then dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]). By backtracking this two-dimensional array, a specific longest common subsequence can be restored.

[0064] In one embodiment, according to the naming specification of dat data nodes, the names of data nodes are all 8 bytes.

[0065] Generally speaking, the meanings of each byte are as follows:

[0066] The 1st - 2nd bytes: Usually form 1 Chinese character, representing the province where the node is located. For example, "粤" represents Guangdong, and "滇" represents Yunnan. Sometimes it also represents the node type. For example, "直" represents that the node is a DC node.

[0067] The 3rd - 6th bytes: Usually form 2 Chinese characters, representing the abbreviation of the node meaning. For example, "深圳" represents Shenzhen Substation.

[0068] The 7th - 8th bytes: Usually consist of 2 digits or 1 English letter + 1 digit, representing the voltage level + serial number of the node or the node type + serial number. For example: 21, 2 represents a 220kv node, and 1 represents the first node. G1, G represents a generator, representing the first generator.

[0069] In order to calculate the above-mentioned correlation index and the above-mentioned matching uniqueness index, in an optional embodiment, the above-mentioned step S205 includes:

[0070] Step S2051, obtain a first preset parameter, and calculate the ratio of each above-mentioned longest common subsequence to the above-mentioned first preset parameter to obtain the corresponding above-mentioned correlation index;

[0071] Specifically, let the above-mentioned first preset parameter be 8, and P1 represents the subsequence correlation index of two nodes. Then the method for calculating the above-mentioned correlation index is: P1 = length of the longest common subsequence / 8. For example, for two nodes in the OCS and DSP systems, "直云南51" and "直云南52", the length of the longest common subsequence is 7 bytes. Therefore, the subsequence correlation index P1 between these two nodes = 7 / 8 = 0.875.

[0072] Step S2052, obtain a second preset parameter, and record the number of lengths of the above-mentioned longest common subsequences corresponding to the above-mentioned first node name that are greater than the above-mentioned second preset parameter to obtain the above-mentioned matching uniqueness index corresponding to the above-mentioned first node name.

[0073] Specifically, let the second preset parameter be X, P2(X) represent the matching uniqueness index of the two nodes, X is the fault tolerance coefficient, that is, the minimum value of the longest common subsequence length, and P2(X) represents the number of nodes that meet the requirement of the longest common subsequence length ≥ X. For example, in the OCS system, if X=4, the similar nodes that meet the conditions are Zhiyunnan51, Zhiyunnan52, and Zhiguangxi51, and the corresponding matching uniqueness index P2(4) is 3.

[0074] In order to obtain the above node correlation, in an optional implementation, the above step S205 further includes:

[0075] Step S2053: Calculate the ratio of the above-mentioned association index and the corresponding above-mentioned matching uniqueness index to obtain the above-mentioned node correlation.

[0076] Specifically, let the node correlation be Q, Q(AB i )=P1 / P2(X),Q(AB i ) represents the node correlation between the first target name A and the corresponding i-th second target name B.

[0077] In order to complete node matching, in an optional implementation, the above step S205 further includes:

[0078] Step S2054: when the node correlation index is 1, determining that the nodes corresponding to the first node name and the second node name are the same node;

[0079] Specifically, if Q=1, it means that the node names are exactly the same and the matching is completed directly, that is, when the node correlation index is 1, it is determined that the nodes corresponding to the first node name and the second node name are the same node.

[0080] Step S2055: When the node correlation index is not 1 and the matching uniqueness index is 1, the node corresponding to the first node name and the node corresponding to the second node name are determined as first similar nodes;

[0081] Specifically, if P2(X)=1, but P1 is not equal to 1, the node is selected to complete the pre-matching, that is, when the above-mentioned node correlation index is not 1 and the above-mentioned matching uniqueness index is 1, the above-mentioned node corresponding to the above-mentioned first node name and the above-mentioned node corresponding to the above-mentioned second node name are determined as the first similar node.

[0082] Step S2056: When the node correlation index is not 1 and the matching uniqueness index is greater than 1, the node corresponding to the second node name having the greatest node correlation is determined as the second similar node.

[0083] Specifically, if P2(X)>1, the Q largest node is selected to complete the pre-matching, that is, when the above-mentioned node correlation index is not 1 and the above-mentioned matching uniqueness index is greater than 1, the above-mentioned node corresponding to the above-mentioned second node name with the largest correlation with the above-mentioned node is determined as the second similar node.

[0084] Step S2057: When the matching uniqueness index is 0, it is determined that the node corresponding to the first node name has no corresponding node.

[0085] Specifically, if P2(X)=0, it means that the node has no similar node. When the matching uniqueness index is 0, it is determined that the node corresponding to the first node name has no corresponding node.

[0086] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0087] The embodiment of the present application also provides a different system node matching device based on the longest common subsequence. It should be noted that the different system node matching device based on the longest common subsequence in the embodiment of the present application can be used to perform the different system node matching method based on the longest common subsequence provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the details that have been described will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0088] The following introduces the different system node matching device based on the longest common subsequence provided in the embodiment of the present application.

[0089] Figure 3 1 is a structural block diagram of a device for matching different system nodes based on the longest common subsequence according to an embodiment of the present application. Figure 3 As shown, the device includes:

[0090] an acquisition unit 10, configured to acquire first target data and second target data, and to obtain third target data by performing interface matching on the first target data in a format of the second target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0091] Specifically, the first target data, namely the OCS system data (stored in text format and filled in using the CIM-E standard, including site information, transformer information, line information, etc., with a file suffix of "*.csv"), is obtained. The second target data, also stored in text format and including node information, transformer information, line information, etc., with a file suffix of "*.dat") is also obtained. The OCS system data is converted into DSP system data through interface matching to obtain the third target data.

[0092] a parsing unit 20 configured to parse the third target data and the second target data to obtain fourth target data and fifth target data, respectively, wherein the fourth target data includes a node name, a node voltage level, and a node type of a node in the third target data, and the fifth target data includes the node name, the node voltage level, and the node type of the node in the second target data;

[0093] Specifically, the second target data and the third target data are respectively selected as input files and parsed according to the format specified by dat, and split into node name, node voltage level, node type and node remark information to obtain the fourth target data and the fifth target data.

[0094] a classification unit 30, configured to classify the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classify the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0095] Specifically, although different systems use different node naming methods, the voltage level and function type of the same node are definitely the same. Therefore, for large-scale OCS and DSP network data with thousands or even tens of thousands of nodes, this application first classifies the nodes according to node type and voltage level to improve matching efficiency, thereby obtaining the above-mentioned first classification information and the above-mentioned second classification information.

[0096] a determining unit 40 configured to determine, by an LCS algorithm, a longest common subsequence between the first node name and the second node name when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0097] Specifically, the node names of nodes in the OCS and DSP systems under the same voltage level and node type are taken as input data, and the longest common subsequence between the two names is found using the LCS algorithm to obtain the longest common subsequence.

[0098] The matching unit 50 is used to calculate the association index and the matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0099] Specifically, the association index and the matching uniqueness index are calculated based on the longest common subsequence, and the node correlation is calculated, and the node matching is completed based on the node correlation.

[0100] Through this embodiment, the acquisition unit acquires the first target data and the second target data, and performs interface matching on the first target data in the format of the second target data to obtain the third target data. The first target data and the second target data are output data of different systems in the power system, and the output data include node data, transformer data and line data; the parsing unit performs data parsing on the third target data and the second target data to obtain the fourth target data and the fifth target data respectively. The fourth target data includes the node name, node voltage level and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level and node type of the node in the second target data; the classification unit classifies the node in the fourth target data according to the node voltage level and the node type to obtain the first classification information, and the classification unit classifies the node according to the node voltage level and the node type to obtain the first classification information. The node voltage level and the node type are used to classify the fifth target data to obtain second classification information; the determination unit determines the longest common subsequence between the first node name and the second node name through the LCS algorithm when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; the matching unit calculates the association index and the matching uniqueness index between the first node name and the second node name according to each of the longest common subsequences, calculates the node correlation according to the association index and the matching uniqueness index, and completes the node matching of each of the nodes in the fourth target data and the fifth target data according to the node correlation and the matching uniqueness index. The present application classifies nodes by the consistency of the voltage level and node type of each node in the power system, determines the longest common subsequence based on the node names corresponding to the nodes of the same type using the LCS algorithm, and matches the node names based on the longest common subsequence to complete the node matching in the data records of different systems, thereby improving the efficiency of data integration. This method solves the problem in the prior art of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system.

[0101] In order to classify the fourth target data and the fifth target data set, in an optional embodiment, the classification unit includes:

[0102] a first classification module, configured to classify the nodes in the fourth target data according to the node voltage levels to obtain third classification information;

[0103] Specifically, the fourth target data is classified according to voltage levels. During the specific implementation process, it is first divided into four major types of nodes: 10kV and below, 110kV, 220kV, and 500kV and above.

[0104] The second classification module is used to classify the nodes according to the node types under each category in the third classification information to obtain the first classification information, where the node types at least include input nodes, effect nodes, delay nodes and output nodes.

[0105] Specifically, based on the above voltage level classification, further classification is performed, that is, the nodes corresponding to the four voltage levels of 10kV and below, 110kV, 220kV, and 500kV and above are classified according to B node (input node), BE node (effect node), BD node (delay node), and BS node (output node) to obtain the above first classification information.

[0106] In order to obtain the longest common subsequence by using the LCS algorithm, in an optional implementation manner, the determining unit includes:

[0107] a first acquisition module, configured to execute an acquisition step, acquire any first node name and determine it as a first target name, traverse the second classification information corresponding to each second node name according to the first classification information corresponding to the first target name, and determine the second target node name as a second target name when the first classification information and the second classification information are consistent;

[0108] Specifically, the first target name is determined based on any node name in the above-mentioned fourth target data, and further traversed in the above-mentioned fifth target data according to the first classification information corresponding to the first target name, and the node name with the same classification as the node, that is, the above-mentioned second classification information is consistent with the above-mentioned first classification information, is determined as the second target name.

[0109] a backtracking module, configured to execute a backtracking step, construct corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traverse the characters in the first target name and the corresponding second target names according to the two-dimensional arrays and update the two-dimensional arrays, and backtrack according to the two-dimensional arrays to obtain the corresponding longest common subsequence;

[0110] Specifically, according to the above-mentioned first target name and all corresponding second target names, corresponding two-dimensional arrays are constructed one by one, and the characters in the first target name and the second target name are traversed according to the two-dimensional array, and backtracking is performed according to the traversed two-dimensional array to obtain the above-mentioned longest common subsequence.

[0111] A repetition module is used to repeat the acquisition step and the backtracking step in sequence at least once until the longest common subsequence between all the first target names and the corresponding second target names is obtained.

[0112] Specifically, the above-mentioned acquisition step and backtracking step are repeated to complete the determination of the longest common subsequence between all first target names and corresponding second target names.

[0113] In order to construct the common subsequence according to the two-dimensional array, in an optional embodiment, the backtracking module includes:

[0114] a construction submodule, configured to construct a two-dimensional table using characters in the first target name as row labels and the characters in the second target name as column labels to obtain the two-dimensional array;

[0115] The LCS algorithm, which stands for the Longest Common Subsequence (LCS), is a computer science algorithm used to find the longest common subsequence between two or more sequences. The primary purpose of applying the LCS algorithm here is to achieve highly accurate node name matching within the DAT files of OCS and DSP system data sources, resolving issues with node name mismatches caused by different naming practices, such as keyword extraction and numbering.

[0116] Specifically, the LCS algorithm is usually implemented through dynamic programming. Let the number of characters in the first target name be m, and let the number of characters in the second target name be n. The two-dimensional table is traversed, and the intermediate results are stored in a two-dimensional array.

[0117] A traversal submodule, configured to determine the first row and first column of the two-dimensional table as the initial position, initialize the initial position coordinates to obtain target position information, and traverse each cell of the two-dimensional array in sequence;

[0118] Specifically, the two-dimensional array dp[i][j] represents the length of the longest common subsequence of the first i characters of sequence X and the first j characters of sequence Y. That is, the target position information mentioned above is initialized to dq[0][0] before starting the traversal.

[0119] an updating submodule, configured to update the target position information and store the target position information in a current cell when the characters corresponding to the first target name and the second target name of the cell are the same;

[0120] Specifically, if X[i] == Y[j], that is, the current characters are the same, then dp[i][j] = dp[i - 1][j - 1] + 1, and the above target position information is updated.

[0121] A determination sub-module, configured to determine the longest common subsequence according to the target position information when the characters corresponding to the cell in the first target name and the second target name are different.

[0122] Specifically, if X[i]!= Y[j], then dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]). By backtracking this two-dimensional array, a specific longest common subsequence can be restored.

[0123] In one embodiment, according to the naming specification of the dat data node, the data node naming is all 8 bytes.

[0124] Generally speaking, the meanings of each byte are as follows:

[0125] The 1st - 2nd bytes: Usually form 1 Chinese character, representing the province where the node is located. For example, '粤' represents Guangdong, '滇' represents Yunnan, and sometimes it also represents the node type. For example, '直' represents that the node is a DC node.

[0126] The 3rd - 6th bytes: Usually form 2 Chinese characters, representing the abbreviation of the node meaning. For example, '深圳' represents Shenzhen Substation.

[0127] The 7th - 8th bytes: Usually consist of 2 digits or 1 English letter + 1 digit, representing the voltage level + serial number of the node or the node type + serial number. For example: 21, 2 represents a 220kv node, 1 represents the first node. G1, G represents a generator, representing the first generator.

[0128] In order to calculate the above - mentioned association index and the above - mentioned matching uniqueness index, in an optional embodiment, the above - mentioned matching unit includes:

[0129] A second acquisition module, configured to acquire a first preset parameter, and calculate the ratio of each of the longest common subsequences to the first preset parameter to obtain the corresponding association index;

[0130] Specifically, let the above - mentioned first preset parameter be 8, and P1 represents the subsequence association index of two nodes. Then the method for calculating the above - mentioned association index is: P1 = length of the longest common subsequence / 8. For example, for two nodes in the OCS and DSP systems, '直云南51' and '直云南52', the length of the longest common subsequence is 7 bytes. Therefore, the subsequence association index P1 between these two nodes = 7 / 8 = 0.875.

[0131] The third acquisition module is used to obtain a second preset parameter, record the number of times the length of the longest common subsequence corresponding to the first node name is greater than the second preset parameter, and obtain the matching uniqueness index corresponding to the first node name.

[0132] Specifically, let the second preset parameter be X, P2(X) represent the matching uniqueness index of the two nodes, X is the fault tolerance coefficient, that is, the minimum value of the longest common subsequence length, and P2(X) represents the number of nodes that meet the requirement of the longest common subsequence length ≥ X. For example, in the OCS system, if X=4, the similar nodes that meet the conditions are Zhiyunnan51, Zhiyunnan52, and Zhiguangxi51, and the corresponding matching uniqueness index P2(4) is 3.

[0133] In order to obtain the above-mentioned node correlation, in an optional implementation manner, the above-mentioned matching unit further includes:

[0134] The calculation module is used to calculate the ratio of the association index to the corresponding matching uniqueness index to obtain the node correlation.

[0135] Specifically, let the node correlation be Q, Q(AB i )=P1 / P2(X),Q(AB i ) represents the node correlation between the first target name A and the corresponding i-th second target name B.

[0136] In order to complete node matching, in an optional implementation manner, the matching unit further includes:

[0137] a first determining module, configured to determine, when the node correlation index is 1, that the nodes corresponding to the first node name and the second node name are the same node;

[0138] Specifically, if Q=1, it means that the node names are exactly the same and the matching is completed directly, that is, when the node correlation index is 1, it is determined that the nodes corresponding to the first node name and the second node name are the same node.

[0139] a second determining module, configured to, when the node correlation index is not 1 and the matching uniqueness index is 1, determine the node corresponding to the first node name and the node corresponding to the second node name as first similar nodes;

[0140] Specifically, if P2(X)=1, but P1 is not equal to 1, the node is selected to complete the pre-matching, that is, when the node correlation index is not 1 and the matching uniqueness index is 1, the node corresponding to the first node name and the node corresponding to the second node name are determined as the first similar nodes.

[0141] a third determining module, configured to, when the node correlation index is not 1 and the matching uniqueness index is greater than 1, determine the node corresponding to the second node name having the greatest node correlation as the second similar node;

[0142] Specifically, if P2(X)>1, the Q largest node is selected to complete the pre-matching, that is, when the node correlation index is not 1 and the matching uniqueness index is greater than 1, the node corresponding to the second node name with the largest node correlation is determined to be the second similar node.

[0143] The fourth determining module is configured to determine, when the matching uniqueness index is 0, that the node corresponding to the first node name has no corresponding node.

[0144] Specifically, if P2(X)=0, it means that the node has no similar node. When the matching uniqueness index is 0, it is determined that the node corresponding to the first node name has no corresponding node.

[0145] The apparatus for matching nodes in different systems based on the longest common subsequence includes a processor and memory. The acquisition unit, parsing unit, classification unit, determination unit, and matching unit are all stored as program units in the memory, and the processor executes the program units stored in the memory to implement the corresponding functions. All of the above modules are located in the same processor; alternatively, the above modules can be located in different processors in any combination.

[0146] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the efficiency of node matching can be improved by adjusting the kernel parameters.

[0147] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0148] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program. When the program is run, the device where the computer-readable storage medium is located is controlled to execute the method for matching different system nodes based on the longest common subsequence.

[0149] Specifically, different system node matching methods based on the longest common subsequence include:

[0150] Step S201: obtaining first target data and second target data, and performing interface matching on the first target data in the format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0151] Specifically, the first target data, namely the OCS system data (stored in text format and filled in using the CIM-E standard, including site information, transformer information, line information, etc., with a file suffix of "*.csv"), is obtained. The second target data, also stored in text format and including node information, transformer information, line information, etc., with a file suffix of "*.dat") is also obtained. The OCS system data is converted into DSP system data through interface matching to obtain the third target data.

[0152] Step S202: Parsing the third target data and the second target data to obtain fourth target data and fifth target data, respectively. The fourth target data includes the node name, node voltage level, and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level, and node type of the node in the second target data.

[0153] Specifically, the second target data and the third target data are respectively selected as input files and parsed according to the format specified by dat, and split into node name, node voltage level, node type and node remark information to obtain the fourth target data and the fifth target data.

[0154] Step S203, classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0155] Specifically, although different systems use different node naming methods, the voltage level and function type of the same node are definitely the same. Therefore, for large-scale OCS and DSP network data with thousands or even tens of thousands of nodes, this application first classifies the nodes according to node type and voltage level to improve matching efficiency, thereby obtaining the above-mentioned first classification information and the above-mentioned second classification information.

[0156] Step S204: when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name using an LCS algorithm, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0157] Specifically, the node names of nodes in the OCS and DSP systems under the same voltage level and node type are taken as input data, and the longest common subsequence between the two names is found using the LCS algorithm to obtain the longest common subsequence.

[0158] Step S205: Calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0159] Specifically, the association index and the matching uniqueness index are calculated based on the longest common subsequence, and the node correlation is calculated, and the node matching is completed based on the node correlation.

[0160] An embodiment of the present invention provides a processor, which is used to run a program, wherein the program executes the above-mentioned method for matching nodes of different systems based on the longest common subsequence when running.

[0161] Specifically, different system node matching methods based on the longest common subsequence include:

[0162] Step S201: obtaining first target data and second target data, and performing interface matching on the first target data in the format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0163] Specifically, the first target data, namely the OCS system data (stored in text format and filled in using the CIM-E standard, including site information, transformer information, line information, etc., with a file suffix of "*.csv"), is obtained. The second target data, also stored in text format and including node information, transformer information, line information, etc., with a file suffix of "*.dat") is also obtained. The OCS system data is converted into DSP system data through interface matching to obtain the third target data.

[0164] Step S202: Parsing the third target data and the second target data to obtain fourth target data and fifth target data, respectively. The fourth target data includes the node name, node voltage level, and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level, and node type of the node in the second target data.

[0165] Specifically, the second target data and the third target data are respectively selected as input files and parsed according to the format specified by dat, and split into node name, node voltage level, node type and node remark information to obtain the fourth target data and the fifth target data.

[0166] Step S203, classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0167] Specifically, although different systems use different node naming methods, the voltage level and function type of the same node are definitely the same. Therefore, for large-scale OCS and DSP network data with thousands or even tens of thousands of nodes, this application first classifies the nodes according to node type and voltage level to improve matching efficiency, thereby obtaining the above-mentioned first classification information and the above-mentioned second classification information.

[0168] Step S204: when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name using an LCS algorithm, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0169] Specifically, the node names of nodes in the OCS and DSP systems under the same voltage level and node type are taken as input data, and the longest common subsequence between the two names is found using the LCS algorithm to obtain the longest common subsequence.

[0170] Step S205: Calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0171] Specifically, the association index and the matching uniqueness index are calculated based on the longest common subsequence, and the node correlation is calculated, and the node matching is completed based on the node correlation.

[0172] An embodiment of the present invention provides a power simulation system. The power simulation system includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, at least the following steps are performed:

[0173] Step S201: obtaining first target data and second target data, and performing interface matching on the first target data in the format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0174] Step S202: Parsing the third target data and the second target data to obtain fourth target data and fifth target data, respectively. The fourth target data includes the node name, node voltage level, and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level, and node type of the node in the second target data.

[0175] Step S203, classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0176] Step S204: when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name using an LCS algorithm, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0177] Step S205: Calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0178] The present application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program for initializing at least the following method steps:

[0179] Step S201: obtaining first target data and second target data, and performing interface matching on the first target data in the format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data;

[0180] Step S202: Parsing the third target data and the second target data to obtain fourth target data and fifth target data, respectively. The fourth target data includes the node name, node voltage level, and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level, and node type of the node in the second target data.

[0181] Step S203, classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information;

[0182] Step S204: when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determine the longest common subsequence between the first node name and the second node name using an LCS algorithm, where the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data;

[0183] Step S205: Calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the above-mentioned longest common subsequences, calculate the node correlation based on the above-mentioned association index and the above-mentioned matching uniqueness index, and complete the node matching of each of the above-mentioned nodes in the above-mentioned fourth target data and the above-mentioned fifth target data based on the above-mentioned node correlation and the above-mentioned matching uniqueness index.

[0184] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

[0185] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0186] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0187] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0189] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0190] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0191] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0192] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

[0193] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0194] 1) The different system node matching method based on the longest common subsequence of the present application, first, obtain the first target data and the second target data, perform interface matching on the above-mentioned first target data in the format of the above-mentioned second target data to obtain the third target data, the above-mentioned first target data and the above-mentioned second target data are output data of different systems in the power system, and the above-mentioned output data include node data, transformer data and line data; then, the above-mentioned third target data and the above-mentioned second target data are respectively parsed to obtain the fourth target data and the fifth target data, the above-mentioned fourth target data include the node name, node voltage level and node type of the node in the above-mentioned third target data, and the above-mentioned fifth target data include the above-mentioned node name, the above-mentioned node voltage level and the above-mentioned node type in the above-mentioned second target data; then, the above-mentioned nodes in the above-mentioned fourth target data are classified according to the above-mentioned node voltage level and the above-mentioned node type to obtain the fourth target data. A classification information is provided, wherein the fifth target data is classified according to the node voltage level and the node type to obtain the second classification information; thereafter, when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, the longest common subsequence between the first node name and the second node name is determined by the LCS algorithm, wherein the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; finally, the association index and the matching uniqueness index corresponding to the first node name and the second node name are calculated according to each of the longest common subsequences, the node correlation is calculated according to the association index and the matching uniqueness index, and the node matching of each of the above nodes in the fourth target data and the fifth target data is completed according to the node correlation and the matching uniqueness index. The present application classifies nodes by the consistency of the voltage level and node type of each node in the power system, determines the longest common subsequence based on the node names corresponding to the nodes of the same type using the LCS algorithm, and matches the node names based on the longest common subsequence to complete the node matching in the data records of different systems, thereby improving the efficiency of data integration. This method solves the problem in the prior art of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system.

[0195] 2) The different system node matching device based on the longest common subsequence of the present application, the acquisition unit acquires the first target data and the second target data, performs interface matching on the first target data in the format of the second target data to obtain the third target data, the first target data and the second target data are output data of different systems in the power system, and the output data include node data, transformer data and line data; the parsing unit performs data parsing on the third target data and the second target data respectively to obtain the fourth target data and the fifth target data, the fourth target data includes the node name, node voltage level and node type of the node in the third target data, and the fifth target data includes the node name, node voltage level and node type of the node in the second target data; the classification unit classifies the nodes in the fourth target data according to the node voltage level and the node type to obtain The first classification information is used to classify the fifth target data according to the node voltage level and the node type to obtain the second classification information; the determination unit determines the longest common subsequence between the first node name and the second node name through the LCS algorithm when the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; the matching unit calculates the association index and the matching uniqueness index corresponding to the first node name and the second node name according to each of the longest common subsequences, calculates the node correlation according to the association index and the matching uniqueness index, and completes the node matching of each of the above nodes in the fourth target data and the fifth target data according to the node correlation and the matching uniqueness index. The present application classifies nodes by the consistency of the voltage level and node type of each node in the power system, determines the longest common subsequence based on the node names corresponding to the nodes of the same type using the LCS algorithm, and matches the node names based on the longest common subsequence to complete the node matching in the data records of different systems, thereby improving the efficiency of data integration. This method solves the problem in the prior art of difficulty in comprehensive data analysis caused by different node naming of output data of different systems in the power system.

[0196] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.

Claims

1. A method for matching nodes of different systems based on the longest common subsequence, characterized in that: include: Acquire first target data and second target data, and perform interface matching on the first target data in a format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in a power system, and the output data includes node data, transformer data, and line data; performing data parsing on the third target data and the second target data respectively to obtain fourth target data and fifth target data, the fourth target data including a node name, a node voltage level, and a node type of a node in the third target data, and the fifth target data including the node name, the node voltage level, and the node type of the node in the second target data; classifying the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classifying the fifth target data according to the node voltage level and the node type to obtain second classification information; When the first classification information corresponding to the first node name is consistent with the second classification information corresponding to the second node name, determining the longest common subsequence between the first node name and the second node name by using the LCS algorithm, including: an acquisition step of acquiring any one of the first node names and determining it as a first target name, traversing the second classification information corresponding to each second node name according to the first classification information corresponding to the first target name, and when the first classification information and the second classification information are consistent, determining the second target node name as the second target name; A backtracking step, constructing corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traversing the characters in the first target name and the corresponding second target names according to each of the two-dimensional arrays and updating the two-dimensional arrays, and backtracking according to each of the two-dimensional arrays to obtain the corresponding longest common subsequence; repeating the obtaining step and the backtracking step at least once in sequence until the longest common subsequence between all the first target names and the corresponding second target names is obtained, the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; According to each of the longest common subsequences, the association index and the matching uniqueness index between the corresponding first node name and the second node name are calculated, the node correlation is calculated according to the association index and the matching uniqueness index, and the node matching of each of the nodes in the fourth target data and the fifth target data is completed according to the node correlation and the matching uniqueness index.

2. The method according to claim 1, characterized in that Classifying the nodes in the fourth target data according to the node voltage levels and the node types to obtain first classification information includes: classifying the nodes in the fourth target data according to the node voltage levels to obtain third classification information; The first classification information is obtained by classifying the nodes according to the node types under each category in the third classification information, where the node types at least include input nodes, effect nodes, delay nodes, and output nodes.

3. The method according to claim 1, characterized in that Constructing corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traversing the characters in the first target name and the corresponding second target names according to the two-dimensional arrays and updating the two-dimensional arrays, and backtracking according to the two-dimensional arrays to obtain the corresponding longest common subsequence, including: constructing a two-dimensional table using the characters in the first target name as row labels and the characters in the second target name as column labels to obtain the two-dimensional array; Determine the first row and first column of the two-dimensional table as the initial position, initialize the initial position coordinates to obtain target position information, and traverse each cell of the two-dimensional array in sequence; If the characters corresponding to the first target name and the second target name in the cell are the same, updating the target position information and storing the target position information in the current cell; In a case where the characters corresponding to the cells in the first target name and the second target name are different, the longest common subsequence is determined according to the target position information.

4. The method according to claim 1, wherein Calculating the association index and the matching uniqueness index between the first node name and the second node name according to each of the longest common subsequences includes: Obtaining a first preset parameter, and calculating a ratio of each of the longest common subsequences to the first preset parameter to obtain the corresponding correlation index; A second preset parameter is obtained, and the number of times the length of the longest common subsequence corresponding to the first node name is greater than the second preset parameter is recorded to obtain the matching uniqueness index corresponding to the first node name.

5. The method according to claim 1, wherein Calculating node relevance according to the association index and the matching uniqueness index includes: The node correlation is obtained by calculating a ratio of the association index to the corresponding matching uniqueness index.

6. The method according to claim 5, characterized in that Completing node matching of each of the nodes in the fourth target data and the fifth target data according to the node correlation and the matching uniqueness index includes: When the node correlation index is 1, determining that the nodes corresponding to the first node name and the second node name are the same node; When the node correlation index is not 1 and the matching uniqueness index is 1, determining the node corresponding to the first node name and the node corresponding to the second node name as first similar nodes; When the node correlation index is not 1 and the matching uniqueness index is greater than 1, determining the node corresponding to the second node name having the greatest node correlation and the node corresponding to the second node name as the second similar node; When the matching uniqueness index is 0, it is determined that the node corresponding to the first node name has no corresponding node.

7. A device for matching nodes of different systems based on the longest common subsequence, characterized in that: The device comprises: an acquisition unit, configured to acquire first target data and second target data, and perform interface matching on the first target data in a format of the second target data to obtain third target data, wherein the first target data and the second target data are output data of different systems in the power system, and the output data includes node data, transformer data, and line data; a parsing unit, configured to parse the third target data and the second target data respectively to obtain fourth target data and fifth target data, wherein the fourth target data includes a node name, a node voltage level, and a node type of a node in the third target data, and the fifth target data includes the node name, the node voltage level, and the node type of the node in the second target data; a classification unit, configured to classify the nodes in the fourth target data according to the node voltage level and the node type to obtain first classification information, and classify the fifth target data according to the node voltage level and the node type to obtain second classification information; a determination unit, configured to determine, by an LCS algorithm, the longest common subsequence between the first node name and the second node name when the first classification information corresponding to the first node name is consistent with the first classification information corresponding to the second node name, wherein the determination unit is further configured to perform an acquisition step, acquire any one of the first node names and determine it as a first target name, traverse the second classification information corresponding to each second node name according to the first classification information corresponding to the first target name, and determine the second target node name as the second target name when the first classification information and the second classification information are consistent; and further configured to perform a backtracking step, construct corresponding two-dimensional arrays according to the first target name and the corresponding second target names, traverse the characters in the first target name and the corresponding second target names according to each of the two-dimensional arrays and update the two-dimensional arrays, and backtrack according to each of the two-dimensional arrays to obtain the corresponding longest common subsequence; and further configured to repeat the acquisition step and the backtracking step at least once in sequence until the longest common subsequence between all the first target names and the corresponding second target names is obtained, wherein the first node name is the node name of the node in the fourth target data, and the second node name is the node name of the node in the fifth target data; A matching unit is used to calculate the association index and matching uniqueness index between the corresponding first node name and the second node name based on each of the longest common subsequences, calculate the node correlation based on the association index and the matching uniqueness index, and complete the node matching of each of the nodes in the fourth target data and the fifth target data based on the node correlation and the matching uniqueness index.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 6.

9. A power simulation system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for executing the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and device for determining longest common subsequence

    CN106777920A

  • Remote meter reading abnormity monitoring method, gas meter system and gas cloud platform

    CN112307084A