A testing method, equipment, and storage medium for secondary equipment in a substation.

By leveraging natural language processing technology and a cloud testing center, test cases for substation secondary equipment are automatically generated, solving the problem of low efficiency in traditional manual test case writing and achieving efficient and accurate test case generation and application.

CN119201728BActive Publication Date: 2025-10-28GUANGDONG POWER GRID CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411312967.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-10-28
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

Traditional testing methods for substation secondary equipment rely on manually writing test cases, which results in high manpower and time consumption, low testing efficiency, and the quality of test cases is easily affected by the professional knowledge and experience of testers, making it difficult to meet the testing requirements of complex functions.

Method used

By employing natural language processing technology, the system acquires functional requirement descriptions of secondary equipment, performs semantic encoding and semantic parsing, generates replacement code sections for test objects and operation data, constructs test cases, and utilizes cloud testing centers and artificial intelligence algorithms to automatically generate test cases.

Benefits of technology

It enables the rapid generation of test cases that meet actual needs, reduces manual intervention, improves the speed and efficiency of test case construction, reduces testing costs, and ensures the accuracy and applicability of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201728B_ABST
    Figure CN119201728B_ABST
Patent Text Reader

Abstract

This invention discloses a testing method, equipment, and storage medium for secondary equipment in a substation. The method includes: acquiring a test case model for the secondary equipment in the substation; reading the model source code from the test case model; extracting the test command source code from the model source code; semantically encoding the functional requirement description information to obtain a functional requirement description semantic encoding feature vector; inputting the functional requirement description semantic encoding feature vector into a preset generator to generate a test object replacement code and an operation data replacement code; constructing test cases based on the test object replacement code, the operation data replacement code, and the test command source code; and using the test cases to test the secondary equipment. This embodiment quickly generates test cases that meet actual needs, reducing manual intervention and enabling personalized customization according to the specific functional requirements of the secondary equipment, ensuring the accuracy and effectiveness of the test cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power technology, and in particular to a testing method, equipment, and storage medium for secondary equipment in substations. Background Technology

[0002] With the rapid development of power systems, substations, as one of the key nodes in the power grid, play a vital role in the reliability of the entire power system through their stable operation. Currently, the automation and intelligence levels of substations are continuously improving, and the functional complexity of secondary equipment is also increasing, including protection devices, measuring devices, and monitoring systems. These components are crucial for the safe, stable, and efficient operation of the power system.

[0003] To ensure the reliability and accuracy of secondary equipment, it is tested. Traditional testing methods usually rely on testers manually writing test cases, which are then called to execute the tests.

[0004] However, manually writing test cases is extremely time-consuming and labor-intensive, especially when dealing with complex secondary equipment functions, where the number and complexity of test cases increase significantly. Furthermore, the professional knowledge and experience of testers greatly influence the quality of test cases; the high barrier to entry makes test cases prone to errors and omissions, resulting in low testing efficiency. Summary of the Invention

[0005] In view of this, the present invention provides a testing method, equipment and storage medium for secondary equipment in substations, so as to improve the efficiency of testing secondary equipment in substations.

[0006] The first aspect of the present invention provides a testing method for secondary equipment in a substation, comprising:

[0007] Obtain a test case model for the secondary equipment in the substation; the secondary equipment has functional requirement description information.

[0008] Read the model source code from the test case model;

[0009] Extract the test command source code portion from the model source code;

[0010] The functional requirement description information is semantically encoded to obtain a functional requirement description semantic encoding feature vector;

[0011] The semantically encoded feature vector of the functional requirement description is input into a preset generator to generate the test object replacement code part and the operation data replacement code part;

[0012] Test cases are constructed based on the replacement code portion of the test object, the replacement code portion of the operation data, and the source code portion of the test command.

[0013] The secondary device is tested using the test cases described above.

[0014] A second aspect of the present invention provides a testing apparatus for secondary equipment in a substation, comprising:

[0015] The test case model acquisition module is used to acquire test case models for secondary equipment in a substation; the secondary equipment has functional requirement description information.

[0016] The model source code reading module is used to read the model source code from the test case model;

[0017] The source code extraction module is used to extract the test command source code portion from the model source code.

[0018] The semantic encoding module is used to perform semantic encoding on the functional requirement description information to obtain the functional requirement description semantic encoding feature vector.

[0019] The code replacement generation module is used to input the semantically encoded feature vector of the functional requirement description into a preset generator to generate the test object replacement code part and the operation data replacement code part;

[0020] The test case construction module is used to construct test cases based on the test object replacement code section, the operation data replacement code section, and the test command source code section.

[0021] The equipment testing module is used to test the secondary equipment using the test cases.

[0022] A third aspect of the present invention provides an electronic device, the electronic device comprising:

[0023] At least one processor; and

[0024] A memory communicatively connected to the at least one processor; wherein,

[0025] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the test method for substation secondary equipment as described in the first aspect above.

[0026] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the testing method for substation secondary equipment as described in the first aspect above.

[0027] The fifth aspect of the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the testing method for substation secondary equipment as described in the first aspect above.

[0028] In this embodiment, a test case model for secondary equipment in a substation is obtained; the secondary equipment has functional requirement description information; the model source code is read from the test case model; the test command source code is extracted from the model source code; the functional requirement description information is semantically encoded to obtain a functional requirement description semantic encoding feature vector; the functional requirement description semantic encoding feature vector is input into a preset generator to generate test object replacement code and operation data replacement code; test cases are constructed based on the test object replacement code, operation data replacement code, and test command source code; and the test cases are used to test the secondary equipment. This embodiment generates test cases based on natural language processing technology. Through semantic analysis and encoding of the functional requirements of the secondary equipment, it can quickly generate test cases that meet actual needs, reducing manual intervention and allowing for personalized customization according to the specific functional requirements of the secondary equipment, ensuring the accuracy and effectiveness of the test cases. This not only improves the speed of test case construction but also allows test cases to be applied to different secondary equipment and testing instruments, effectively improving testing efficiency and reducing testing costs.

