Verification method and device of substation configuration description file, terminal equipment and storage medium

By performing word sequence analysis and static word vector model conversion on the substation configuration description file, calculating phrase similarity and identifying configuration errors, the problems of omissions and false positives caused by incomplete rule matching coverage in the prior art are solved, and the accuracy of SCD file verification is improved.

CN120524935APending Publication Date: 2025-08-22POWER DISPATCHING CONTROL CENT OF GUANGDONG POWER GRID CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510657610.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-22

AI Technical Summary

Technical Problem

In the prior art, the verification method of SCD files depends on rule matching, resulting in the failure of the preset rules to fully cover the actual scenario of substation configuration, and the problems of missed or false alarms occur.

Method used

By analyzing the substation configuration description file, word sequences are generated, and the word sequences are converted into fixed word vectors using the pre-trained static word vector model, the similarity of phrases is calculated, the wrongly configured phrases are identified, and the verification report is generated.

Benefits of technology

Improves the accuracy of SCD file verification, can identify potential configuration errors, and avoids missed and false alarms in traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120524935A_ABST
    Figure CN120524935A_ABST
Patent Text Reader

Abstract

The invention discloses a verification method and device for a substation configuration description file, terminal equipment and a storage medium, and belongs to the field of configuration file verifier.The method comprises the steps that the substation configuration description file to be verified is obtained and analyzed, and a word sequence is generated; inputting the word sequence into a preset static word vector model, and converting each word in the word sequence into a corresponding fixed word vector by the model to represent the semantic position of the word; according to the fixed word vector of each word in the word sequence, calculating the similarity of a word group formed by any two words; comparing the similarity of each word group with a preset threshold value, and taking the word group corresponding to the similarity smaller than the preset threshold value as a word group with wrong configuration; and if the word group with wrong configuration exists, determining that the file does not pass the verification, otherwise, determining that the file passes the verification. By implementing the file verification method and device, the problems of missing report and false report caused by incomplete rule coverage of a verification method based on rule matching in the prior art can be solved, so that the file verification accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of configuration file verification, and in particular to a method, device, terminal equipment and storage medium for verifying a substation configuration description file. Background Art

[0002] In smart substation engineering, the Substation Configuration Description (SCD) file, as the core configuration file for smart substations, defines key information such as substation topology, intelligent electronic device (IED) functional configuration, and communication network parameters. The correctness of the SCD file is directly related to the reliable operation of the substation automation system, so its verification technology has always been a key step in engineering implementation.

[0003] Existing SCD file verification primarily relies on rule-based matching. Specifically, predefined rules are used to verify the SCD file's format, data consistency, and configuration errors. However, this verification method relies primarily on string matching, comparing the standard strings in the pre-defined rules with the actual strings extracted from the SCD file to ensure they are completely consistent. When the pre-defined rules fail to fully cover actual substation configuration scenarios, a correct configuration may be misjudged as an error, or some potentially incorrect configurations may be missed, resulting in missed and false positives. Summary of the Invention

[0004] The embodiments of the present invention provide a verification method, apparatus, terminal device and storage medium for a substation configuration description file, which can solve the problem of omission or false alarm caused by the failure of the preset rules to fully cover the actual scenarios of the substation configuration in the existing rule matching verification method, thereby improving the accuracy of SCD file verification.

[0005] An embodiment of the present invention provides a method for verifying a substation configuration description file, comprising:

[0006] Obtain the substation configuration description file to be verified;

[0007] Parse the substation configuration description file to generate several word sequences to be verified;

[0008] Input each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word;

[0009] Based on the fixed word vector of each word in each word sequence to be verified, the similarity of each word group is calculated; where a word group consists of any two words in the word sequence;

[0010] Compare the similarity of each phrase with a preset threshold, and consider the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases;

[0011] Check whether the substation configuration description file contains any incorrectly configured phrases. If so, determine that the substation configuration description file fails verification. Otherwise, determine that the substation configuration description file passes verification.

[0012] Furthermore, the substation configuration description file is parsed to generate several word sequences to be verified, including:

[0013] All node fields and their corresponding attribute values ​​in the substation configuration description file are extracted, and a word sequence to be verified is generated based on all node fields and their corresponding attribute values.

[0014] Furthermore, based on the fixed word vector of each word in each word sequence to be verified, the similarity of each word group is calculated, including:

