A method, system, device and medium for SCD file-based protection configuration comparison and consistency checking
By constructing a structured data model through XML parsing and hash comparison, and combining it with a hierarchical verification model and risk assessment, the problems of low efficiency in SCD file comparison and strong subjectivity in risk assessment in existing technologies are solved, thereby realizing the automation and security improvement of intelligent substation configuration management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- YUNNAN POWER GRID CO LTD
- Filing Date
- 2026-03-31
- Publication Date
- 2026-06-16
AI Technical Summary
The existing SCD file comparison mainly relies on manual labor and simple check codes, which is inefficient, unable to locate specific change points, and lacks automated risk assessment capabilities, resulting in low efficiency in the configuration management of smart substations and difficulty in timely warning of safety hazards.
A structured data model is constructed through XML parsing and normalization. Depth-first search and hash comparison algorithms are used to identify configuration changes. A hierarchical verification model is built for difference analysis. Consistency is verified through a check code mechanism. Pre-set risk mapping rules are used for automated risk assessment.
It enables automated identification and location of configuration differences in SCD files, improving the accuracy, efficiency, and security of intelligent substation configuration management, and providing timely risk warnings and decision support.
Smart Images

Figure CN122021604B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, and in particular to a method, system, device and medium for protection configuration comparison and consistency verification based on SCD files. Background Technology
[0002] As a crucial direction for the intelligent development of power grids, smart substations typically utilize Smart Substation Configuration Description Files (SCDs) for unified description and management of their system configurations. As the sole data source for the entire substation, conforming to the IEC 61850 standard, the SCD fully defines the communication parameters, functional logic, and virtual loop connections of the intelligent electronic devices (IEDs) within the substation. Throughout the entire lifecycle of a smart substation, the SCD undergoes multiple version iterations due to equipment replacement, functional expansion, and defect rectification. Efficiently and accurately identifying configuration differences between different versions of the SCD and ensuring that the actual configuration of the equipment in operation matches the SCD design has become a critical technical aspect for guaranteeing the safe and stable operation of smart substations.
[0003] Currently, the industry still faces technical shortcomings in the comparison and consistency verification of SCD files. Existing comparison methods mainly rely on manual verification and simple file checksums, such as MD5 comparison. Manual comparison is inefficient and prone to omissions, while full file checksum comparison can only determine whether the file has changed, but cannot pinpoint the specific changes, let alone achieve differentiated presentation and impact analysis at different levels. In addition, existing technologies lack the ability to automatically assess the risks of configuration differences. After identifying differences, it is still necessary to rely on the manual experience of maintenance personnel to judge the system risks caused, such as protection malfunctions or failures to operate. The assessment process is highly subjective, inefficient, and it is difficult to ensure the consistency of assessment standards, failing to provide timely and accurate risk warnings and decision support for on-site maintenance. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a protection configuration comparison and consistency verification method, system, device, and medium based on SCD files to solve the problems of existing SCD file comparison mainly relying on manual labor and simple check codes, which is inefficient and cannot locate specific change points, let alone achieve hierarchical difference analysis; at the same time, it lacks automatic risk assessment capabilities, relies on manual experience to judge risks, which is highly subjective, inefficient, and difficult to provide timely warnings of security risks caused by configuration changes.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] In a first aspect, the present invention provides a method for comparing and verifying the consistency of protection configurations based on SCD files, including:
[0008] The benchmark SCD file and the configuration file to be verified are parsed separately to obtain the structured data model;
[0009] The structured data model is processed by a structured comparison algorithm to output an initial set of differences.
[0010] A hierarchical verification model is constructed, and the initial set of differences is hierarchically analyzed using the hierarchical verification model to obtain the analyzed set of differences;
[0011] The discriminant set is verified by comparing the checksums, and the discriminant set is updated based on the verification results to obtain the final discriminant set.
[0012] A risk mapping rule is preset, and a risk assessment is performed on the final difference set to generate a risk assessment result.
[0013] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the step of obtaining the structured data model includes:
[0014] Read the raw data of the benchmark SCD file and the configuration file to be verified to obtain a file data stream;
[0015] The file data stream is parsed using an XML parsing library to obtain an initial XML document object model;
[0016] The initial XML document object model is normalized to obtain a normalized XML tree model, which is then used as a structured data model.
[0017] The beneficial effects of this preferred technical solution are as follows: by parsing and standardizing XML, the SCD configuration file is converted into a standardized XML tree model with a unified structure, which eliminates non-substantive differences, ensures the consistency of subsequent comparison benchmarks, provides a data foundation for structured comparison algorithms, improves the accuracy and reliability of difference identification, and avoids misjudgments caused by differences in file formats.
[0018] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the structured comparison algorithm includes:
[0019] The SCL elements in the structured data model are traversed using a depth-first search method, and the hash value of each SCL element in the structured data model is calculated.
[0020] By comparing the hash value of the corresponding SCL element in the benchmark SCD file with the hash value of the corresponding SCL element in the configuration file to be verified;
[0021] When the hash value of the corresponding SCL element in the benchmark SCD file is inconsistent with the hash value of the corresponding SCL element in the configuration file to be verified, it indicates that the SCL element has changed; when they are consistent, the comparison continues.
[0022] The SCL element that changes will be used as the target SCL element.
[0023] The beneficial effects of this preferred technical solution are as follows: By combining depth-first search with a hash comparison algorithm, rapid comparison of SCL elements is achieved. Recursive traversal ensures that no configuration item is missed, and the hash comparison algorithm effectively identifies subtle changes, improving the automation and accuracy of difference identification and providing a reliable data foundation for subsequent hierarchical analysis and risk assessment.
[0024] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the step of processing the structured data model and outputting an initial set of differences includes:
[0025] Determine the hierarchical position information of the target SCL element in the structured data model;
[0026] When the hierarchical position information of the target SCL element changes, record the change details and label the change type according to the change details;
[0027] An initial difference set is generated based on the target SCL element, its corresponding hierarchical position information, and its change type.
[0028] The beneficial effects of this preferred technical solution are as follows: by establishing an initial set of differences that includes target SCL elements, hierarchical location information and change types, the location and recording of configuration differences are realized. This not only fully preserves the contextual information of all difference SCL elements, but also provides a data foundation for subsequent hierarchical analysis and risk assessment, thereby improving the standardization and traceability of configuration comparison work.
[0029] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the step of performing hierarchical analysis to obtain the set of differences includes:
[0030] A hierarchical verification model is constructed by means of interval level, device level and virtual loop level;
[0031] The hierarchical classification results are obtained by classifying the target SCL elements in the initial difference set using the hierarchical verification model.
[0032] Based on the hierarchical position information of the target SCL element, the impact of the target SCL element on the interval configuration structure, the impact on the equipment configuration parameters, and the impact on the virtual loop connection relationship are evaluated to obtain the impact analysis results.
[0033] The hierarchical classification results and influence analysis results are correlated with the initial difference set to obtain the discriminative difference set.
[0034] The beneficial effects of this preferred technical solution are as follows: by constructing a hierarchical verification model with three layers—interval level, equipment level, and virtual loop level—structured classification and impact analysis of configuration differences are realized, the system level at which configuration differences are located is identified, and the impact on the interval configuration structure, equipment configuration parameters, and virtual loop connection relationships is clearly assessed, thereby improving the location efficiency and risk assessment capability.
[0035] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the step of obtaining the final difference set includes:
[0036] When the check codes do not match, the structured comparison algorithm is triggered to execute for the configuration range of the field line protection device in the reference SCD file.
[0037] The structured comparison algorithm is used to locate the abnormal SCL element that causes the checksum inconsistency.
[0038] The abnormal SCL elements, their corresponding hierarchical location information, and change types are added to the discriminative difference set to obtain the final difference set.
[0039] The beneficial effects of this preferred technical solution are as follows: by triggering the comparison mechanism through the check code, abnormal SCL elements in the field line protection device can be quickly located when inconsistencies are found, avoiding the resource consumption of full comparison. The located abnormal SCL elements, corresponding hierarchical location information and change type are added to the analysis difference set, ensuring the integrity and accuracy of the difference information between the field line protection device and the reference SCD file.
[0040] As a preferred embodiment of the protection configuration comparison and consistency verification method based on SCD files described in this invention, the step of generating risk assessment results includes:
[0041] Iterate through the anomalous SCL elements in the final difference set;
[0042] A risk level is preset for the combination of hierarchical location information and change type. The abnormal SCL element is matched with the risk level to obtain the matching result.
[0043] Based on the matching results, a risk level is assigned to each abnormal SCL element and a risk description is generated to obtain the risk assessment results.
[0044] Summarize the risk assessment results of all abnormal SCL elements and generate a risk assessment report.
[0045] The beneficial effects of this preferred technical solution are as follows: by establishing risk mapping rules based on hierarchical location information and change type, the automated and standardized assessment of configuration difference risks is realized, which effectively solves the subjectivity and inconsistency problems of traditional manual risk assessment, provides quantitative basis for operation and maintenance decisions, and improves the efficiency and reliability of configuration safety management of smart substations.
[0046] Secondly, the present invention provides a protection configuration comparison and consistency verification system based on SCD files, including:
[0047] The configuration file parsing module is used to parse the baseline SCD file and the configuration file to be verified respectively to obtain a structured data model;
[0048] The initial difference comparison module is used to process the structured data model through a structured comparison algorithm and output an initial difference set;
[0049] The hierarchical analysis module is used to perform hierarchical analysis on the initial difference set through a preset hierarchical verification model to obtain the analyzed difference set.
[0050] The consistency verification module is used to perform consistency verification when the configuration file to be verified comes from the field line protection device, and to trigger the structured comparison algorithm to locate configuration differences when the check code does not match, and update the set of identified differences to obtain the final set of differences;
[0051] The risk assessment module is used to perform risk assessment on the final difference set based on preset risk mapping rules and generate a risk assessment report.
[0052] Thirdly, the present invention provides an electronic device, comprising:
[0053] Memory and processor;
[0054] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of a protection configuration comparison and consistency verification method based on SCD files.
[0055] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the protection configuration comparison and consistency verification method based on SCD files.
[0056] Compared with existing technologies, the beneficial effects of this invention are as follows: automatic identification of configuration differences is achieved through a structured comparison algorithm; the scope of influence of configuration differences is located by combining a hierarchical verification model at the bay level, equipment level, and virtual circuit level; the consistency verification of on-site line protection device configuration is achieved by using a check code mechanism; and risk assessment is carried out by pre-setting risk mapping rules, thereby improving the accuracy, efficiency, and security of intelligent substation configuration management. Attached Figure Description
[0057] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is a schematic diagram of the overall process of a protection configuration comparison and consistency verification method based on SCD files, provided in one embodiment of the present invention. Detailed Implementation
[0059] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0060] Example 1, referring to Figure 1 As an embodiment of the present invention, a method for comparing and verifying the consistency of protection configurations based on SCD files is provided, comprising:
[0061] S100: The baseline SCD file and the configuration file to be verified are parsed separately to obtain the structured data model.
[0062] S200. The structured data model is processed by a structured comparison algorithm to output an initial set of differences.
[0063] S300. Construct a hierarchical verification model, and perform hierarchical analysis on the initial difference set through the hierarchical verification model to obtain the analyzed difference set.
[0064] S400. The discriminant set is verified by comparing the check codes, and the discriminant set is updated according to the verification results to obtain the final discriminant set.
[0065] S500: Preset risk mapping rules, perform risk assessment on the final difference set, and generate risk assessment results.
[0066] It should be noted that existing SCD file comparison technology relies on manual verification and simple check code comparison, which has problems such as low efficiency, inability to locate specific changes, and lack of hierarchical difference analysis capabilities. At the same time, after identifying configuration differences, it still needs to rely on human experience for risk assessment, which has the defects of strong subjectivity, inconsistent standards, and inability to provide timely risk warnings.
[0067] Therefore, to address the issues of insufficient comparison accuracy, lack of hierarchical analysis, and automated risk assessment, the following steps (S100-S500) are employed: First, a structured data model is constructed through XML parsing and normalization. Next, a structured comparison algorithm is used to identify configuration changes and generate an initial set of differences. Then, a hierarchical verification model at the bay, equipment, and virtual circuit levels is constructed to achieve hierarchical identification and impact analysis. Subsequently, consistency verification is triggered by check codes to locate configuration differences in field line protection devices and update the set of identified differences. Finally, preset risk mapping rules are used to achieve automated risk assessment, forming a complete technical closed loop and improving the accuracy, efficiency, and security of intelligent substation configuration management.
[0068] Example 2, refer to Figure 1 As an embodiment of the present invention, based on the above embodiment, a method for comparing and verifying the protection configuration based on SCD files is provided.
[0069] In this application embodiment, taking the configuration change of line protection in a 220kV smart substation as the application scenario, step S100, the step of obtaining the structured data model includes A1~A3:
[0070] A1. Read the original data of the benchmark SCD file and the configuration file to be verified to obtain the file data stream.
[0071] Specifically, the v2.1 version SCD file stored locally is read in binary mode using Python's open() function as the base SCD file, and the configuration description file of the intelligent electronic device (IED) exported from the field line protection device (referred to as the CID file) is read as the configuration file to be verified, thus obtaining the file data stream.
[0072] A2. Use an XML parsing library to parse the file data stream to obtain an initial XML document object model.
[0073] Specifically, the file data stream is parsed using the etree.parse() method in Python's lxml library. etree.parse() is the parsing method in the etree module of the lxml library. It preserves the hierarchical structure of the base SCD file and obtains the initial Extensible Markup Language Document Object Model, which conforms to the IEC61850SCL standard, or simply the initial XML Document Object Model.
[0074] A3. Normalize the initial XML document object model to obtain a normalized XML tree model, and use the normalized XML tree model as a structured data model.
[0075] Specifically, the initial XML document object model is normalized by using the strip_elements() method to remove comment information from the document. The strip_elements() method is used to remove elements. XML path language, or XPath expression for short, is used to locate and remove blank text content. The attributes of each smart substation configuration description language (SCL) element are rearranged by name to obtain a standardized XML tree model with a unified structure as the structured data model.
[0076] In an optional implementation, step S100 may further preprocess the file's encoding format before parsing. The steps are as follows: use a character encoding detection library, such as Python's chardet, to identify the character encoding format of the file data stream. chardet is a character encoding detection library used to identify the character encoding format used by the text data stream. When the detected character encoding format is inconsistent with the default format of the XML parser, the file data stream is converted to the UTF-8 standard encoding format. The converted standard encoding data stream is then repackaged into a new file data stream for subsequent parsing, avoiding XML parsing errors caused by encoding differences.
[0077] In another optional implementation, step S100 can also establish a parsing cache after generating the normalized XML tree model. The steps are as follows: generate the MD5 checksum of the baseline SCD file and the configuration file to be checked as a cache identifier; associate the normalized XML tree model with the corresponding cache identifier and store it in the memory database. When the same version of the file is processed again, the cached normalized XML tree model is called by matching the checksum, avoiding repeated parsing process and improving the efficiency of batch file processing.
[0078] In this embodiment of the application, step S200, which processes the structured data model and outputs an initial difference set, includes steps B1 to B3:
[0079] B1. Determine the hierarchical position information of the target SCL element in the structured data model.
[0080] Specifically, based on the node paths of the normalized XML tree model, a corresponding XPath path is generated for each target SCL element as hierarchical location information.
[0081] The target SCL elements are obtained through a structured alignment algorithm, with steps B1.1 to B1.4:
[0082] B1.1. Use a depth-first search method to traverse the SCL elements in the structured data model and calculate the hash value of each SCL element in the structured data model.
[0083] Specifically, a depth-first search is used to traverse the SCL elements in the normalized XML tree model. Based on the type of the SCL element, such as intelligent electronic device (IED), electrical bay (Bay), and connected access point (ConnectedAP), the hash value of each SCL element is calculated from the overall structural features of the attribute set after normalization and sorting.
[0084] B1.2. By comparing the hash value of the corresponding SCL element in the benchmark SCD file with the hash value of the corresponding SCL element in the configuration file to be verified.
[0085] Specifically, a correspondence is established based on the XPath path of the SCL element, and the hash values of SCL elements with the same XPath path in the benchmark SCD file and the configuration file to be verified are compared one by one.
[0086] B1.3 When the hash value of the corresponding SCL element in the benchmark SCD file is inconsistent with the hash value of the corresponding SCL element in the configuration file to be verified, it indicates that the SCL element has changed; when they are consistent, the comparison continues.
[0087] Specifically, if the hash value of the SCL element in the baseline SCD file is different from the hash value of the corresponding SCL element in the file to be checked, the marker will change.
[0088] B1.4. The SCL element that will change is taken as the target SCL element.
[0089] Specifically, collect all SCL elements with inconsistent hash values to obtain the target SCL element.
[0090] B2. When the hierarchical position information of the target SCL element changes, record the change details and label the change type according to the change details.
[0091] Specifically, analyze the changes in the XPath path of the target SCL element. If the XPath path is completely added, it is marked as an addition type; if the XPath path disappears, it is marked as a deletion type; if the XPath path exists but changes, it is marked as a modification type.
[0092] B3. Generate an initial difference set based on the target SCL element, the corresponding hierarchical position information, and the change type.
[0093] Specifically, the identifier, XPath path, and change type of the target SCL element are organized into a JavaScript object representation format, referred to as JSON format, to form an initial difference set.
[0094] In an optional implementation, step S200 may also employ parallel processing during hash comparison, the steps of which are: dividing the normalized XML tree model into multiple independent comparison tasks according to the configuration subtree, using multi-threading to perform hash calculation and comparison in parallel, and finally merging the difference results of each configuration subtree to improve the comparison efficiency of large-scale base station SCD files.
[0095] In another optional implementation, step S200 may also include difference filtering when generating the initial difference set. The steps are as follows: set whitelist rules to ignore non-critical attribute changes under a specific namespace, such as version number and timestamp, which do not affect the differences in protection configuration functions, thereby reducing noise data in the initial difference set.
[0096] In this embodiment of the application, step S300, which involves performing hierarchical analysis to obtain a set of differences, includes steps C1 to C4:
[0097] C1. Construct a hierarchical verification model through interval level, device level and virtual loop level.
[0098] Specifically, a three-layer analysis structure is established: bay level, device level, and virtual loop level. Path matching rules are predefined for the bay level, device level, and virtual loop level. The path matching rule for the bay level is / SCL / Substation / VoltageLevel / Bay, where SCL stands for Smart Substation Configuration Description Language; Substation refers to the smart substation; VoltageLevel refers to the voltage level; and Bay refers to the electrical bay. The path matching rule for the device level is / SCL / IED, where IED stands for Intelligent Electronic Device. The path matching rule for the virtual loop level is / SCL / Communication / SubNetwork / ConnectedAP, where Communication refers to the communication configuration; SubNetwork refers to the communication subnet; and ConnectedAP refers to the connection access point.
[0099] A hierarchical verification model is constructed based on path matching rules. For example, when comparing the benchmark SCD file with the configuration file to be verified, the benchmark SCD file is parsed according to the path matching rules / SCL / Substation / VoltageLevel / Bay corresponding to the bay level to generate information such as Substation (intelligent substation), VoltageLevel (voltage level), and Bay (electrical bay) as the bay-level verification template. Based on the path matching rules corresponding to the equipment level and the virtual loop level, the equipment-level verification template and the virtual loop-level verification template are generated respectively. The bay-level verification template, the equipment-level verification template, and the virtual loop-level verification template are combined to construct a hierarchical verification model.
[0100] C2. The hierarchical classification results are obtained by classifying the target SCL elements in the initial difference set using the hierarchical verification model.
[0101] Specifically, each target SCL element in the initial difference set is traversed to obtain its XPath path. The target SCL element is then classified and matched with the hierarchical verification model constructed in step C1 based on the XPath path characteristics: for example, XPath paths containing the keyword "Bay" are classified into the interval level, XPath paths containing the keyword "IED" are classified into the device level, and XPath paths containing the keyword "ConnectedAP" are classified into the virtual loop level.
[0102] C3. Based on the hierarchical position information of the target SCL element, evaluate the impact of the target SCL element on the interval configuration structure, the equipment configuration parameters, and the virtual loop connection relationship, and obtain the impact analysis results.
[0103] Specifically, the analysis of target SCL elements at the bay level should determine whether they lead to changes in the integrity of protection logic within the bay; the analysis of target SCL elements at the device level should determine whether they affect the device's communication function; and the analysis of target SCL elements at the virtual loop level should determine whether they lead to abnormal GOOSE / SV link connectivity. GOOSE refers to smart substation events, and SV refers to sampled values.
[0104] C4. Associate the hierarchical classification results and influence analysis results with the initial difference set to obtain the discriminative difference set.
[0105] Specifically, a new `level_classification` field is added to the JSON structure of the initial difference set to record the hierarchical classification results. `level_classification` represents hierarchical classification. A new `impact_analysis` field is added to record the impact analysis results. `impact_analysis` represents impact analysis. This results in the discriminative difference set.
[0106] In an optional implementation, step S300 may also establish inter-level association analysis, the steps of which are: when the same target SCL element involves multiple levels, establish cross-level association identifiers and analyze the propagation impact path of configuration changes between the interval-device-virtual loop levels.
[0107] In another optional implementation, step S300 can also include the quantification of the degree of influence, which involves setting an influence weight coefficient for each level of influence analysis results, calculating a comprehensive influence score based on the size of the range of change and the scope of influence, and providing a quantitative basis for subsequent risk assessment.
[0108] In this embodiment of the application, step S400, the step of obtaining the final difference set, includes D1~D3:
[0109] D1. When the check codes do not match, the structured comparison algorithm is triggered to execute for the configuration range of the field line protection device in the reference SCD file.
[0110] Specifically, when the checksum of the CID file of the field protection device does not match the checksum of the corresponding IED in the benchmark SCD file, the configuration subtree of the complete benchmark SCD file is extracted as the comparison range, and the structured comparison algorithm is re-executed.
[0111] D2. Using the structured comparison algorithm, locate the abnormal SCL element that causes the checksum inconsistency.
[0112] Specifically, by recursively traversing the configuration subtree of the field protection device, the SCL elements of communication parameters, logical devices, and datasets are compared layer by layer to locate abnormal SCL elements that have changed, such as abnormal SCL elements where the IP address is changed from 192.168.1.100 to 192.168.1.101 and the GOOSE control block instance is deleted.
[0113] D3. Add the abnormal SCL elements, corresponding hierarchical location information and change type to the discriminative difference set to obtain the final difference set.
[0114] Specifically, the located abnormal SCL elements, XPath paths, and change types are added as new difference items and updated and supplemented into the analysis difference set that has passed hierarchical analysis, to obtain the final difference set.
[0115] In an optional implementation, step S400 may also employ an incremental update mechanism, wherein the steps are as follows: only the configuration range of field protection devices with inconsistent check codes are compared to avoid re-parsing the entire file, and the newly added abnormal SCL elements are marked as consistency check difference categories.
[0116] In another optional implementation, step S400 may also establish a verification tracking record, which includes: recording the verification code comparison results, verification time and the number of abnormal SCL elements located for each field protection device, and generating a device consistency verification log for subsequent quality traceability analysis.
[0117] In this embodiment of the application, step S500, the step of generating the risk assessment result, includes E1 to E4:
[0118] E1. Traverse the abnormal SCL elements in the final difference set.
[0119] Specifically, each of the anomalous SCL elements recorded in the final difference set is processed individually to ensure that each anomalous SCL element participates in the risk assessment.
[0120] E2. Preset the corresponding risk level for the combination of hierarchical location information and change type, and match the abnormal SCL element with the risk level to obtain the matching result.
[0121] Specifically, a preset rule-based risk mapping is used to match and quantify risk scores. The risk score is set as follows: 90 points for deletion changes of virtual loop level paths and 60 points for addition and modification changes; 90 points for deletion changes of device level paths and 60 points for addition and modification changes; 90 points for deletion changes of interval level paths and 20 points for addition and modification changes. For example, the risk score for deletion matching of ConnectedAP is 90 points, and the risk score for modification matching of IED is 60 points.
[0122] A risk threshold is set, and the risk score is used to determine the risk level. A risk score greater than 80 is considered high risk, a risk score greater than 40 and less than or equal to 80 is considered medium risk, and a risk score less than or equal to 40 is considered low risk. The matching results are obtained. For example, ConnectedAP deletes a match with a risk score of 90, which is considered high risk; IED modifies a match with a risk score of 60, which is considered medium risk.
[0123] E3. Based on the matching results, assign a risk level to each abnormal SCL element and generate a risk description to obtain the risk assessment results.
[0124] Specifically, based on the matching results, high-risk items are marked with an urgent rectification priority and a description of the abnormal protection function; medium-risk items are marked with a recent rectification priority and a description of the impact on system stability; and low-risk items are marked with an observation priority and a description of the limited impact and recommended routine checks.
[0125] E4. Summarize the risk assessment results of all abnormal SCL elements and generate a risk assessment report.
[0126] Specifically, the assessment results are presented in groups according to risk level, including the XPath path, change type, risk level, risk description and rectification suggestions for each abnormal SCL element, and a risk assessment report is generated as output.
[0127] In an optional implementation, step S500 may also establish a risk assessment template library, the steps of which are: pre-setting differentiated risk assessment templates according to different voltage levels and protection types of smart substations to adapt to risk assessments in different application scenarios.
[0128] In another optional implementation, step S500 can also realize the real-time push of risk assessment results. The steps are as follows: push the high-risk assessment results to the intelligent substation monitoring system through the message interface, trigger real-time alarms and generate maintenance work orders, so as to realize closed-loop management of risk assessment and operation and maintenance control.
[0129] In summary, this invention takes the configuration change of line protection in a 220kV smart substation as an application scenario. It constructs a structured data model by parsing and standardizing the baseline SCD file and the CID file of the field protection device using XML; it identifies configuration differences and generates an initial set of differences using recursive traversal and hash comparison algorithms; it performs difference identification and impact analysis based on a hierarchical verification model at the bay level, equipment level, and virtual circuit level; it verifies the consistency of device configuration and locates abnormal SCL elements through a checksum mechanism; and finally, it generates a risk assessment report based on risk mapping rules. This achieves the location, hierarchical analysis, and risk quantification of configuration differences, improving the automation level and safety reliability of smart substation configuration management.
[0130] Example 3 illustrates a schematic scheme for a protection configuration comparison and consistency verification method based on SCD files. It should be noted that the technical solution of this system for protection configuration comparison and consistency verification based on SCD files belongs to the same concept as the technical solution of the aforementioned method for protection configuration comparison and consistency verification based on SCD files. Details not described in detail in this embodiment can be found in the description of the aforementioned method for protection configuration comparison and consistency verification based on SCD files.
[0131] This embodiment also provides a protection configuration comparison and consistency verification system based on SCD files, including:
[0132] The configuration file parsing module is used to parse the baseline SCD file and the configuration file to be verified respectively to obtain a structured data model;
[0133] The initial difference comparison module is used to process the structured data model through a structured comparison algorithm and output an initial difference set;
[0134] The hierarchical analysis module is used to perform hierarchical analysis on the initial difference set through a preset hierarchical verification model to obtain the analyzed difference set.
[0135] The consistency verification module is used to perform consistency verification when the configuration file to be verified comes from the field line protection device, and to trigger the structured comparison algorithm to locate configuration differences when the check code does not match, and update the set of identified differences to obtain the final set of differences;
[0136] The risk assessment module is used to perform risk assessment on the final difference set based on preset risk mapping rules and generate a risk assessment report.
[0137] This embodiment also provides an electronic device applicable to a situation of protection configuration comparison and consistency verification based on SCD files, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the protection configuration comparison and consistency verification method based on SCD files as proposed in the above embodiment.
[0138] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, it implements a protection configuration comparison and consistency verification method based on SCD files as proposed in the above embodiments.
[0139] The storage medium proposed in this embodiment and the method for implementing protection configuration comparison and consistency verification based on SCD files proposed in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0140] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0141] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for comparing and verifying the consistency of protection configurations based on SCD files, characterized in that, include: The benchmark SCD file and the configuration file to be verified are parsed separately to obtain the structured data model; The structured data model is processed by a structured comparison algorithm to output an initial set of differences. A hierarchical verification model is constructed, and the initial set of differences is analyzed hierarchically through the hierarchical verification model to obtain the set of differences to be analyzed. The discriminant set is verified by comparing the checksums, and the discriminant set is updated based on the verification results to obtain the final discriminant set. A risk assessment is performed on the final difference set using a preset risk mapping rule, and a risk assessment result is generated. The structured alignment algorithm includes: The SCL elements in the structured data model are traversed using a depth-first search method, and the hash value of each SCL element in the structured data model is calculated. By comparing the hash value of the corresponding SCL element in the benchmark SCD file with the hash value of the corresponding SCL element in the configuration file to be verified; When the hash value of the corresponding SCL element in the benchmark SCD file is inconsistent with the hash value of the corresponding SCL element in the configuration file to be verified, it indicates that the SCL element has changed; when they are consistent, the comparison continues. The SCL element that changes will be used as the target SCL element; The steps for performing hierarchical analysis to obtain the set of differences include: A hierarchical verification model is constructed by means of interval level, device level and virtual loop level; The hierarchical classification results are obtained by classifying the target SCL elements in the initial difference set using the hierarchical verification model. Based on the hierarchical position information of the target SCL element, the impact of the target SCL element on the interval configuration structure, the impact on the equipment configuration parameters, and the impact on the virtual loop connection relationship are evaluated to obtain the impact analysis results. The hierarchical classification results and impact analysis results are correlated with the initial difference set to obtain the discriminative difference set; The steps to obtain the final difference set include: When the check codes do not match, the structured comparison algorithm is triggered to execute for the configuration range of the field line protection device in the reference SCD file. The structured comparison algorithm is used to locate the abnormal SCL element that causes the checksum inconsistency. The abnormal SCL elements, their corresponding hierarchical location information, and change types are added to the discriminative difference set to obtain the final difference set.
2. The method for comparing and verifying the protection configuration based on SCD files as described in claim 1, characterized in that, The steps to obtain a structured data model include: Read the raw data of the benchmark SCD file and the configuration file to be verified to obtain a file data stream; The file data stream is parsed using an XML parsing library to obtain an initial XML document object model; The initial XML document object model is normalized to obtain a normalized XML tree model, which is then used as a structured data model.
3. The method for comparing and verifying the protection configuration based on SCD files as described in claim 2, characterized in that, The steps for processing the structured data model and outputting an initial difference set include: Determine the hierarchical position information of the target SCL element in the structured data model; When the hierarchical position information of the target SCL element changes, record the change details and label the change type according to the change details; An initial difference set is generated based on the target SCL element, its corresponding hierarchical position information, and its change type.
4. The method for comparing and verifying the protection configuration based on SCD files as described in claim 3, characterized in that, The steps to generate risk assessment results include: Iterate through the anomalous SCL elements in the final difference set; A risk level is preset for the combination of hierarchical location information and change type. The abnormal SCL element is matched with the risk level to obtain the matching result. Based on the matching results, a risk level is assigned to each abnormal SCL element and a risk description is generated to obtain the risk assessment results. Summarize the risk assessment results of all abnormal SCL elements and generate a risk assessment report.
5. A protection configuration comparison and consistency verification system based on SCD files, using the method described in any one of claims 1-4, characterized in that, include: The configuration file parsing module is used to parse the baseline SCD file and the configuration file to be verified respectively to obtain a structured data model; The initial difference comparison module is used to process the structured data model through a structured comparison algorithm and output an initial difference set; The hierarchical analysis module is used to perform hierarchical analysis on the initial difference set through a preset hierarchical verification model to obtain the analyzed difference set. The consistency verification module is used to perform consistency verification when the configuration file to be verified comes from the field line protection device, and to trigger the structured comparison algorithm to locate configuration differences when the check code does not match, and update the set of identified differences to obtain the final set of differences; The risk assessment module is used to perform risk assessment on the final difference set based on preset risk mapping rules and generate a risk assessment report.
6. An electronic device, comprising: Memory and processor; The memory is used to store computer-executable instructions, characterized in that the processor is used to execute the computer-executable instructions, and when the computer-executable instructions are executed by the processor, they implement the steps of the protection configuration comparison and consistency verification method based on SCD files as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing computer-executable instructions, characterized in that, When the computer-executable instructions are executed by the processor, they implement the steps of the protection configuration comparison and consistency verification method based on SCD files as described in any one of claims 1 to 4.