[0029] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.

[0031] Figure 1 This is a flowchart of a testing method for secondary equipment in a substation provided in Embodiment 1 of the present invention.

[0032] Figure 2 This is a schematic diagram of a cloud testing center provided in Embodiment 1 of the present invention.

[0033] Figure 3 This is a logical architecture diagram of a cloud testing center provided in Embodiment 1 of the present invention.

[0034] Figure 4This is a schematic diagram of the structure of a test device for secondary equipment in a substation provided in Embodiment 2 of the present invention.

[0035] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. Detailed Implementation

[0036] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. 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 scope of protection of the present invention.

[0037] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate so that the embodiments of the invention described herein can cover implementations in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0038] Example 1

[0039] See Figure 1 The diagram illustrates a flowchart of a testing method for substation secondary equipment according to Embodiment 1 of the present invention. This method can be executed by a testing device for the substation secondary equipment, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:

[0040] Step 101: Obtain the test case model for the secondary equipment in the substation.

[0041] like Figure 2As shown, this embodiment can be applied to a cloud testing center. On the one hand, the cloud testing center can obtain the test case model and the functional requirement description information of the secondary equipment to be tested, and input the test case model and functional requirement description information into a server 201 that is equipped with an AI-based automatic testing algorithm for substation secondary equipment. The server can use the AI-based automatic testing algorithm for substation secondary equipment to process the test case model and the functional requirement description of the device under test to generate test cases.

[0042] Furthermore, the cloud testing center's automated testing applications and testing instruments require bidirectional interaction of test control messages, such as test start, system connection, test case distribution, test stop, and report upload. While the real-time requirements for communication are relatively low, the interaction process is complex. Considering security, a wireless connection solution is adopted. Wireless connection is used for security verification to ensure communication security. Application-layer functions are designed based on the wireless connection to implement test process control and test case file transmission. Test control processes such as system start, connection, test stop, and report upload have request and response characteristics and relatively short message lengths; therefore, JSON (JavaScript Object Notation) messages are used. Downloading test case files and uploading test result data have large data packets and high correctness requirements; therefore, a file transfer method with verification is used to ensure transmission correctness.

[0043] like Figure 3 As shown, the test template editing platform adopts a four-layer architecture of model, data, application, and graphics, and designs modules such as log monitoring, service communication, and service scheduling to decouple data, application logic, and the graphical interface. This further decouples specific test instruments and measurement and control protection devices from test cases, allowing a single test case template to be applicable to multiple test instruments and multiple devices in the field. The model layer defines the data structures for measurement and control protection devices, test instruments, system parameters, test cases, and test reports, implemented using database tables, providing the foundation for data object creation. Based on the requirements of automatic verification and test result analysis, the above object data structures are designed. The data layer stores instance data of measurement and control protection devices, test instruments, system parameters, test cases, and test reports based on the model structure, using database table records. Data objects provide the foundation for test case editing and execution, while the business logic layer provides a data object maintenance module. The business logic layer adopts a Model / Controller / View (MCV) architecture, connecting the graphics layer and the data layer. The graphics page retrieves data from the data layer through the business logic layer and feeds back user actions to the business logic layer, which then modifies the data and feeds back to the graphics layer. This includes modules for parameter management, test case management, template access, and test case tree management. Simultaneously, the system is designed with log monitoring and service communication functions to provide the foundation for system operation and maintenance, including a service bus, service scheduling module, and data access interfaces.

[0044] In this embodiment, the interface provided by the substation's automated commissioning and acceptance system can be called to obtain the test case model for the secondary equipment settings. The test case model serves as a template for test cases and can include various test scenarios such as functional testing, performance testing, and safety testing of the substation's secondary equipment.

[0045] Step 102: Read the model source code from the test case model.

[0046] In this embodiment, the source code can be extracted from the test case model and recorded as the model source code, so as to facilitate subsequent code segmentation and test case generation.

[0047] Step 103: Extract the test command source code from the model source code.

[0048] In this embodiment, the model source code can be structurally analyzed to extract the source code related to the command part, which is denoted as the command source code part.

[0049] Furthermore, the model source code can be segmented to obtain the test command source code, test object source code, and operation data source code within a given code framework. Such segmentation facilitates the generation of test case parameters and the assembly of test cases.

[0050] The test object source code section contains the source code related to the object under test, while the operation data source code section contains the source code related to the data operations under test.

[0051] Step 104: Semantically encode the functional requirement description information to obtain the functional requirement description semantic encoding feature vector.

[0052] In practical applications, secondary equipment has functional requirement description information, which can be obtained from technical specifications, design documents and other documents of substation secondary equipment, which details the functions and performance standards that the secondary equipment should meet.

[0053] The functional requirement description information of the secondary equipment is semantically encoded using NLP (Natural Language Processing) technology, and then converted into a functional requirement description semantic encoding feature vector that can be recognized by a computer.

[0054] In one embodiment of the present invention, step 104 may further include the following steps:

[0055] Step S11: Perform semantic parsing on the functional requirement description information to obtain an abstract syntax tree.

[0056] In this embodiment, a pre-built semantic parser can be used to perform semantic parsing on the functional requirement description information to obtain an Abstract Syntax Tree (AST).

[0057] Since there may be ambiguities or unclear points in the description of functional requirements, a semantic parser can help eliminate such ambiguity and ensure that each functional requirement is correctly understood.

[0058] Specifically, abstract syntax trees can transform unstructured text information into structured data, enabling the various components of functional requirements (such as inputs, outputs, conditions, operations, etc.) to be clearly represented in a tree structure, facilitating understanding and analysis.

[0059] By decomposing complex functional requirements into simple tree-like nodes and edges, it facilitates subsequent semantic understanding of functional requirements, code generation, and test case design. Furthermore, the tree structure allows for easy traversal, modification, and optimization, supporting the generation and execution of subsequent test cases.

[0060] Step S12: Perform semantic embedding encoding on each node and edge in the abstract syntax tree to obtain the semantic embedding encoding representation of the original tree.