[0015] According to the fixed word vector of each word in each word sequence to be verified, the cosine similarity between two words in each phrase is calculated to obtain the similarity of each phrase.

[0016] Furthermore, after determining the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases, the method further includes:

[0017] Phrases corresponding to similarities greater than or equal to a preset threshold are regarded as correctly configured phrases, and a verification report is generated based on all incorrectly configured phrases and all correctly configured phrases.

[0018] Furthermore, the static word vector model is determined in the following way:

[0019] Obtain a number of training samples; each training sample includes: a target central word and its corresponding context words;

[0020] Based on all training samples, the word frequency of each word is determined, and then the Huffman tree in the word vector semantic analysis model to be trained is constructed based on the word frequency of each word. The Huffman tree includes: a root node, an intermediate node, and a leaf node; wherein a leaf node represents a word;

[0021] Initialize the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree;

[0022] Inputting a number of training samples into the word vector semantic analysis model to be trained, so that the word vector semantic analysis model takes the context words in the training samples as input and the conditional probability of the target center word as output for training, and calculating the negative log-likelihood function according to the conditional probability of the target center word during the training process, and updating the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree of the word vector semantic analysis model by gradient descent according to the negative log-likelihood function until the negative log-likelihood function converges, thereby obtaining a trained word vector semantic analysis model;

[0023] The parameters of the Huffman tree in the trained word vector semantic analysis model are used as the parameters of the preset static word vector model.

[0024] Furthermore, several training samples are obtained, including:

[0025] Obtain several verified substation configuration description sample files;

[0026] Parse each substation configuration description sample file to generate several word sequence samples;

[0027] For each word sequence sample, each word in the word sequence sample is used as the target central word, and the words in the preset context window before and after the target central word are extracted as the context words of the target central word;

[0028] A target central word and its corresponding context words are used as a training sample.

[0029] Based on the above method embodiment, the present invention provides a corresponding device embodiment, including: a file acquisition module, a file parsing module, a word vector conversion module, a similarity calculation module, an error phrase identification module and a verification result determination module;

[0030] A file acquisition module, used to obtain the substation configuration description file to be verified;

[0031] A file parsing module is used to parse the substation configuration description file and generate a number of word sequences to be verified;

[0032] A word vector conversion module is used to input each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word;

[0033] A similarity calculation module is used to calculate the similarity of each word group based on the fixed word vector of each word in each word sequence to be verified; wherein a word group is composed of any two words in the word sequence;

[0034] an error phrase identification module, configured to compare the similarity of each phrase with a preset threshold, and to identify phrases corresponding to phrases with similarities less than the preset threshold as misconfigured phrases;

[0035] The verification result determination module is used to check whether there are any configuration errors in the substation configuration description file. If so, it is determined that the substation configuration description file has failed the verification; otherwise, it is determined that the substation configuration description file has passed the verification.

[0036] Furthermore, the verification device for the substation configuration description file further includes: a verification report generation module;

[0037] The verification report generation module is used to take the phrases corresponding to the similarity greater than or equal to the preset threshold as the correctly configured phrases, and generate a verification report based on all the incorrectly configured phrases and all the correctly configured phrases.

[0038] Based on the above-mentioned method embodiment, the present invention provides a corresponding terminal device embodiment, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the substation configuration description file verification method as described in the present invention.

[0039] Based on the above-mentioned method embodiment, the present invention provides a corresponding computer-readable storage medium embodiment, including: a stored computer program, which controls the device where the computer-readable storage medium is located to execute the steps of the substation configuration description file verification method as described in the present invention when the computer program is running.

[0040] Compared with the prior art, the beneficial effects of the embodiment of this solution are:

[0041] The present invention parses the substation configuration description file to be verified, converts the content of the substation configuration description file into a word sequence form that can be processed by a computer, and generates a word sequence to be verified. Then, the word sequence to be verified is input into a preset static word vector model. The static word vector model converts each word in the word sequence into a corresponding fixed word vector based on the word sequence to be verified, thereby converting the word sequence into a representation in the vector space. The word vector reflects the position of the word in the semantic space, thereby capturing the semantic relationship between words. Then, based on the fixed word vector of each word in the word sequence to be verified, the similarity of each phrase is calculated. A phrase consists of any two words in the word sequence. The similarity calculation reflects the degree of semantic closeness between words. The similarity of each phrase is compared with a preset threshold to identify those semantically dissimilar phrases that may be misconfigured. Finally, the substation configuration description file is checked to see if there are misconfigured phrases, thereby determining whether the substation configuration description file has passed verification.