[0061] In this embodiment, semantic embedding encoding can be performed on each node and each edge in the abstract syntax tree to obtain the semantic embedding encoding representation of the original tree.

[0062] Semantic embedding encoding can transform the semantic features of each node and edge into vector representations. This vectorization can preserve the semantic information of functional requirements, enabling computers to understand the deeper meaning of the requirements.

[0063] Furthermore, semantic embedding encoding maps nodes and edges to a high-dimensional feature space, enabling it to capture more complex semantic relationships and improve expressive power. In other words, the processing method of semantic embedding encoding can capture the relationships and contextual information between nodes, thereby better reflecting the logical structure and functional dependencies of functional requirements.

[0064] Step S13: Perform feature sequence selection enhancement on the energy distribution spectrum on the set of node semantic embedding encoding vectors in the original tree semantic embedding encoding representation to obtain the set of enhanced node semantic embedding encoding vectors.

[0065] Each node in an abstract syntax tree represents a portion of semantic information. Through semantic embedding techniques, these nodes can be transformed into vectors in a high-dimensional space (i.e., node semantic embedding encoding vectors).

[0066] The node semantic embedding encoding vector not only contains basic node information but also implicitly contains context-related semantic information. Furthermore, the semantic embedding encoding vectors of each node in the original tree semantic embedding encoding representation reflect some semantic information and syntactic structure of the functional requirement description information of the secondary device. However, not all semantics are relevant to the understanding of the functional requirements of the secondary device and its subsequent tasks.

[0067] In other words, the semantic embedding encoding vectors of each node in the set of node semantic embedding encoding vectors may contain some noise and redundant information that is irrelevant to subsequent semantic understanding and code generation tasks. This information will affect the accuracy of semantic understanding of subsequent functional requirements and the execution of subsequent tasks, thereby affecting the quality of test case generation.

[0068] Based on this, feature sequence selection enhancement can be performed on the energy distribution spectrum of the set of node semantic embedding encoding vectors to obtain an enhanced set of node semantic embedding encoding vectors, which can better support the subsequent tasks of semantic understanding of secondary device functional requirements and generation of test cases.

[0069] Feature sequence selection enhancement based on energy distribution spectrum is a feature selection technique that optimizes the combination of node semantic embedding encoding vectors by quantizing the energy distribution of node semantic features in different parts.

[0070] In one embodiment of the present invention, step S13 may further include the following steps:

[0071] Step S21: Calculate the feature energy distribution spectrum vector of each node semantic embedding encoding vector in the set of original node semantic embedding encoding vectors to obtain the sequence of node semantic feature energy distribution spectrum vectors.

[0072] In this embodiment, feature energy distribution spectrum analysis is performed on the semantic embedding encoding vector of each node in the set of original node semantic embedding encoding vectors. The feature energy distribution spectrum vector is calculated to obtain a sequence of node semantic feature energy distribution spectrum vectors. This can quantify the distribution of the semantic embedding encoding vector of each node at different frequencies or energy levels, which helps to identify representative and informative nodes and optimize the feature selection process.

[0073] In one embodiment of the present invention, S21 may further include the following steps:

[0074] S31. Calculate the feature distribution energy co-representation vector between each node's semantic embedding encoding vector and the other nodes' semantic embedding encoding vectors in the set of node semantic embedding encoding vectors, to obtain a sequence of multiple node semantic feature distribution energy co-representation vectors.

[0075] In a specific implementation, a predetermined node semantic embedding encoding vector is extracted from the sequence of feature energy distribution spectrum vectors of the node semantic embedding encoding vector.

[0076] The maximum value is extracted element by element from the semantic embedding encoding vector of the current node and the semantic embedding encoding vectors of all other nodes to obtain a sequence of node semantic feature distribution energy collaborative representation vectors corresponding to the predetermined node semantic embedding encoding vector.

[0077] S32. Calculate the feature distribution energy collaborative factor vector of each node semantic feature distribution energy collaborative representation vector in the sequence of multiple node semantic feature distribution energy collaborative representation vectors, and obtain the sequence of node semantic feature energy distribution spectrum vectors.

[0078] In the specific implementation, the maximum value of the co-representation vector of the semantic feature distribution energy of each node is extracted from the sequence of co-representation vectors of the semantic feature distribution energy of each node, so as to obtain the sequence of the maximum values ​​of the semantic features of the nodes.

[0079] Calculate the mean and variance of the energy collaborative representation vector of the semantic feature distribution for each node, and obtain the sequence of the mean of the node semantic features and the sequence of the variance of the node semantic features.

[0080] The sequence of node semantic feature variances is added to the preset hyperparameters according to their positions to obtain the sequence of the first energy distribution coefficients of the node semantic features.

[0081] The sequence of node semantic difference values ​​is obtained by calculating the square of the difference between the sequence of node semantic feature maximum values ​​and the sequence of node semantic feature mean values.

[0082] The sequence of node semantic feature variances is multiplied by a constant two according to their positions to obtain the sequence of modulated node semantic feature variances.

[0083] The sequence of node semantic difference values ​​and the sequence of modulation node semantic feature variances are added together to obtain the feature sum. The feature sum is then added to the hyperparameter to obtain the sequence of second energy distribution coefficients of node semantic features.

[0084] Divide the sequence of the first energy distribution coefficients of the node semantic features by the sequence of the second energy distribution coefficients of the node semantic features according to their positions to obtain the node semantic feature energy distribution spectrum vector composed of multiple feature distribution energy co-factors.

[0085] Step S22: Calculate the mean vector of the sequence of node semantic feature energy distribution spectrum vectors according to their positions, and use it as the center vector of node semantic energy distribution spectrum.

[0086] In this embodiment, the positional mean vector of the node semantic feature energy distribution spectrum vector sequence is calculated to obtain the node semantic energy spectrum distribution center vector, which represents the center position of the entire node semantic in the energy distribution spectrum space.