[0042] To sum up, the present invention converts the word sequence in the SCD file into a word vector that reflects the semantic position. Therefore, even if the preset rules fail to fully cover the actual scenario of substation configuration, potential configuration errors can be identified by calculating the similarity of the word vectors, thereby solving the problem of omissions or false alarms caused by the failure of the preset rules to fully cover the actual scenario of substation configuration in the existing rule matching-based verification method, and improving the accuracy of SCD file verification. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 1 is a flow chart of a method for verifying a substation configuration description file provided by an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of a partial structure of an SCD file provided by an embodiment of the present invention;

[0045] Figure 3 1 is a flow chart of a process for determining a static word vector model provided by one embodiment of the present invention;

[0046] Figure 4 It is a schematic diagram of a partial structure of a Huffman tree provided by one embodiment of the present invention;

[0047] Figure 5 1 is a schematic diagram of the structure of a word vector semantic analysis model provided by one embodiment of the present invention;

[0048] Figure 6 It is a structural diagram of a verification device for a substation configuration description file provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0050] like Figure 1 As shown, in order to solve the problem of missed reports or false reports caused by the failure of the preset rules to fully cover the actual scenarios of substation configuration in the existing rule matching verification method, an embodiment of the present invention provides a verification method for a substation configuration description file, which method includes at least the following steps:

[0051] Step S1: Obtain the substation configuration description file to be verified;

[0052] In step S1, the substation configuration description file to be verified is obtained. The substation configuration description file, also known as the SCD (Substation Configuration Description) file, contains detailed information such as configuration information, communication parameters, and logical connection relationships of all intelligent electronic devices (IEDs) in the substation.

[0053] Step S2: Parse the substation configuration description file to generate several word sequences to be verified;

[0054] In a preferred embodiment, the substation configuration description file is parsed to generate several word sequences to be verified, including:

[0055] All node fields and their corresponding attribute values ​​in the substation configuration description file are extracted, and a word sequence to be verified is generated based on all node fields and their corresponding attribute values.

[0056] For step S2, in this embodiment, if Figure 2 The following is a partial structural diagram of the SCD file. <scl>Represents the root node of the SCD file.<IED name="IED1"> Indicates an IED node, the attribute value of the name field is IED1,<AccessPoint name="S1"> Indicates the AccessPoint node, the attribute value of the name field is S1,<LDinst="PTOC"> Indicates the LD (Logical Device) node, the attribute value of the inst field is PTOC (Overcurrent Protection Trip),<LN InClass="Op"> Indicates LN (Logical Node) node, the attribute value of the InClass field is Op (Operation),<DOI name="CB1" / > This represents a DOI (Data Object Instance) node, and the name field has an attribute value of CB1. During parsing, the XML parser extracts the attribute values ​​of these node fields, such as IED1, S1, PTOC, Op, and CB1, and generates the word sequence [IED1, S1, PTOC, Op, CB1] to be verified based on these attribute values. It should be noted that S1, IED1, and CB1 are named identifiers and do not have any special meaning other than identification.

[0057] The substation configuration description file (SCD file) to be verified is loaded through the XML parser. The parser starts from the root node and traverses the structure of the XML document layer by layer. During the traversal process, the parser identifies each node (such as <ied> 、 <accesspoint> 、 <ld> 、 <ln> 、 <doi>etc.) and their attributes (such as "IED1", "S1", "PTOC", "Op", "CB1", etc.), and generate the word sequences to be verified [IED, AccessPoint, LD, LN, DOI] and [IED1, S1, PTOC, Op, CB1] according to these attribute values.

[0058] Step S3: Input each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word;

[0059] In step S3, the word sequence to be verified, obtained in step S2, is input into a preset static word vector model. A static word vector model is a pre-trained model that maps each word in the vocabulary into a vector space of fixed dimensionality. The vector for each word is fixed, meaning that the vector representation of the same word remains the same regardless of the sentence or context in which it appears. This property makes the static word vector model highly efficient and stable when processing large amounts of text data.

[0060] In this embodiment, the word sequence to be verified [IED1, S1, PTOC, Op, CB1] is input into the preset static word vector model. The model processes each word in the sequence in turn and converts it into the corresponding fixed word vector to obtain the word vector of each word as shown in Table 1 below. These word vectors are used to represent the semantic position of each word.

[0061] Table 1 Example of word vector results

[0062]

[0063]

[0064] like Figure 3 As shown, the preset static word vector model is determined by the following steps:

[0065] Step S31: obtaining a number of training samples; each training sample includes: a target central word and its corresponding context words;

[0066] In a preferred embodiment, obtaining a number of training samples includes:

[0067] Obtain several verified substation configuration description sample files;

[0068] Parse each substation configuration description sample file to generate several word sequence samples;

[0069] For each word sequence sample, each word in the word sequence sample is used as the target central word, and the words in the preset context window before and after the target central word are extracted as the context words of the target central word;

[0070] A target central word and its corresponding context words are used as a training sample.

[0071] In step S31, a number of training samples are obtained, each of which includes a target central word and its corresponding context words. These training samples will be used to train a static word vector model, enabling the model to learn the representation of each word in the vocabulary in a fixed-dimensional vector space.

[0072] Specifically, we first obtain several verified substation configuration description sample files. Then, we parse each substation configuration description sample file through an XML parser to generate several word sequence samples. For each word sequence sample, each word in the word sequence sample is used as the target central word, and the words in the preset context window before and after the target central word are extracted as the context words of the target central word. The size of the context window can be adjusted according to actual needs and is usually a fixed integer such as 2, 3 or 5. Finally, a target central word and its corresponding context words are used as a training sample. In this way, each training sample contains a target central word and its related words in the context, which helps the model learn the co-occurrence relationship between words. This co-occurrence relationship reflects the semantic similarity or correlation between words, and helps the model integrate these words into similar positions in the vector space.

[0073] It should be noted that these verified substation configuration description sample files used as training samples need to involve a variety of words to avoid the inability to accurately represent the semantic position of untrained words when encountered in actual applications.

[0074] Step S32: Determine the word frequency of each word based on all training samples, and then construct a Huffman tree in the word vector semantic analysis model to be trained based on the word frequency of each word; the Huffman tree includes: a root node, an intermediate node, and a leaf node; wherein a leaf node represents a word;

[0075] For step S32, the frequency of each word is counted based on all training samples. Word frequency refers to the number of times a word appears in the training samples, which reflects the importance and commonness of the word in the text. The word frequencies obtained by statistics are sorted from high to low, and a Huffman tree is constructed based on the word frequencies. The Huffman tree is an optimal binary tree that is constructed based on given weights (corresponding to word frequencies in the present invention) so that the weighted path length of the tree is the shortest.

[0076] For example, Figure 4 Figure 1 shows a partial structural diagram of a Huffman tree. A Huffman tree consists of a root node, intermediate nodes, and leaf nodes. The root node is the top node (N0) of the tree and has no parent node. Intermediate nodes are nodes (N1-N7) with parent nodes and children, connecting the root node and leaf nodes. In this embodiment, the intermediate nodes correspond not to actual words but to temporary variables used in intermediate computations. Leaf nodes are nodes without children (PTOC, IED1, and Op). In this embodiment, each leaf node represents a word. Because the Huffman tree is constructed based on word frequency, frequently occurring words are typically located near the root node, while less frequently occurring words are located far from the root node. This allows the model to find the target word more quickly when making binary classification decisions along the path from the root node to the leaf nodes in the Huffman tree, thereby accelerating the training process.

[0077] Step S33: Initialize the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree;

[0078] For step S33, in this embodiment, the dimension of the word vector is set to 3, and the word vector of each leaf node and each intermediate node is initialized randomly, for example, by sampling from a uniform distribution or a normal distribution, to ensure that the model has sufficient diversity at the beginning of training.

[0079] Step S34: inputting a number of training samples into the word vector semantic analysis model to be trained, so that the word vector semantic analysis model takes the context words in the training samples as input and the conditional probability of the target center word as output for training, and during the training process, calculates the negative log-likelihood function according to the conditional probability of the target center word, and updates the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree of the word vector semantic analysis model by gradient descent according to the negative log-likelihood function, until the negative log-likelihood function converges, thereby obtaining a trained word vector semantic analysis model;

[0080] In step S34, the training sample obtained in step S31 is input into the word vector semantic analysis model to be trained. The word vector semantic analysis model to be trained in the present invention is constructed based on the Word2Vec model structure, and its structural diagram is shown in FIG. Figure 5 As shown, it includes input layer, hidden layer and output layer.