[0087] Step S23: Calculate the energy distribution spectrum span factor between each node semantic feature energy distribution spectrum vector in the sequence of node semantic feature energy distribution spectrum vectors and obtain the sequence of node semantic energy distribution spectrum span factors.

[0088] In this embodiment, the difference between the center vector of the node semantic feature energy spectrum distribution and the energy spectrum vector of each node semantic feature is calculated to obtain the energy distribution spectrum span factor. This is used to construct a sequence of node semantic energy distribution spectrum span factors. The span factor quantifies the distance between each feature vector and the center vector, reflecting the degree of dispersion of the feature vector.

[0089] In the specific implementation, the difference between the node semantic feature energy distribution spectrum vector and the node semantic energy distribution center vector is calculated according to position to obtain the node semantic difference feature vector.

[0090] Calculate the covariance matrix between the center vector of the node semantic energy spectrum distribution and the node semantic feature energy spectrum vector, and take the reciprocal of the covariance matrix to obtain the node semantic inverse covariance matrix.

[0091] The node semantic distribution value is obtained by calculating the transpose of the node semantic difference feature vector, the product of the node semantic inverse covariance matrix and the node semantic difference feature vector.

[0092] Calculate the square root of the node semantic distribution value to obtain the node semantic energy distribution spectrum span factor.

[0093] Step S24: If the span factor of each node semantic energy distribution spectrum in the sequence of node semantic energy distribution spectrum is less than or equal to a preset threshold, then the sequence of node semantic energy distribution spectrum span factors is determined to be a set of enhanced node semantic embedding encoding vectors.

[0094] In this embodiment, the energy distribution spectrum span factor of node semantics is compared with a preset threshold. When the energy distribution spectrum span factor of each node semantic in the sequence of node semantic energy distribution spectrum span factors is less than or equal to the preset threshold, the sequence of node semantic energy distribution spectrum span factors is determined as a set of enhanced node semantic embedding encoding vectors. In this way, by selecting node semantics that are within a certain distance from the node semantic center, redundant or noisy nodes can be effectively removed, ensuring that the set of enhanced node semantic embedding encoding vectors is more relevant and representative to the semantic understanding of the functional requirements description information of subsequent secondary equipment and the generation of test cases.

[0095] In this embodiment, the feature sequence selection enhancement process can be represented as follows:

[0096] V co,j =max((V i V j )

[0097]

[0098] P i ={e i1 e i2 ,..,e ij ,..,e in}

[0099] P = {P} 1 P 2 , ..., P i , ..., P N}

[0100]

[0101]

[0102] K={f i |Dist(c,P i )≤θ}

[0103] Among them, V i and V j Let V represent the semantic embedding vectors of the i-th and j-th nodes in the set of node semantic embedding vectors, respectively. max(·, ·) represents taking the maximum value between the two vectors element by element. co,ij Let μ be the node semantic feature distribution energy co-representation vector between the semantic embedding encoding vector of node i and the semantic embedding encoding vector of node j, and max(·) be the maximum value of the extracted vector. ij and σ ij 2 V co,ijThe mean and variance of , where λ is a preset hyperparameter, e ij Let e ​​be the energy co-factor of the j-th feature distribution in the i-th node semantic feature energy distribution spectrum vector sequence. in Let P be the energy co-factor of the nth feature distribution in the semantic feature energy distribution spectrum vector of the i-th node, and let P represent the sequence of node semantic feature energy distribution spectrum vectors. i Let be the i-th node semantic feature energy distribution spectrum vector in the sequence of node semantic feature energy distribution spectrum vectors, N be the number of vectors in the sequence of node semantic feature energy distribution spectrum vectors, and c be the center vector of the node semantic energy distribution spectrum. T S is the transpose of the vector. i Dist(c,P) is the covariance matrix between the semantic feature energy distribution spectrum vector of the i-th node and the center vector of the semantic energy distribution spectrum of the node. i f is the node semantic energy distribution spectrum span factor corresponding to the semantic feature energy distribution spectrum vector of the i-th node, θ is a preset threshold, and f i K is the i-th augmented node semantic embedding encoding vector in the set of augmented node semantic embedding encoding vectors, and K is the set of augmented node semantic embedding encoding vectors.

[0104] Step S14: In the original tree semantic embedding encoding representation, replace the set of node semantic embedding encoding vectors with the set of enhanced node semantic embedding encoding vectors to obtain the enhanced tree semantic embedding encoding representation.

[0105] In this embodiment, in the original tree semantic embedding encoding representation, the set of node semantic embedding encoding vectors is replaced with the set of enhanced node semantic embedding encoding vectors to obtain the enhanced tree semantic embedding encoding representation.

[0106] Step S15: The enhanced tree semantic embedding encoding representation is input into the preset semantic encoder and encoded as a semantic encoding feature vector of functional requirement description information.

[0107] In this embodiment, the enhanced tree semantic embedding encoding representation is input into a preset semantic encoder, such as a semantic encoder based on Tree-LSTM (Tree-structured Long Short Term Memory). The semantic encoder encodes it into a semantic encoding feature vector of functional requirement description information.

[0108] Tree-LSTM, a variant of Recurrent Neural Network (RNN), can be used to process structured input data, such as syntax trees or syntactic trees. Therefore, Tree-LSTM is suitable for syntactic analysis tasks in natural language processing because it considers not only the meaning of words themselves but also the relationships between words and their positions within the sentence structure. This allows Tree-LSTM to capture the structured dependencies between words in a sentence. This helps to gain a deeper understanding of the semantics of functional requirement descriptions, thus enabling more accurate semantic understanding of the functional requirement descriptions of secondary equipment and generating more precise semantically encoded feature vectors. This understanding and encoding of the semantics of secondary equipment functional requirement descriptions ensures the intelligence and efficiency of the test case generation process, contributing to more intelligent automated testing of substation secondary equipment and supporting the comprehensiveness and accuracy of substation secondary equipment testing.