[0081] The input layer is responsible for receiving the context words in the training sample obtained in step S31 and converting them into the current word vector form [W j-h ,...,W j-1 ,W j+1 ,...,W j+h ], where j represents the index of the word position in the word sequence, h represents the preset context window, and W j-h Represents the word vector of the hth word to the left of the jth word, W j+h The word vector represents the hth word to the right of the jth word. It should be noted that "+" and "-" do not represent positive and negative in mathematics, but are used to represent the left and right of the i-th word. For example, for the word sequence sample [IED1, S1, PTOC, Op, CB1], if "S1" is selected as the current target center word, when the preset context window h = 1, its context words are [IED1, PTOC], and when the preset context window h = 2, its context words are [IED1, PTOC, Op]. At this time, since the second word to the left of "S1" does not exist, the corresponding word is empty;

[0082] The hidden layer is used to accumulate the vectors of the input layer and aggregate them to obtain the vector W neul ;

[0083] The output layer is a Huffman tree structure constructed based on step S32. The leaf nodes of the Huffman tree represent specific words, and each leaf node corresponds to a word vector. These word vectors are the ultimate goals of the model to learn and optimize. In addition to leaf nodes, the Huffman tree also includes root nodes and intermediate nodes (collectively referred to as non-leaf nodes). These nodes do not directly correspond to specific words, but are used to construct the hierarchical structure of the Huffman tree, and each non-leaf node corresponds to a non-word vector. During the training process, the vectors of the non-leaf nodes will also be adjusted and optimized according to the training samples to better represent the semantic relationship between words.

[0084] In the output layer processing of the word vector semantic analysis model, for the current target center word, its context words pass through the output layer, and the conditional probability of the current target center word can be calculated through the hierarchical softmax structure. Specifically, this calculation process can be divided into multiple steps, each of which corresponds to a decision point in the binary tree. At each decision point, the model calculates the probability of selecting the left or right child node based on the non-word vector and word vector of the current path. The conditional probability of the target center word is calculated using the following formula:

[0085]

[0086] Among them, w ij represents the jth word in the i-th word sequence sample, which refers to the target center word in this embodiment, C ij represents the context word of the jth word in the i-th word sequence sample, θ represents the model parameter, P ij (w ij |C ij ;θ) represents the given context C ij Under the condition of ij The conditional probability, K ij Represents the Huffman tree from the root node to the target center word w ij All nodes on the path are used to represent the number of nodes that need to be passed on the path from the root node to the specific target center word in the Huffman tree, k ij Represents a node index on the path, which is used to access nodes one by one on the path. σ(·) represents the Sigmoid function, which is used to calculate the probability of each binary tree decision (selecting the left or right) of the current path. Represents the non-word vector currently traversing the Huffman tree, Represents Huffman coding, with a value of 0 or 1, i.e.

[0087] In this embodiment, see Figure 4 , the target center word "PTOC" is located at the right leaf node of the third layer in the Huffman tree hierarchy. Then, the conditional probability of "PTOC" can be divided into two steps: the first step: N0->N1, the second step: N2->PTOC.

[0088] After calculating the conditional probability of the target center word, the maximum posterior probability is used as the objective function to make the conditional probability of the target center word as large as possible given the context:

[0089]

[0090] Where D represents the set of word sequence samples, T i Represents the i-th group of word sequence samples.

[0091] In the word vector semantic analysis model, since directly maximizing the product of conditional probabilities is mathematically difficult to handle, the negative log-likelihood loss function is usually chosen as the optimization objective. The negative log-likelihood loss function can simplify calculations and effectively measure the difference between the probability distribution predicted by the model and the true distribution. By minimizing the negative log-likelihood loss function, the objective function can be indirectly maximized. The parameters of the word vector semantic analysis model are then updated through stochastic gradient descent. Specifically, the learning rate of the model is set to ε. The learning rate determines the speed of parameter changes during the gradient descent process. At this time, the non-word vectors and word vectors in the Huffman tree are updated using the following formula:

[0092]

[0093] in, Indicates the non-leaf node k at the nth iteration ij vector, ε represents the learning rate, F Hq (·) represents the loss gradient of the non-leaf node vector when the current word propagates on the current binary tree path. Represents the word vector of leaf node l at the nth iteration, F HC (·) represents the cumulative gradient influence of the non-leaf nodes on the current binary tree path on the target center word vector.

[0094] When the loss function converges, it means that the word vector semantic analysis model has learned good parameters and can accurately predict the conditional probability of the target center word. At this point, the trained word vector semantic analysis model is obtained.

[0095] Step S35: Using the parameters of the Huffman tree in the trained word vector semantic analysis model as the parameters of the preset static word vector model.

[0096] In step S35, the Huffman tree in the word embedding semantic analysis model learns semantic relationships between words during training. Through a hierarchical softmax structure, the model captures similarities and differences between words, and these relationships are encoded in the node vectors of the Huffman tree. Using the parameters of the Huffman tree as the parameters of the static word embedding preserves this semantic information, allowing the static word embedding model to leverage this pre-trained semantic knowledge in subsequent tasks.

[0097] Step S4: Calculate the similarity of each word group based on the fixed word vector of each word in each word sequence to be verified; wherein a word group consists of any two words in the word sequence;

[0098] In a preferred embodiment, the similarity of each word group is calculated based on the fixed word vector of each word in each word sequence to be verified, including:

[0099] According to the fixed word vector of each word in each word sequence to be verified, the cosine similarity between two words in each phrase is calculated to obtain the similarity of each phrase.

[0100] In step S4, after obtaining the fixed word vector of each word in the word sequence to be verified in step S3, the cosine similarity between the two words in each phrase is calculated using the following formula:

[0101]

[0102] Among them, Cos(A,B) represents the cosine similarity between word vector A and word vector B, and A*B represents the dot product of the word vectors of two words in the phrase, which is expressed as A*B=a1×b1+a2×b2+...+a d ×b d , a d Represents the value of the dth dimension in the word vector A, b d Represents the value of the dth dimension in word vector B, d represents the dimension index of the word vector, ‖A‖ and ‖B‖ represent the modulo lengths of word vector A and word vector B. The similarity between two words is measured by calculating the angle between their word vectors. The calculated cosine similarity ranges from [-1, 1]. The larger the value, the higher the similarity.

[0103] Taking the word sequence to be verified [IED1, S1, PTOC, Op, CB1] as an example, the similarity between "IED1" and "S1", the similarity between "IED1" and "PTOC", the similarity between "PTOC" and "Op", the similarity between "CB1" and "Op", the similarity between "CB1" and "PTOC", and so on are calculated. The similarity calculation results of some phrases are shown in Table 2 below. The similarity between "PTOC" and "Op" is only 0.03, and the similarity between "CB1" and "Op" is 0.10.

[0104] Table 2 Example of similarity calculation results for some phrases

[0105] Query 1 Query 2 Similarity PTOC Op 0.03 IED1 S1 0.98 IED1 PTOC 0.90 CB1 Op 0.10 CB1 PTOC 0.89

[0106] Step S5: Compare the similarity of each phrase with a preset threshold, and identify the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases;

[0107] In step S5, before calculating similarity, a preset threshold is set to determine whether the similarity between two words is sufficiently high. The preset threshold is determined based on experience, experimental data, or the requirements of a specific application scenario. In this embodiment, the preset threshold is 0.8. Therefore, phrases with a similarity below 0.8, namely, "PTOC" and "Op" and "CB1" and "Op", are marked as misconfigured phrases.

[0108] In a preferred embodiment, after determining the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases, the method further includes:

[0109] Phrases corresponding to similarities greater than or equal to a preset threshold are regarded as correctly configured phrases, and a verification report is generated based on all incorrectly configured phrases and all correctly configured phrases.

[0110] In one embodiment of the present invention, phrases corresponding to similarities greater than or equal to a preset threshold are synchronously regarded as correctly configured phrases. Then, based on all incorrectly configured phrases and all correctly configured phrases, charts or statistical data are used for analysis, and finally a verification report is generated and sent to relevant personnel so that they can understand the configuration status of the SCD file and take corresponding measures.

[0111] Step S6: Check whether the substation configuration description file contains any misconfigured phrases. If so, determine that the substation configuration description file fails verification. Otherwise, determine that the substation configuration description file passes verification.

[0112] For step S6, after the process of identifying misconfigured phrases in step S5, if it is checked that there are no misconfigured phrases in the substation configuration description file to be verified, it means that the various node fields or attribute values ​​configured in the SCD file are semantically similar, then it can be determined that the substation configuration description file has passed the verification; on the contrary, if it is checked that there are misconfigured phrases in the substation configuration description file to be verified, it means that there are node fields or attribute values ​​that are significantly different from the above, then it is determined that the substation configuration description file has failed the verification.