[0109] Specifically, in Tree-LSTM, the data is first represented as a tree, where each node represents a data unit (such as a word, phrase, etc.), and edges represent relationships between nodes. Each node contains an input vector and a state vector (similar to the hidden state in LSTM). The input vector can be a word embedding or other feature representation. One of the key aspects of Tree-LSTM is the recursive updating of the state of each node. For each node in the tree, its state update depends on the states of its child nodes. The state update of each node follows the update rules of LSTM, but with appropriate modifications to suit the tree structure.

[0110] The Tree-LSTM consists of: a Forget Gate (determining which information should be discarded from the state vector); an Input Gate (determining which new information should be stored); a Cell State (updating the cell state by combining information from the Forget Gate and Input Gate); and an Output Gate (determining the output state based on the updated cell state). At each level of the tree, the parent node receives information from all its child nodes and combines this information with its own input vector to update its state vector. This process is recursive, continuing until the root node. The root node ultimately contains information about the entire tree, and its state or output vector can be used for downstream tasks such as classification and regression. Tree-LSTM effectively processes tree-structured data in this way, capturing the hierarchical and sequential relationships between nodes, thus performing exceptionally well when processing complex data such as natural language processing.

[0111] During the test case generation process, the functional requirements description information of the secondary equipment is semantically encoded to accurately understand the functional requirements of the secondary equipment. A comprehensive understanding of the functional requirements of the secondary equipment can ensure that the generated test cases cover all necessary functions and scenarios, avoiding the omission of important test points.

[0112] Based on this, this embodiment involves semantically parsing the functional requirement description of the device under test (DUT) to form an abstract syntax tree (AST). A semantic understanding model based on artificial intelligence and deep learning is then introduced in the backend to analyze this AST, capturing and learning its semantic embedding encoding features. The original node embedding semantic sets are updated and replaced based on the enhanced representations of the semantic embedding semantic sets of each node in these features, resulting in an enhanced semantic embedding encoding representation of the functional requirement description. A Tree-LSTM-based semantic encoder is then used to further enhance the semantic encoding of the functional requirement description, leading to a more comprehensive and accurate understanding of the semantics of the DUT's functional requirement description. This ensures the intelligence and efficiency of the test case generation process, contributing to a more intelligent automated testing system for substation secondary equipment and supporting the comprehensiveness and accuracy of substation secondary equipment testing.

[0113] Step 105: Input the semantically encoded feature vector of the functional requirements description into the preset generator to generate the test object replacement code part and the operation data replacement code part.

[0114] In this embodiment, the semantic encoding feature vector of the functional requirement description can be optimized to improve the quality of the features.

[0115] In the specific implementation, the length of the functional requirement description semantic encoding feature vector is subtracted from its 0 norm to obtain the isolated representation value of the functional requirement description semantic encoding; the base-2 logarithm of the sum of the squares and isolated representation values ​​of the functional requirement description semantic encoding is calculated to obtain the information order value of the functional requirement description semantic encoding; a power function with the difference between the isolated representation value and one (based on each feature value of the functional requirement description semantic encoding feature vector) is calculated and multiplied by the information order value of the functional requirement description semantic encoding to obtain the functional requirement description semantic encoding information order value. The functional requirement description semantic coding leading vector is obtained by multiplying the difference between the functional requirement description semantic coding feature vector and the isolated value of the functional requirement description semantic coding minus one, and then multiplying it by the reciprocal of the isolated value of the functional requirement description semantic coding to obtain the functional requirement description semantic coding field constraint vector of the device under test; the exponential function of the functional requirement description semantic coding field constraint vector with the natural constant as the base and each feature value of the functional requirement description semantic coding field bias vector of the device under test is calculated to obtain the functional requirement description semantic coding field bias vector of the device under test; the functional requirement description semantic coding leading vector is added to the functional requirement description semantic coding field bias vector to obtain the optimized functional requirement description semantic coding feature vector.

[0116] Therefore, the optimization formula for the semantic encoding feature vector of functional requirements description can be expressed as:

[0117]

[0118] n = L - ||V||0

[0119] Where V represents the feature vector of the semantic encoding of the functional requirements description, L represents the length of the feature vector of the semantic encoding of the functional requirements description, ||·||0 represents the zero norm of the vector, n represents the isolated representation value of the semantic encoding of the functional requirements description, log(·) represents the logarithmic operation to the base 2, exp[·] represents the exponential operation to the base e, and (·) ⊙(n-1) The exponent is the difference between the isolated representation value of the semantic encoding describing the functional requirements and one, which is used to calculate the power function of the feature values ​​at each position in the feature vector. ⊙ represents dot addition, ⊙ represents dot multiplication, and V' represents the optimized semantic encoding feature vector of functional requirements description.

[0120] If optimization is completed, the semantically encoded feature vector of the functional requirements description can be input into the AIGC (Artificial Intelligence Generated Content) generator to generate the test object replacement code part and the operation data replacement code part.

[0121] The test object replacement code section contains source code related to the object under test, while the operation data replacement code section contains source code related to the data operations under test.

[0122] In this embodiment, the set of node semantic embedding encoding vectors in the semantic embedding encoding representation of the functional requirement description abstract syntax tree is replaced with a set of enhanced node semantic embedding encoding vectors to obtain an enhanced node semantic embedding encoding representation. Although this improves the accuracy and richness of the semantic encoding of each node in the abstract syntax tree, since the edges in the abstract syntax tree are not semantically reinforced, when the enhanced functional requirement description abstract syntax tree semantic embedding encoding representation is input into the Tree-LSTM-based semantic encoder for global semantic aggregation encoding, the semantic aggregation structure will be biased due to the unbalanced semantic topology distribution. It is hoped that the global semantic structural aggregation regression understandability of the functional requirement description semantic encoding feature vectors will be further improved, thereby improving the accuracy of the test object replacement code part and operation data replacement code part obtained by the test case parameter generator based on the AIGC model.