[0113] In this embodiment, the phrases being verified reflect the content being verified. As shown in Table 3, if the extracted word sequences [110kV, Bay1] and [220kV, Bay2] are used as input, the calculated similarity between "Bay2" and "220kV" is 0.21, and the similarity between "Bay1" and "110kV" is 0.92. This indicates that Bay1 belongs to the 110kV voltage level, while Bay2 does not belong to the 220kV voltage level. This verifies the correlation between the specific bay and the voltage level. Similarly, the connection between the terminal and the conductive equipment is verified, as well as the correlation between the LNode terminal device and the voltage level.

[0114] Table 3 SCD file verification phrase example table

[0115]

[0116] The present invention automatically parses the structural information of the SCD file through the XML parser, greatly improving the processing efficiency and reducing manual intervention. Using a static word vector model based on the Word2Vec model and the Huffman tree, each word in the word sequence of the SCD file is automatically converted into a word vector that can reflect the semantic position. This conversion process not only deeply explores the semantic association between words, but also uses the spatial distribution characteristics of the word vectors to make the originally obscure logical errors and topological errors appear in the vector space, thereby discovering complex error patterns that are difficult to capture with traditional methods. Furthermore, by calculating the cosine similarity between word vectors, the semantic similarity between words can be intuitively measured, and based on the semantic similarity, it can be identified whether the configuration between words is correct, thereby effectively detecting the logical errors and topological errors in the SCD file, avoiding the problems of omissions and false positives caused by incomplete rule coverage in traditional rule-based matching methods.

[0117] like Figure 6 As shown, based on the above method embodiment, a corresponding device embodiment is provided;

[0118] An embodiment of the present invention provides a device for verifying a substation configuration description file, comprising: a file acquisition module, a file parsing module, a word vector conversion module, a similarity calculation module, an error phrase identification module, and a verification result determination module;

[0119] A file acquisition module, used to obtain the substation configuration description file to be verified;

[0120] A file parsing module is used to parse the substation configuration description file and generate a number of word sequences to be verified;

[0121] A word vector conversion module is used to input each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word;

[0122] A similarity calculation module is used to calculate the similarity of each word group based on the fixed word vector of each word in each word sequence to be verified; wherein a word group is composed of any two words in the word sequence;

[0123] an error phrase identification module, configured to compare the similarity of each phrase with a preset threshold, and to identify phrases corresponding to phrases with similarities less than the preset threshold as misconfigured phrases;

[0124] The verification result determination module is used to check whether there are any configuration errors in the substation configuration description file. If so, it is determined that the substation configuration description file has failed the verification; otherwise, it is determined that the substation configuration description file has passed the verification.

[0125] In a preferred embodiment, the device for verifying the substation configuration description file further includes: a verification report generating module;

[0126] The verification report generation module is used to take the phrases corresponding to the similarity greater than or equal to the preset threshold as the correctly configured phrases, and generate a verification report based on all the incorrectly configured phrases and all the correctly configured phrases.

[0127] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present invention, and can implement the verification method of the substation configuration description file provided by any of the above-mentioned method embodiments of the present invention.

[0128] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Furthermore, in the drawings of the device embodiments provided by the present invention, the connection relationship between modules indicates that they have a communication connection, which may be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement the present invention without inventive effort.

[0129] Based on the above-mentioned embodiment of the method for verifying the substation configuration description file, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for verifying the substation configuration description file of any embodiment of the present invention is implemented.

[0130] For example, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more module elements may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.

[0131] The terminal device may be a computing device such as a desktop computer, a notebook computer, a PDA, a cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.

[0132] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, connecting various parts of the entire terminal device using various interfaces and lines.

[0133] Based on the above method embodiment, another embodiment is provided: another embodiment of the present invention provides a computer-readable storage medium, including a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the verification method of the substation configuration description file described in any one of the above method embodiments of the present invention.

[0134] Wherein, the module / unit integrated in the verification device / terminal device of the substation configuration description file, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the process in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, it can implement the steps of the above-mentioned various method embodiments. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0135] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.< / doi> < / ln> < / ld> < / accesspoint> < / ied> < / scl>

Claims