[0123] Therefore, for the high-dimensional feature manifold of the functional requirement description semantic encoding feature vector, the eigenvalues ​​of the feature set are used as the vector field representation of the aggregation dimension. The superposition values ​​of the vector field of the functional requirement description semantic encoding feature vector at isolated zero positions are used as order information to fix the local positions of the eigenvalues ​​of the feature set. A bias is added as a reward to reflect the invertibility of the feature regression distribution field of the functional requirement description semantic encoding feature vector, enabling the regression distribution of the functional requirement description semantic encoding feature vector to track the mapping target of the eigenvalue positions. This allows the feature set of the functional requirement description semantic encoding feature vector to perceive the mapping migration towards the aggregation distribution. This improves the understandability of the global semantic structure aggregation regression of the functional requirement description semantic encoding feature vector, and enhances the accuracy of the test object replacement code and operation data replacement code parts obtained from the generator. This allows for a more comprehensive and accurate understanding of the functional requirement description semantics of secondary equipment, ensuring the intelligence and efficiency of the test case generation process. It contributes to more intelligent automated testing of substation secondary equipment, providing support for the comprehensiveness and accuracy of substation secondary equipment testing.

[0124] Step 106: Construct test cases based on the code replacement parts for the test object, the code replacement parts for the operation data, and the source code parts for the test commands.

[0125] In this embodiment, the test object replacement code, the operation data replacement code, and the test command source code are effectively spliced ​​and integrated into a complete source code, which is denoted as the test case source code. Test cases are then constructed based on the test case source code, ensuring the integrity and executability of the test cases.

[0126] In the specific implementation, within the established code framework, the test object replacement code replaces the test object source code, and the operation data replacement code replaces the operation data source code, to adapt to specific testing needs.

[0127] If the replacement is completed, the test command source code, test object replacement code, and operation data replacement code are concatenated into test case source code according to the established code framework, and test cases are generated using the test case source code.

[0128] Generally, test cases are related to the function under test. The test case commands, test objects, and operation data used by the test cases correspond to a command of the abstract tester, an interface of the function under test, or the amount of calculation of the value to be measured.

[0129] Step 107: Test the secondary equipment using test cases.

[0130] In this embodiment, test cases can be run in the test platform to test the secondary equipment of the substation and verify whether the functions and performance of the secondary equipment of the substation meet expectations.

[0131] In this embodiment, a test case model for secondary equipment in a substation is obtained; the secondary equipment has functional requirement description information; the model source code is read from the test case model; the test command source code is extracted from the model source code; the functional requirement description information is semantically encoded to obtain a functional requirement description semantic encoding feature vector; the functional requirement description semantic encoding feature vector is input into a preset generator to generate test object replacement code and operation data replacement code; test cases are constructed based on the test object replacement code, operation data replacement code, and test command source code; and the test cases are used to test the secondary equipment. This embodiment generates test cases based on natural language processing technology. Through semantic analysis and encoding of the functional requirements of the secondary equipment, it can quickly generate test cases that meet actual needs, reducing manual intervention and allowing for personalized customization according to the specific functional requirements of the secondary equipment, ensuring the accuracy and effectiveness of the test cases. This not only improves the speed of test case construction but also allows test cases to be applied to different secondary equipment and testing instruments, effectively improving testing efficiency and reducing testing costs.

[0132] Example 2

[0133] See Figure 4 The diagram shows a structural schematic of a testing device for secondary equipment in a substation according to Embodiment 2 of the present invention. Figure 4 As shown, the device includes:

[0134] The test case model acquisition module 401 is used to acquire the test case model for the secondary equipment in the substation; the secondary equipment has functional requirement description information.

[0135] The model source code reading module 402 is used to read the model source code from the test case model;

[0136] The source code extraction module 403 is used to extract the test command source code portion from the model source code.

[0137] Semantic encoding module 404 is used to perform semantic encoding on the functional requirement description information to obtain a functional requirement description semantic encoding feature vector;

[0138] The code replacement generation module 405 is used to input the semantic encoding feature vector of the functional requirement description into a preset generator to generate the test object replacement code part and the operation data replacement code part;

[0139] Test case construction module 406 is used to construct test cases based on the test object replacement code part, the operation data replacement code part and the test command source code part;

[0140] The equipment testing module 407 is used to test the secondary equipment using the test cases.

[0141] In one embodiment of the present invention, the semantic encoding module 404 includes:

[0142] The abstract syntax tree construction module is used to perform semantic parsing on the functional requirement description information to obtain an abstract syntax tree.

[0143] The abstract syntax tree encoding module is used to perform semantic embedding encoding on each node and each edge in the abstract syntax tree to obtain the original tree semantic embedding encoding representation.

[0144] The semantic enhancement module is used to perform feature sequence selection enhancement on the set of node semantic embedding encoding vectors in the original tree semantic embedding encoding representation on the energy distribution spectrum to obtain a set of enhanced node semantic embedding encoding vectors.

[0145] The node replacement module is used to replace the set of node semantic embedding encoding vectors with the set of enhanced node semantic embedding encoding vectors in the original tree semantic embedding encoding representation to obtain the enhanced tree semantic embedding encoding representation.

[0146] The encoder calling module is used to encode the enhanced tree semantic embedding encoding representation into a preset semantic encoder as a semantic encoding feature vector of functional requirement description information.

[0147] In one embodiment of the present invention, the semantic enhancement module includes:

[0148] The feature energy distribution spectrum vector calculation module is used to calculate the feature energy distribution spectrum vector of each node semantic embedding encoding vector in the set of original node semantic embedding encoding vectors, so as to obtain a sequence of node semantic feature energy distribution spectrum vectors;

[0149] The energy spectrum distribution center vector calculation module is used to calculate the mean vector of the sequence of node semantic feature energy distribution spectrum vectors according to position, and use it as the node semantic energy spectrum distribution center vector;

[0150] The energy distribution spectrum span factor calculation module is used to calculate the energy distribution spectrum span factor between the node semantic energy spectrum distribution center vector and each node semantic feature energy distribution spectrum vector in the sequence of node semantic feature energy distribution spectrum vectors, and obtain the sequence of node semantic energy distribution spectrum span factors;

[0151] The enhanced node semantic determination module is used to determine the sequence of node semantic energy distribution spectrum span factors as the set of enhanced node semantic embedding encoding vectors if each node semantic energy distribution spectrum span factor in the sequence of node semantic energy distribution spectrum span factors is less than or equal to a preset threshold.

[0152] In one embodiment of the present invention, the characteristic energy distribution spectral vector calculation module includes:

[0153] The distributed energy collaborative representation vector calculation module is used to calculate the feature distributed energy collaborative representation vector between each node semantic embedding encoding vector and each other node semantic embedding encoding vector in the set of node semantic embedding encoding vectors, so as to obtain a sequence of multiple node semantic feature distributed energy collaborative representation vectors;

[0154] The distributed energy coordinating factor vector calculation module is used to calculate the feature distributed energy coordinating factor vector of the sequence of semantic feature distributed energy coordinating representation vectors of each node in the sequence of semantic feature distributed energy coordinating representation vectors of the multiple nodes, so as to obtain the sequence of semantic feature distributed energy spectral vectors of the nodes.

[0155] In one embodiment of the present invention, the distributed energy cooperative representation vector calculation module is further configured to:

[0156] Extract the predetermined node semantic embedding encoding vector from the sequence of feature energy distribution spectrum vectors of the node semantic embedding encoding vector;

[0157] The maximum value is extracted element by element from the node semantic embedding encoding vector and each of the other node semantic embedding encoding vectors to obtain a sequence of node semantic feature distribution energy collaborative representation vectors corresponding to the predetermined node semantic embedding encoding vector.

[0158] In one embodiment of the present invention, the distributed energy cooperative factor vector calculation module is further configured to:

[0159] Extract the maximum value of the joint representation vector of the semantic feature distribution energy of each node from the sequence of the joint representation vector of the semantic feature distribution energy of each node, and obtain the sequence of the maximum values ​​of the semantic features of the nodes;

[0160] The mean and variance of the semantic feature distribution energy collaborative representation vector of each node are calculated respectively to obtain the sequence of the mean of the node semantic features and the sequence of the variance of the node semantic features;

[0161] The sequence of the node semantic feature variances and the preset hyperparameters are added together according to their positions to obtain the sequence of the first energy distribution coefficients of the node semantic features;

[0162] Calculate the square of the difference between the maximum value of the node semantic features and the mean value of the node semantic features corresponding to the sequence of the maximum value of the node semantic features and the sequence of the mean value of the node semantic features, to obtain the sequence of node semantic difference values;

[0163] The sequence of the node semantic feature variances is multiplied by a constant two according to their positions to obtain the sequence of the modulated node semantic feature variances.

[0164] The sequence of node semantic difference values ​​and the sequence of modulation node semantic feature variances are added together to obtain the feature sum. The feature sum is then added to the hyperparameter to obtain the sequence of second energy distribution coefficients of node semantic features.

[0165] Divide the sequence of the first energy distribution coefficients of the node semantic features by the sequence of the second energy distribution coefficients of the node semantic features according to their positions to obtain the node semantic feature energy distribution spectrum vector composed of multiple feature distribution energy co-factors.

[0166] In one embodiment of the present invention, the energy distribution spectrum span factor calculation module is further configured to:

[0167] The difference between the node semantic feature energy distribution spectrum vector and the node semantic energy distribution center vector is calculated according to position to obtain the node semantic difference feature vector;

[0168] Calculate the covariance matrix between the node semantic energy spectrum distribution center vector and the node semantic feature energy distribution spectrum vector, and take the reciprocal of the covariance matrix to obtain the node semantic inverse covariance matrix;

[0169] The node semantic difference feature vector transpose, the node semantic inverse covariance matrix, and the node semantic difference feature vector are multiplied to obtain the node semantic distribution value.

[0170] The square root of the node semantic distribution value is calculated to obtain the node semantic energy distribution spectrum span factor.

[0171] In one embodiment of the present invention, the source code extraction module 403 is further configured to:

[0172] The source code of the model is segmented to obtain the source code of the test command, the source code of the test object, and the source code of the operation data under the code framework;

[0173] The test case construction module 406 is also used for:

[0174] In the code framework, the test object replacement code part replaces the test object source code part, and the operation data replacement code part replaces the operation data source code part, respectively.

[0175] If the replacement is completed, the test command source code, the test object replacement code, and the operation data replacement code are concatenated into the test case source code according to the code framework.

[0176] Use the source code of the test cases to generate test cases.

[0177] The testing device for substation secondary equipment provided in this embodiment of the invention can execute the testing method for substation secondary equipment provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects for executing the testing method for substation secondary equipment.

[0178] Example 3

[0179] See Figure 5 This diagram illustrates a structural schematic of an electronic device according to an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, blade servers, mainframe computers, and other suitable computers. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0180] like Figure 5As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0181] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0182] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the testing methods for substation secondary equipment.

[0183] In some embodiments, the testing method for substation secondary equipment can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the testing method for substation secondary equipment described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the testing method for substation secondary equipment by any other suitable means (e.g., by means of firmware).

[0184] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0185] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0186] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0187] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0188] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0189] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0190] Example 4

[0191] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the testing method for substation secondary equipment as provided in any embodiment of this invention.

[0192] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof. Programming languages ​​include object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0193] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0194] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A testing method for secondary equipment in a substation, characterized in that, include: Obtain test case models for the secondary equipment settings in the substation; The secondary equipment has functional requirement description information; Read the model source code from the test case model; The source code of the model is segmented to obtain the source code of the test command, the source code of the test object, and the source code of the operation data under the code framework; Semantic parsing is performed on the functional requirement description information to obtain an abstract syntax tree; Semantic embedding encoding is performed on each node and each edge in the abstract syntax tree to obtain the original tree semantic embedding encoding representation; The set of node semantic embedding encoding vectors in the original tree semantic embedding encoding representation is enhanced by feature sequence selection on the energy distribution spectrum to obtain a set of enhanced node semantic embedding encoding vectors; In the original tree semantic embedding encoding representation, the set of node semantic embedding encoding vectors is replaced with the set of enhanced node semantic embedding encoding vectors to obtain the enhanced tree semantic embedding encoding representation; The enhanced tree semantic embedding encoding representation is input into a preset semantic encoder and encoded as a semantic encoding feature vector of functional requirement description information; The semantically encoded feature vector of the functional requirement description is input into a preset generator to generate the test object replacement code part and the operation data replacement code part; In the code framework, the test object replacement code part replaces the test object source code part, and the operation data replacement code part replaces the operation data source code part, respectively. If the replacement is completed, the test command source code, the test object replacement code, and the operation data replacement code are concatenated into the test case source code according to the code framework. Use the source code of the test cases to generate test cases; The secondary device is tested using the test cases described above.