1. A method for verifying a substation configuration description file, characterized in that: include: Obtain the substation configuration description file to be verified; Parsing the substation configuration description file to generate a number of word sequences to be verified; Inputting each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word; Based on the fixed word vector of each word in each word sequence to be verified, the similarity of each word group is calculated; wherein the word group is composed of any two words in the word sequence; Compare the similarity of each phrase with a preset threshold, and consider the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases; Check whether the substation configuration description file contains any misconfigured phrases; if so, determine that the substation configuration description file fails verification; otherwise, determine that the substation configuration description file passes verification.

2. The method for verifying a substation configuration description file according to claim 1, characterized in that: The substation configuration description file is parsed to generate several word sequences to be verified, including: All node fields and their corresponding attribute values ​​in the substation configuration description file are extracted, and a word sequence to be verified is generated based on all node fields and their corresponding attribute values.

3. The method for verifying a substation configuration description file according to claim 1, characterized in that: Based on the fixed word vector of each word in each word sequence to be verified, the similarity of each word group is calculated, including: According to the fixed word vector of each word in each word sequence to be verified, the cosine similarity between two words in each phrase is calculated to obtain the similarity of each phrase.

4. The method for verifying a substation configuration description file according to claim 1, wherein: After the phrases corresponding to the similarity less than the preset threshold are regarded as misconfigured phrases, the following steps are also included: Phrases corresponding to similarities greater than or equal to a preset threshold are regarded as correctly configured phrases, and a verification report is generated based on all incorrectly configured phrases and all correctly configured phrases.

5. The method for verifying a substation configuration description file according to claim 1, characterized in that: The static word vector model is determined by: Obtain a number of training samples; each training sample includes: a target central word and its corresponding context words; Based on all training samples, the word frequency of each word is determined, and then a Huffman tree in the word vector semantic analysis model to be trained is constructed according to the word frequency of each word; the Huffman tree includes: a root node, an intermediate node, and a leaf node; wherein a leaf node represents a word; Initialize the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree; Inputting a number of training samples into the word vector semantic analysis model to be trained, so that the word vector semantic analysis model takes the context words in the training samples as input and the conditional probability of the target center word as output for training, and calculating the negative log-likelihood function according to the conditional probability of the target center word during the training process, and updating the word vector of each leaf node and the node vector of each intermediate node in the Huffman tree of the word vector semantic analysis model by gradient descent according to the negative log-likelihood function until the negative log-likelihood function converges, thereby obtaining a trained word vector semantic analysis model; The parameters of the Huffman tree in the trained word vector semantic analysis model are used as the parameters of the preset static word vector model.

6. The method for verifying a substation configuration description file according to claim 5, characterized in that: Get several training samples, including: Obtain several verified substation configuration description sample files; Parse each substation configuration description sample file to generate several word sequence samples; For each word sequence sample, each word in the word sequence sample is used as the target central word, and the words in the preset context window before and after the target central word are extracted as the context words of the target central word; A target central word and its corresponding context words are used as a training sample.

7. A device for verifying a substation configuration description file, characterized in that: include: File acquisition module, file parsing module, word vector conversion module, similarity calculation module, error phrase identification module and verification result determination module; The file acquisition module is used to obtain the substation configuration description file to be verified; The file parsing module is used to parse the substation configuration description file to generate a number of word sequences to be verified; The word vector conversion module is used to input each word sequence to be verified into a preset static word vector model, so that the static word vector model converts each word in the word sequence into a corresponding fixed word vector according to each word sequence to be verified, thereby obtaining a fixed word vector for each word in each word sequence to be verified; the fixed word vector is used to represent the semantic position of the word; The similarity calculation module is used to calculate the similarity of each word group based on the fixed word vector of each word in each word sequence to be verified; wherein the word group is composed of any two words in the word sequence; The error phrase identification module is used to compare the similarity of each phrase with a preset threshold, and to identify the phrases corresponding to the similarity less than the preset threshold as misconfigured phrases; The verification result determination module is used to check whether there are any misconfigured phrases in the substation configuration description file. If so, it is determined that the substation configuration description file has failed the verification; otherwise, it is determined that the substation configuration description file has passed the verification.

8. The verification device for a substation configuration description file according to claim 7, characterized in that: Also includes: Verification report generation module; The verification report generating module is configured to take the phrases corresponding to the similarities greater than or equal to a preset threshold as the correctly configured phrases, and generate a verification report based on all incorrectly configured phrases and all correctly configured phrases.

9. A terminal device, characterized in that: The system comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for verifying the substation configuration description file according to any one of claims 1 to 6 is implemented.

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