2. The method according to claim 1, characterized in that, The set of node semantic embedding encoding vectors in the original tree semantic embedding encoding representation is enhanced by feature sequence selection on the energy distribution spectrum to obtain a set of enhanced node semantic embedding encoding vectors, including: Calculate the feature energy distribution spectrum vector of each node semantic embedding encoding vector in the set of original node semantic embedding encoding vectors to obtain a sequence of node semantic feature energy distribution spectrum vectors; The mean vector of the sequence of node semantic feature energy distribution spectrum vectors is calculated according to position and used as the center vector of node semantic energy spectrum distribution; Calculate the energy distribution spectrum span factor between the center vector of the node semantic energy spectrum distribution and each node semantic feature energy distribution spectrum vector in the sequence of node semantic feature energy distribution spectrum vectors, and obtain the sequence of node semantic energy distribution spectrum span factors; If each node semantic energy distribution spectrum span factor in the sequence of node semantic energy distribution spectrum span factors is less than or equal to a preset threshold, then the sequence of node semantic energy distribution spectrum span factors is determined to be the set of the enhanced node semantic embedding encoding vectors.

3. The method according to claim 2, characterized in that, The step of calculating the feature energy distribution spectrum vector of each node semantic embedding encoding vector in the set of original node semantic embedding encoding vectors yields a sequence of node semantic feature energy distribution spectrum vectors, including: Calculate the feature distribution energy co-representation vector between each node semantic embedding encoding vector and each other node semantic embedding encoding vector in the set of node semantic embedding encoding vectors, to obtain a sequence of multiple node semantic feature distribution energy co-representation vectors; Calculate the feature distribution energy collaborative factor vector of each node semantic feature distribution energy collaborative representation vector in the sequence of the sequence of node semantic feature distribution energy collaborative representation vectors, and obtain the sequence of node semantic feature energy distribution spectrum vectors.

4. The method according to claim 3, characterized in that, The step of calculating the feature distribution energy collaborative representation vector between each node's semantic embedding encoding vector and other node semantic embedding encoding vectors in the set of node semantic embedding encoding vectors, to obtain a sequence of multiple node semantic feature distribution energy collaborative representation vectors, includes: Extract the predetermined node semantic embedding encoding vector from the sequence of feature energy distribution spectrum vectors of the node semantic embedding encoding vector; The maximum value is extracted element by element from the node semantic embedding encoding vector and each of the other node semantic embedding encoding vectors to obtain a sequence of node semantic feature distribution energy collaborative representation vectors corresponding to the predetermined node semantic embedding encoding vector.

5. The method according to claim 3, characterized in that, The step of calculating the sequence of node semantic feature distribution energy collaborative representation vectors in the sequence of node semantic feature distribution energy collaborative representation vectors, and obtaining the sequence of node semantic feature energy distribution spectrum vectors, includes: Extract the maximum value of the joint representation vector of the semantic feature distribution energy of each node from the sequence of the joint representation vector of the semantic feature distribution energy of each node, and obtain the sequence of the maximum values ​​of the semantic features of the nodes; The mean and variance of the semantic feature distribution energy collaborative representation vector of each node are calculated respectively to obtain the sequence of the mean of the node semantic features and the sequence of the variance of the node semantic features; The sequence of the node semantic feature variances and the preset hyperparameters are added together according to their positions to obtain the sequence of the first energy distribution coefficients of the node semantic features; Calculate the square of the difference between the maximum value of the node semantic features and the mean value of the node semantic features corresponding to the sequence of the maximum value of the node semantic features and the sequence of the mean value of the node semantic features, to obtain the sequence of node semantic difference values; The sequence of the node semantic feature variances is multiplied by a constant two according to their positions to obtain the sequence of the modulated node semantic feature variances. The sequence of node semantic difference values ​​and the sequence of modulation node semantic feature variances are added together to obtain the feature sum. The feature sum is then added to the hyperparameter to obtain the sequence of second energy distribution coefficients of node semantic features. Divide the sequence of the first energy distribution coefficients of the node semantic features by the sequence of the second energy distribution coefficients of the node semantic features according to their positions to obtain the node semantic feature energy distribution spectrum vector composed of multiple feature distribution energy co-factors.

6. The method according to claim 2, characterized in that, The step of calculating the energy distribution spectrum span factor between the center vector of the node semantic energy spectrum distribution and each node semantic feature energy distribution spectrum vector in the sequence of node semantic feature energy distribution spectrum vectors, to obtain the sequence of node semantic energy distribution spectrum span factors, includes: The difference between the node semantic feature energy distribution spectrum vector and the node semantic energy distribution center vector is calculated according to position to obtain the node semantic difference feature vector; Calculate the covariance matrix between the node semantic energy spectrum distribution center vector and the node semantic feature energy distribution spectrum vector, and take the reciprocal of the covariance matrix to obtain the node semantic inverse covariance matrix; The node semantic difference feature vector transpose, the node semantic inverse covariance matrix, and the node semantic difference feature vector are multiplied to obtain the node semantic distribution value. The square root of the node semantic distribution value is calculated to obtain the node semantic energy distribution spectrum span factor.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the test method for substation secondary equipment as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the test method for substation secondary equipment as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Software demand and code mapping method and system

    CN113791757A

  • Test case generation method and test method

    CN114265772A