A test case instantiation method and system based on a test semantic model library
Patent Information
- Application Number
- CN202611517171.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
这些方案在一定程度上提高了测试用例生成效率,但其测试模板或测试模型均依赖设备型号、厂家信息或统一建模规范,信号映射主要基于预设规则或固定对应关系,难以适用于不同厂家设备模型混用、非规范化模型大量存在的改扩建工程场景
1、通过构建基于测试语义的模型层,将测试模板与具体厂家、装置型号解耦,使同一测试模板能够适用于不同厂家、不同型号设备,避免因设备差异导致测试用例重复编制,提高测试资源复用能力。
Smart Images

Figure CN123011744A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system automation technology, and in particular to a test case instantiation method and system based on a test semantic model library. Background Technology
[0002] During the renovation and commissioning of smart substations, it is necessary to conduct tests on IED equipment, including setting value verification, GOOSE signal transmission, SV sampling accuracy, and overall circuit operation. Currently, due to differences in data models, signal naming, and functional definitions among IED equipment from different manufacturers and at different construction periods, commissioning personnel still need to manually analyze configuration files and develop test plans, resulting in low testing efficiency, a large workload, and a high risk of signal misconnection and missed tests.
[0003] In existing technologies, some solutions automate the testing process by establishing virtualized test templates corresponding to equipment manufacturers and models, parsing SCD / RCD files, matching templates to equipment models, and instantiating test cases. Another approach relies on standardized equipment models and setting information, using template decision-making and parameter filling to automatically verify relay protection devices. While these solutions improve test case generation efficiency to some extent, their test templates or models depend on equipment models, manufacturer information, or unified modeling specifications. Signal mapping is primarily based on preset rules or fixed correspondences, making them unsuitable for renovation and expansion projects where different manufacturers' equipment models are mixed or where non-standardized models are prevalent.
[0004] Existing technologies still suffer from two main problems: First, the lack of an intermediate abstract model independent of equipment manufacturer and device model prevents test logic from being reused without specific equipment models, necessitating the creation of new test templates when encountering new equipment. Second, the absence of an intelligent signal mapping mechanism for standardized and non-standardized equipment models hinders the automatic understanding of signal semantics from different manufacturers and the establishment of reliable mapping relationships, while also lacking the ability to accumulate and reuse manually verified results. Therefore, there is an urgent need for a method that can automatically map signals from multiple manufacturers' equipment and automatically generate debugging test cases based on a unified test semantic model. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a test case instantiation method and system based on a test semantic model library. By constructing a test semantic model library independent of equipment manufacturer and model, and combining intelligent mapping of equipment signals, confidence verification, and manual feedback mechanisms, automatic instantiation and matching of SCD / CCD file signals are achieved, generating debugging test cases that can be reused across projects, thereby improving the automation level and accuracy of intelligent substation commissioning.
[0006] The first aspect of this application discloses a test case instantiation method based on a test semantic model library, which adopts the following technical solution: Extract the signals required for testing from the standard test items, define the morpheme feature template for each signal and construct a synonym set, and combine the test semantic signal identifier to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute a test semantic model library; The processing path of the actual signal is distinguished by normalization; for the actual signal that is classified into the normalized path, the similarity with the corresponding morpheme feature template is calculated; a mapping relationship between the actual signal and the test standard semantic entries is established based on the similarity; for the actual signal that is classified into the non-normalized path, iterative matching is performed based on the dictionary and the cumulative confidence is calculated; the mapping relationship is established based on the cumulative confidence. Extract the actual signal list from the expanded configuration file, establish a correspondence between the actual signal addresses and the test standard semantic entries in the test semantic model library according to the mapping relationship, and generate an instantiated mapping table; perform integrity and consistency verification on the mapping table; when there is dualization asymmetry in the consistency verification, complete the symmetric migration of the mapping device to the missing signal device. Call the standard test template corresponding to the debugging task type, query the instantiation mapping table, replace the test semantic signal identifier placeholders in each test sub-item in the standard test template with the corresponding identifiers and parameters of the actual engineering signals, and calculate the fault parameters in combination with online setpoints; organize each test sub-item into a debugging test case sequence according to the preset timing logic.
[0007] Furthermore, the morpheme feature template is used to record the expected value of each morpheme category; The morpheme categories include logical node morphemes, data object morphemes, function type morphemes, and device instance morphemes.
[0008] Furthermore, the normalization path includes: The actual signal is decomposed into morphemes to obtain logical node class morphemes, data object morphemes, function type morphemes and device instance morphemes. For each morpheme feature template of the actual signal and the test standard semantic entry in the model library, the morpheme category similarity is calculated one by one, and the total similarity is obtained by weighting. When the total similarity is greater than the automatic confirmation threshold, a mapping relationship is established between the actual signal and the semantic entries of the test standard.
[0009] The calculation process for the weight of each morpheme category similarity includes: Statistical morpheme categories based on standard signal sets The value distribution is calculated, and the normalized information entropy is obtained to determine the morpheme category. Prior discriminant; According to morpheme category The historical misleading rate is calculated based on the mapping entries in the historical samples, and the difference between 1 and the historical misleading rate is defined as the morpheme category. Misleading punishment factors; The product of the prior discriminative power and the misleading penalty factor is taken, and then normalized for all morpheme categories to obtain the morpheme categories. Weights for similarity.
[0010] Furthermore, the non-normalized path includes: In the first round, the manufacturer, model and version in the configuration file are used as the primary keys to search for prior entries in the existing dictionary for the actual signal; if a matching prior entry is found, the matching prior entry is directly reused. If no matching prior entry is found, the candidate signal is initialized with the test standard semantic entry of all signals in the test semantic model library; The second round of execution involves structural feature matching; extracting logical node class and data object name from the actual signal to form a tuple; and extracting logical node class morphemes and data object morphemes from the candidate signal to form a tuple. The actual signal is compared with the candidate signal tuple. If they are completely identical, it is a hit. A confidence value is assigned to each round of structural feature matching, and the cumulative confidence is updated. The candidate signals with the highest cumulative confidence are selected to enter the third round. The third round of execution describes semantic matching; the text description field of the actual signal is segmented into words and matched with the synonym set of the remaining k candidate signals; when a complete match is found, the candidate signal is retained and the cumulative confidence is updated; After three rounds of execution, a mapping relationship is established between the candidate signal with the highest cumulative confidence and the actual signal.
[0011] The cumulative confidence level includes: When a matching condition is met in each round, a fixed single-round confidence level is assigned to that round; 1 minus the single-round confidence level yields the uncertainty value for each round. The cumulative confidence level for each round is 1 minus the product of the uncertainty values of the current round and the previous round.
[0012] Furthermore, the symmetric transfer includes: When two sets of equipment with dualization asymmetry are from the same manufacturer and of the same model, the actual signals that have been mapped are used to generate mapping candidates for the missing signal equipment according to the signal parameters, and a single-round confidence level is assigned to the symmetric migration.
[0013] The second aspect of this application discloses a test case instantiation system based on a test semantic model library, which executes the test case instantiation method described in the first aspect of this application. The system includes: The semantic model management module is used to extract the signals required for testing from the standard test items, define morpheme feature templates for each signal and build a set of synonyms, and combine them with the test semantic signal identifiers to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute the test semantic model library; The mapping engine module is used to distinguish the processing paths of actual signals in a normalized manner; for actual signals that fall into normalized paths, it calculates the similarity with the corresponding morpheme feature templates; based on the similarity, it establishes a mapping relationship between actual signals and test standard semantic entries; for actual signals that fall into non-normalized paths, it performs iterative matching based on the dictionary and calculates the cumulative confidence; based on the cumulative confidence, it establishes the mapping relationship. The instantiation processing module is used to extract the actual signal list from the expanded configuration file, establish a correspondence between the actual signal address and the test standard semantic entry in the test semantic model library according to the mapping relationship, and generate an instantiation mapping table; perform integrity and consistency verification on the mapping table; and when there is dualization asymmetry in the consistency verification, complete the symmetric migration of the mapping device to the missing signal device. The test case generation module is used to call the standard test template corresponding to the debugging task type, query the instantiation mapping table, replace the test semantic signal identifier placeholders in each test sub-item in the standard test template with the corresponding identifiers and parameters of the actual engineering signals, and calculate the fault parameters in combination with online setpoints; and organize each test sub-item into a debugging test case sequence according to the preset timing logic.
[0014] The beneficial effects of this invention are that, compared with the prior art, 1. By constructing a model layer based on test semantics, test templates are decoupled from specific manufacturers and device models, enabling the same test template to be applicable to different manufacturers and different models of equipment. This avoids the duplication of test case compilation due to equipment differences and improves the reusability of test resources.
[0015] 2. By embedding morpheme feature templates and synonym sets into the test semantic signals, and combining a dual-path mapping mechanism of normalized and non-normalized models, intelligent signal matching under different device models is achieved; confidence judgment and human feedback mechanisms are used to improve the mapping reliability in complex engineering environments.
[0016] 3. Feed the results of manual confirmation and mapping confidence to the knowledge base. Continuously optimize the mapping rules through positive accumulation and negative correction mechanisms, so that the system can improve matching accuracy as engineering applications increase and reduce subsequent manual intervention.
[0017] 4. By separating fault parameters from IEC 61850 configuration information, the generated test cases are independent of specific project configurations and can be reused in different substations and different renovation and expansion projects, thereby improving the efficiency of test case generation.
[0018] 5. The generated structured test cases can be directly connected to the automated testing system, covering various scenarios such as relay protection, circuit debugging, remote control verification, and waveform recording acceptance, thereby automating and standardizing the testing process.
[0019] 6. By automatically labeling morpheme weights, dynamically updating the model library, pruning erroneous mapping relationships, and utilizing mutual exclusion signal verification and dual-device mapping migration mechanisms, the system reduces manual maintenance costs and improves long-term operational stability and adaptability. Attached Figure Description
[0020] Figure 1 The flowchart illustrates the method for instantiating and generating debugging test cases based on a test semantic model library, as provided in this embodiment of the invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of this invention. The embodiments described in this application are merely some embodiments of this invention, and not all embodiments. Based on the spirit of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of this invention.
[0022] Example 1 As an embodiment of this application, a specific implementation method for generating instantiation of intelligent substation commissioning test cases based on a test semantic model library is disclosed. The execution flow of the method embodiment is as follows: Figure 1 .
[0023] This embodiment uses the expansion project of a 220kV smart substation as an example. The substation adds a new 220kV outgoing line bay and adds secondary equipment such as line protection devices (PL2208A / B), monitoring and control devices (CL2208), smart terminals (IL2208A / B), and merging units (ML2208A / B). The equipment comes from two manufacturers, A and B. The equipment from manufacturer A follows the unified modeling specifications of the enterprise intranet, while the equipment from manufacturer B adopts the manufacturer's proprietary naming method.
[0024] S1: As one implementation method of the example, construct a test semantic model library.
[0025] Extract the signals required for testing from the standard test items, define the morpheme feature template for each signal and construct a set of synonyms, and combine them with the test semantic signal identifier to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute a test semantic model library.
[0026] The establishment of the test semantic model library is a one-time offline knowledge organization task, completed using standard specification texts combined with tool assistance. Once completed, it can be reused across projects, eliminating the need for manual intervention during project application. The establishment process follows these steps: 1.1 Determine the source of the signal.
[0027] Based on the standard test items specified in the Standardized Design Specification for Relay Protection (Q / GDW 10766 series), the Inspection and Testing Specification for Relay Protection of Intelligent Substations (Q / GDW 1810-2012), and the Standardized Operation Instructions, this paper analyzes the preconditions, excitation application, and result inspection of each test item.
[0028] Based on the testing requirements for the commissioning of the entire relay protection system, this embodiment identifies the required signal types: protection device MMS signals (setting group selection, pressure plate activation / deactivation, protection action report, etc.), protection device GOOSE signals (failure start, tripping, blocking reclosing, etc.), merging unit SV signals (three-phase voltage, three-phase current sampling values), intelligent terminal GOOSE signals (circuit breaker opening / closing commands, disconnector position, etc.), and measurement and control device GOOSE signals (remote signaling changes, etc.).
[0029] 1.2 Define test semantic model entries for each signal.
[0030] For each identified signal semantics, define a unique signal identifier, the corresponding device function type, signal category, semantic name, data type, and default judgment criteria; Based on standardized modeling specifications, the morpheme feature template of the signal is summarized, namely, the expected values of the logical node class morpheme, data object morpheme, function type morpheme, and equipment instance morpheme of the signal in the standardized model. At the same time, equivalent descriptive words of the signal that have appeared in existing projects are collected to form a thesaurus. For signals with semantic opposition, mutually exclusive signal groups are also declared in the entries, such as trip command and closing command, start signal and reset signal are mutually exclusive signals. The mutually exclusive signal groups are reused across projects along with the test semantic model library, and the consistency verification in step S3 is directly called without writing mutual exclusion rules separately in each project.
[0031] 1.3 Organize the test semantic model entries into test semantic model files according to the device function type and put them into the database.
[0032] The test semantic model file is in XML format and is organized into a four-layer structure: device function type, signal category, functional semantics, and data attributes.
[0033] In one example, taking the GOOSE signal indicating the start of line protection failure in phase A as an example, the complete form of its test semantic model definition is as follows: <devtype name="线路保护" class="PL"> <sigclass type="GOOSE" dir="输出"> <signal id="PL_GO_STRBF_A" name="启动A相失灵" datatype="布尔量"> <criterion> The strain gauge is 1 when the A-phase fault exits in the entire transmission system.< / criterion> <morphtemplate lnClass="PTRC" do="StrBF" phase="phsA" func="失灵启动" / > <synonyms> Phase A fails to start; Phase A fails to start; Phase A fails to start.< / synonyms> < / signal> < / sigclass> < / devtype> Among them, MorphTemplate is the morpheme feature template, which records the expected values of the signal in the morpheme categories such as logical node class (PTRC), data object (StrBF), phase (phsA), and functional description (failure start) in the device model that follows the unified modeling specifications of the enterprise intranet. It is the comparison anchor point for signal mapping in step S2; Synonyms is the synonym set, which records the equivalent descriptive words that the signal has appeared in the project; Criterion is the default judgment criterion, which is used in step S4 to generate the expected result.
[0034] The test semantic model is a test semantic abstraction layer built on top of the IEC 61850 information model. It does not constitute a new communication model itself. After each test semantic signal is instantiated in step S3, it corresponds to the IEC 61850 data reference (logical device / logical node.data object.data attribute) and report control block, GOOSE control block, or sampled value control block reference of the actual device. During test execution, the test engine accesses the actual device through IEC 61850 standard services (MMS message interaction, GOOSE / SV subscription) according to the mapping result. That is, the test semantic model is completely mapped back to the IEC 61850 protocol interface at the execution level, and the device under test does not need to make any adaptation.
[0035] The test semantic model library established in this embodiment defines 47 types of MMS signals, 68 types of GOOSE signals, and 12 types of SV signals, covering common relay protection debugging scenarios.
[0036] 1.4. Build a standard test template library.
[0037] While analyzing the standard test items item by item in 1.1, each standard test item is organized into a standard test template: each test sub-item in the template consists of three parts: preconditions, stimulus application, and expected result. All referenced signals are recorded as placeholders using test semantic signal identifiers. The template is indexed according to the debugging task type and stored in the test semantic model library together with the test standard semantic entries for step S4 to call according to the debugging task type.
[0038] S2: As one implementation method of the embodiment, establish a signal dictionary mapping relationship.
[0039] The overall logic of the mapping is as follows: using the morpheme feature template and the set of synonyms embedded in the test semantic signal as anchors, the actual device signal is compared with the test semantic signal one by one.
[0040] Before comparison, determine the standardization of the device model: parse the modeling specification declaration and logical node naming format in the CCD / ICD file. Device models that conform to the unified modeling specification of the enterprise intranet are entered into the standardized path; otherwise, they are entered into the non-standardized path.
[0041] The two paths use weighted similarity score and iterative confidence score as quantitative indicators of mapping credibility, respectively, and uniformly perform dual-threshold judgment: reaching the automatic confirmation threshold. Automatically create dictionary mapping entries; subject to manual confirmation threshold. and The output candidate list between [a certain value] and [a certain value] should be submitted for manual confirmation; below [a certain value] The result is determined to be uncovered. This embodiment takes... =0.85、 =0.60.
[0042] Import the CCD configuration files of each newly added IED device and extract the actual signal list.
[0043] 2.1 For the line protection PL2208A from vendor A (following the enterprise intranet unified modeling specifications), the path 1-morpheme weighted similarity algorithm is used for processing. The specific process is as follows: (1) Perform morpheme decomposition.
[0044] The reference fields are segmented according to the natural segmentation of IEC 61850 references (logical device / logical node. data object. data attribute), and Chinese word segmentation is performed on the description fields to decompose the actual signals into four types of morphemes: device instance morpheme (weight 0.10), logical node type morpheme (weight 0.35), function type morpheme (weight 0.15), and data object morpheme (weight 0.40).
[0045] Weighting coefficients are assigned based on the distinguishing ability of each morpheme category within the standard signal set: logical node classes and data objects directly determine signal semantics and have the strongest distinguishing ability, thus receiving higher weights; device instances only distinguish the device to which signals of the same type belong and have the weakest distinguishing ability, thus receiving the lowest weights. The assignment is not based on manual experience but is determined by two factors: prior distinguishability and misleading penalty. Prior discrimination: For each morpheme category, the normalized information entropy of the standard signal set after dividing it according to the values of that category is calculated. The more dispersed the values and the larger the information entropy, the stronger the discrimination ability of that category. This normalized information entropy is used as the discrimination of that category, i.e.: ; In the formula, For morpheme category Distinctiveness Category in the standard signal set The number of different possible values, For category Take the first The proportion of the number of signals with a given value to the total number of signals in the standard signal set.
[0046] Misleading Penalty Factor: In historical samples, when a mapping automatically confirmed by weighted similarity is determined to be conflicting by the consistency check in step S3 and is ruled as erroneous by the operator or manually corrected by the operator, morpheme attribution is performed on the erroneous mapping: category similarity is reviewed category by category, and for each morpheme category with a category similarity not lower than the automatic confirmation threshold, a misleading error is recorded; multiple morpheme categories are allowed to add one misleading error count for the same erroneous mapping, but the same category is counted only once for this erroneous mapping. Let the categories be... The cumulative number of misleading incidents is The cumulative number of times participating in automatic confirmation mapping is The misleading penalty factor is: ; When the number of participations is greater than 0 Defined as a morpheme category The historical misleading rate represents the proportion of misleading records generated by this category according to the above rules to its cumulative participation records; when the number of participations is equal to 0, there are no historical participation records for this category, and the misleading penalty factor is 1.
[0047] The weight coefficients for each category are the normalized values of the product of the discrimination index and the penalty factor: ; In the formula, The entire morpheme category is traversed. After the model library is expanded with new signal types, the discrimination index is recalculated. After the mapping confirmation of each project is completed, the penalty factor is updated according to the cumulative misleading records. The weights are automatically updated without the need for manual parameter readjustment. This embodiment is in the initial state, with no error correction records for each category, and the penalty factor is 1 for all categories. The above weight combination is obtained according to the discrimination index of the current model library.
[0048] (2) Then calculate the similarity for each class and sum them by weight.
[0049] For a certain morpheme unit Its corresponding expected value in the morpheme feature template The similarity is: ; To normalize the edit distance similarity; For the thesaurus hit indicator function, if Hit If the word is in the thesaurus, it is recorded as 1.0; otherwise, it is recorded as 0.
[0050] Such as a certain morpheme category Includes individual morpheme unit Then the similarity of this category is: ; in, For the first in this category template One expected value.
[0051] The weighted total similarity is then: ; in, The morpheme categories include data object morphemes, logical node morphemes, function type morphemes, and device instance morphemes. The weights for each morpheme category.
[0052] (3) Dual threshold determination; When the weighted total similarity is greater than or equal to the automatic confirmation threshold, i.e. At that time, the actual equipment signals are automatically mapped to dictionary mapping entries in the test semantic model library; when At that time, output the candidate list and submit it for manual confirmation; when At that time, it is determined to be uncovered.
[0053] In one implementation example, taking the actual signal PIGO / goPTRC1.StrBF.phsA as an example: the instance number, logical node class morpheme PTRC, data object morpheme StrBF and phase morpheme phsA in the device instance morpheme goPTRC1 are obtained by segmentation, and the description field is segmented to obtain the function type morpheme "startup failure".
[0054] The data object category contains two morpheme units, StrBF and phsA. When the same morpheme category contains multiple morpheme units, the similarity of each morpheme unit with each expected value of the category in the morpheme feature template is calculated, and the maximum value is taken one by one. Then, the average value is taken according to the number of morpheme units to obtain the similarity of the category.
[0055] Taking the candidate test semantic signal "Start-up Phase A Failure" (morpheme feature template: lnClass=PTRC, do=StrBF, phase=phsA, func=failure-start) as an example: the logical node class morpheme PTRC has the same value as the template, with a similarity of 1.0; the two morpheme units StrBF and phsA of the data object class have the same value as the template, with a similarity of 1.0; the function type morpheme "start-up failure" is matched with "failure-start" through the synonym set, with a similarity of 1.0; the edit distance similarity between the device instance morpheme and the expected form of the template is 0.5. The weighted summation yields a weighted similarity score S=0.35×1.0+0.40×1.0+0.15×1.0+0.10×0.5=0.95, which is the highest score in the entire database and exceeds the automatic confirmation threshold of 0.85. The mapping relationship is automatically confirmed and written into the dictionary entry.
[0056] 2.2 For the smart terminal IL2208A from manufacturer B (the signal name is a proprietary name of the manufacturer), path 2 - iterable dictionary index processing is adopted.
[0057] Source and structure of the dictionary: The dictionary was initially formed by batch importing mapping records from existing projects and manually verifying them. It was then continuously accumulated and expanded in various project applications. Each dictionary entry includes nine fields: equipment manufacturer, device model, model version, original signal reference, original description, mapping target test semantic signal identifier, mapping confidence, entry source (automatic verification or manual verification), and number of hits.
[0058] The iterative matching process is as follows: (1) First round: Prior retrieval; Using manufacturer, model, and version as primary keys, prior entries are retrieved from the dictionary database. The primary keys are taken from the manufacturer, type, and configuration version fields of the IED in the CCD / ICD file.
[0059] Taking the signal RPIT / CBAXCBR1.Pos.stVal as an example, in the first round, no prior entry for this model was found in the dictionary. The confidence level for this single round is... Cumulative confidence level ; The candidate set is initialized with all 38 GOOSE output signals under the smart terminal type in the test semantic model library.
[0060] (2) Second round: Structural feature matching; Extract the structural skeleton of the actual signal, including logical node class + data object name (LN Class, DO name), i.e., XCBR+Pos; extract lnClass+do from the morpheme feature template of the candidate signal (test semantic model library); compare the structural skeleton of the actual signal with the candidate signal; When the (LN Class, DO name) tuple of the actual signal completely matches the (lnClass, do) tuple of the candidate signal, it is considered a hit, and a fixed empirical confidence value is assigned to this round; that is... The value is assigned to 0.60, and the cumulative confidence level is... ;in, and These represent the uncertainty values for the first and second rounds, respectively; if no match is found, The candidate is eliminated.
[0061] The top 5 candidate signals with the highest cumulative confidence scores will be retained for the third round. (3) Third round: Describing semantic matching; The textual description field of the actual signal is segmented, and words irrelevant to the signal semantics, such as device names and interval numbers, are removed. The remaining meaningful words are then normalized according to their synonym sets to obtain the descriptive word set of the actual signal. The equivalent descriptive words in the synonym sets of the remaining candidate signals are segmented in the same way to obtain their respective template word sets. When a candidate signal is completely matched, it is retained, and the confidence level is calculated in a single round. Assign a value of 0.7, and update the cumulative confidence level to [value missing]. . This represents the uncertainty value in the third round.
[0062] The criterion for a complete hit is that the word set is consistent in both directions, that is, the descriptive word set of the actual signal is exactly the same as the content words contained in a certain template word set, and neither side has any extra or missing content words; the candidate signal that does not hit completely does not have its single-round confidence score added in this round, and its cumulative confidence score maintains the value of the previous round.
[0063] (4) Final judgment; If a real signal is directly matched with a complete mapping record in the dictionary in the first round (i.e., the binding relationship of "real signal → standard semantic entry"), then the mapping relationship in the prior entry is directly reused.
[0064] Cumulative confidence and weighted total similarity of normalized paths are both quantitative indicators of mapping credibility. They are subject to the same dual-threshold judgment rule, with shared threshold values: entries with a cumulative confidence not lower than the automatic confirmation threshold of 0.85 are automatically generated into dictionary mapping entries; output candidate lists with a cumulative confidence between the manual confirmation thresholds of 0.60 and 0.85 are submitted for manual confirmation; and entries with a cumulative confidence below 0.60 are judged as not covered.
[0065] If a given signal has no prior entry in the first round, even if the cumulative confidence level of 0.88 exceeds the automatic confirmation threshold of 0.85, it will still be submitted for manual confirmation as per the rule for first-time mapping of signals without prior information, thus downgrading to manual confirmation to prevent systematic mismapping of new signals. A list of candidate signals sorted by cumulative confidence level is output. After the operator confirms the highest candidate signal (e.g., "circuit breaker position") is correct, the mapping, along with the manufacturer, model, and version characteristics, is written back to the dictionary, with the confidence level set to 1.0 and the entry source marked as "manual confirmation," serving as prior knowledge for subsequent equipment of the same model. Subsequently, when the same model of equipment appears in other projects, the first round will hit the prior entry, directly providing a high-confidence candidate.
[0066] (5) Negative feedback pruning of dictionary entries; The self-learning of the dictionary database has two directions: positive and negative. Manual confirmation and hit reuse increase the confidence of entries and accumulate the number of hits, which is a positive accumulation. When the automatic mapping given by a prior item is found to be conflicting by the consistency check in step S3 or is manually corrected by the operator, confidence decay is performed on that item. The confidence level after decay is the confidence level before decay multiplied by 1. , For the attenuation coefficient, this embodiment takes... =0.5, and the number of corrections for this entry is incremented by one.
[0067] Entries whose confidence level decays below the manual confirmation threshold are reduced to prompt-only entries and no longer participate in automatic confirmation. They are only listed in the candidate list for manual reference.
[0068] The decay results are directly entered into subsequent matching operations: decayed entries are no longer applicable for direct reuse in the final judgment. When the entry is hit in the first round of retrieval in the subsequent process, the decayed confidence is used as the first single-round confidence to enter the cumulative confidence iteration, and evidence must be accumulated again through the next two rounds of matching; in the mismapping that triggers decay, the entries that were originally established by automatic confirmation through weighted similarity are simultaneously subjected to morpheme attribution and the misleading penalty factor of the corresponding morpheme category is updated as described in 2.1.
[0069] Through continuous adjustments in both positive accumulation and negative decay directions, the confidence level of dictionary entries rises and falls with the correct and incorrect records in actual use, and early mismappings will not be repeatedly and automatically reused in subsequent projects.
[0070] S3: As one implementation method of the embodiment, instantiation mapping and mapping verification are performed on the project SCD / CCD file.
[0071] 3.1 Instantiating the mapping; (1) Import the expanded project SCD file and parse the communication parameters of each newly added IED device, including the application identifier (APPID), media access control (MAC) address, control block parameters and channel configuration of each GOOSE control block and sampled value control block; (2) Import the CCD configuration files of each IED one by one and extract the actual signal list; (3) Query the dictionary mapping relationship established in step S2 for each signal and establish a correspondence between the actual signal address and the test semantic signal in the test semantic model library; (4) Each row in the table records the test semantic signal identifier, the IEC 61850 data reference of the actual signal, the reference of the control block to which it belongs, the APPID, the MAC address and the channel number.
[0072] The instantiation mapping table generated in this embodiment contains a total of 287 signal entries, covering all signals involved in the debugging of the newly added interval.
[0073] 3.2 Perform integrity and consistency checks on the mapping table; (1) Integrity verification; Based on the standard test template used in this debugging task; Extract all test semantic signals referenced in the template to form a baseline signal set, and check one by one whether the signals in the baseline signal set have established corresponding relationships in the instantiation mapping table.
[0074] (2) Consistency check; The purpose of consistency checks is to prevent logical conflicts or configuration asymmetry, including semantic mutual exclusion checks and dualization asymmetric checks; Semantic mutual exclusion check: This checks whether the same actual signal has been incorrectly mapped to two semantically mutually exclusive test semantics. For example, the same GOOSE input might be mapped to both a trip command and a close command. The mutual exclusion relationship between test semantics is a predefined logical rule, i.e., the mutually exclusive signal group declared in the test semantic model entries in step S1. This belongs to the intrinsic semantic constraints of the test semantic model library and can be reused across projects with the model library, without needing to configure separate check rules for specific projects. The post-processing when the check fails is as follows: all mapping entries involved in the mutual exclusion pair are downgraded to pending manual confirmation, and a candidate list of the actual signal is output in descending order of mapping confidence. The operator decides to retain one of them. If the mapping determined to be incorrect comes from a priori entries in the dictionary library, then confidence decay and error correction counting are performed on that entry as described in step S2.
[0075] Dual-configuration asymmetry check: For dual-configuration equipment sets A and B, check whether the mapping results are symmetrical. For example, does a signal mapped in set A have a corresponding mapping in set B?
[0076] Dual-function devices are automatically identified by the system through the parsing of the project SCD file: two devices with the same interval, the same device function type, and IED names that differ only in the set identifier characters (such as PL2208A and PL2208B) are identified as a pair of dual-function devices. The identification results are listed in the verification report for manual verification.
[0077] The verification content is set symmetry, that is, the set of test semantic signals mapped in set A should correspond one-to-one with set B.
[0078] There are two scenarios for post-processing when the verification fails: (1) When the two sets of devices are from the same manufacturer and of the same model, the symmetrical migration is performed based on the set that has been mapped. The signal references of the confirmed mapping entries of the set are replaced isomorphically according to the set identifier to generate the mapping candidate of the other set of missing signals. The reliability of this type of candidate is derived from the confirmed mapping isomorphic replacement. The reliability depends on the structural symmetry of the dual configuration and is not related to whether the set of equipment models follows the modeling specifications. Therefore, it is not re-matched according to the normalized or non-normalized path. The single-round confidence of symmetrical migration is directly assigned. In this embodiment, it is 0.80. The confidence is used as a quantitative indicator of the reliability of the mapping. The same unified double threshold judgment is performed as in step S2. Since 0.80 is between the manual confirmation threshold of 0.60 and the automatic confirmation threshold of 0.85, the candidate list is output and submitted for manual confirmation. (2) When the two sets of devices are from different manufacturers or are different models, the reference structures do not have isomorphic substitution relationships. The test semantic signals with missing mappings are incorporated into the list of uncovered signals, and candidate signals are attached for manual identification according to the anomaly handling process in 3.3. The manual confirmation results are all written back to the dictionary database along with the model characteristics. After one set of devices completes the mapping, the missing mappings of the other set do not need to be matched from scratch.
[0079] 3.3. Exception handling; For signals not automatically mapped and covered, a list of uncovered signals is output. The list includes the morpheme decomposition results for each signal, as well as the top three candidate signals with the highest mapping scores. The mapping score here refers to the overall quantization score of each candidate test semantic signal, not the similarity of a single morpheme: the mapping score for signals processed by the normalized path is the weighted total similarity, while the mapping score for signals processed by the non-normalized path is the cumulative confidence score after the last iteration. Candidates are selected in descending order of this score, with the top three chosen. Operators refer to the candidate list to identify the correct mapping. After manual confirmation, all integrity and consistency checks pass.
[0080] S4: As one implementation method of the embodiment, automatically generate debugging test cases.
[0081] 4.1. Based on the current commissioning task (e.g., commissioning of the entire line protection bay), call the corresponding standard test template in the test semantic model library according to the task type, that is, the standard test template for commissioning the entire line protection group organized and entered into the library in step S1.4.
[0082] Each test sub-item in the template consists of three parts: preconditions, incentive application, and expected result.
[0083] All referenced signals are placed using the test semantic signal identifier.
[0084] For example, the line protection template includes 10 test sub-items, covering protection activation condition confirmation, differential protection action verification, backup protection timing verification, and failure start-up circuit verification.
[0085] 4.2. Traverse all placeholders in the template and, by querying the "instantiation mapping table" generated in the S3 stage, replace the abstract "test semantic signal identifier" with the specific DataRef path and GOOSE control block identifier of the actual engineering signal.
[0086] 4.3. Based on the device settings called online, calculate the pre-fault parameters, fault parameters, and post-fault parameters required for each fault type.
[0087] 4.4 Organize the test sub-projects according to the time sequence logic to generate a complete test case sequence.
[0088] In a further implementation, to achieve flexibility and reusability of test cases, the generated test cases are split into two independent files for storage: (1) Fault quantity file: Records parameters that are not related to the specific project, such as fault type, fault location, input and output quantity, pressure plate status, and protection action information; (2) Configuration file: Records information such as APPID, MAC address, and number of data attributes of SV and GOOSE that change with the project.
[0089] When the same test case is applied to other substations or devices, the fault quantity file is reused as is, and the configuration file is re-exported only based on the virtual terminal connection of the device under test, thus realizing the cross-project reuse of test cases.
[0090] This embodiment outputs the test case sequence in JSON format, which can be directly imported into an automated testing system for execution without the need for manual secondary conversion.
[0091] Example 2 As an embodiment of this application, a test case instantiation system based on a test semantic model library is disclosed. Employing the specific implementation method described in Embodiment 1 above, the system includes: The semantic model management module is used to extract the signals required for testing from the standard test items, define morpheme feature templates for each signal and build a set of synonyms, and combine them with the test semantic signal identifiers to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute the test semantic model library; The mapping engine module is used to distinguish the processing paths of actual signals in a normalized manner; for actual signals that fall into normalized paths, it calculates the similarity with the corresponding morpheme feature templates; based on the similarity, it establishes a mapping relationship between actual signals and test standard semantic entries; for actual signals that fall into non-normalized paths, it performs iterative matching based on the dictionary and calculates the cumulative confidence; based on the cumulative confidence, it establishes the mapping relationship. The instantiation processing module is used to extract the actual signal list from the expanded configuration file, establish a correspondence between the actual signal address and the test standard semantic entry in the test semantic model library according to the mapping relationship, and generate an instantiation mapping table; perform integrity and consistency verification on the mapping table; and when there is dualization asymmetry in the consistency verification, complete the symmetric migration of the mapping device to the missing signal device. The test case generation module is used to call the standard test template corresponding to the debugging task type, query the instantiation mapping table, replace the test semantic signal identifier placeholders in each test sub-item in the standard test template with the corresponding identifiers and parameters of the actual engineering signals, and calculate the fault parameters in combination with online setpoints; and organize each test sub-item into a debugging test case sequence according to the preset timing logic.
[0092] As an embodiment of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is loaded onto the processor, it adopts the specific implementation method described in the test case instantiation method of Embodiment 1 above.
[0093] As an embodiment of this application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, it adopts the specific implementation method described in the test case instantiation method of Embodiment 1 above.
[0094] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0095] This disclosure can be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this disclosure.
[0096] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination of the foregoing. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0097] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0098] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute 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 a remote computer, the remote computer may 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 may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the claims of the present invention.
Claims
1. A test case instantiation method based on a test semantic model library, characterized in that, include: Extract the signals required for testing from the standard test items, define the morpheme feature template for each signal and construct a synonym set, and combine the test semantic signal identifier to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute a test semantic model library; The processing path of the actual signal is distinguished by normalization; for the actual signal that is classified into the normalized path, the similarity with the corresponding morpheme feature template is calculated; A mapping relationship between actual signals and semantic entries in the test standard is established based on similarity. For actual signals classified into nonnormalized paths, iterative matching is performed based on a dictionary, and cumulative confidence is calculated; the mapping relationship is then established based on the cumulative confidence. Extract the actual signal list from the expanded configuration file, establish a correspondence between the actual signal addresses and the test standard semantic entries in the test semantic model library according to the mapping relationship, and generate an instantiated mapping table; perform integrity and consistency verification on the mapping table; When there is dualization asymmetry in the consistency check, the mapping device performs symmetrical migration to the device with missing signal; Call the standard test template corresponding to the debugging task type, query the instantiation mapping table, replace the test semantic signal identifier placeholders in each test sub-item in the standard test template with the corresponding identifiers and parameters of the actual engineering signals, and calculate the fault parameters in combination with online setpoints; organize each test sub-item into a debugging test case sequence according to the preset timing logic.
2. The test case instantiation method based on a test semantic model library according to claim 1, characterized in that, The morpheme feature template is used to record the expected value of each morpheme category; The morpheme categories include logical node morphemes, data object morphemes, function type morphemes, and device instance morphemes.
3. The test case instantiation method based on a test semantic model library according to claim 1, characterized in that, The normalization path includes: The actual signal is decomposed into morphemes to obtain logical node class morphemes, data object morphemes, function type morphemes and device instance morphemes. For each morpheme feature template of the actual signal and the test standard semantic entry in the model library, the morpheme category similarity is calculated one by one, and the total similarity is obtained by weighting. When the total similarity is greater than or equal to the automatic confirmation threshold, a mapping relationship is established between the actual signal and the semantic entries of the test standard.
4. The test case instantiation method based on a test semantic model library according to claim 3, characterized in that, The calculation process for the weight of each morpheme category similarity includes: Statistical morpheme categories based on standard signal sets The value distribution is calculated, and the normalized information entropy is obtained to determine the morpheme category. Prior discriminant; According to morpheme category The historical misleading rate is calculated based on the mapping entries in the historical samples, and the difference between 1 and the historical misleading rate is defined as the morpheme category. Misleading punishment factors; The product of the prior discriminative power and the misleading penalty factor is taken, and then normalized for all morpheme categories to obtain the morpheme categories. Weights for similarity.
5. The test case instantiation method based on a test semantic model library according to claim 1, characterized in that, The non-normalized path includes: In the first round, the manufacturer, model and version in the configuration file are used as the primary keys to search for prior entries in the existing dictionary for the actual signal; if a matching prior entry is found, the matching prior entry is directly reused. If no matching prior entry is found, the candidate signal is initialized with the test standard semantic entry of all signals in the test semantic model library; The second round of execution involves structural feature matching; extracting logical node class and data object name from the actual signal to form a tuple; and extracting logical node class morphemes and data object morphemes from the candidate signal to form a tuple. The actual signal is compared with the candidate signal tuple. If they are completely identical, it is a hit. A confidence value is assigned to each round of structural feature matching, and the cumulative confidence is updated. The candidate signals with the highest cumulative confidence are selected to enter the third round. The third round of execution describes semantic matching; the text description field of the actual signal is segmented into words and matched with the synonym set of the remaining k candidate signals; when a complete match is found, the candidate signal is retained and the cumulative confidence is updated; After three rounds of execution, a mapping relationship is established between the candidate signal with the highest cumulative confidence and the actual signal.
6. The test case instantiation method based on a test semantic model library according to claim 5, characterized in that, The cumulative confidence level includes: When a matching condition is met in each round, a fixed single-round confidence level is assigned to that round; 1 minus the single-round confidence level yields the uncertainty value for each round. The cumulative confidence level for each round is 1 minus the product of the uncertainty values of the current round and the previous round.
7. The test case instantiation method based on a test semantic model library according to claim 1, characterized in that, The symmetric transfer includes: When two sets of equipment with dualization asymmetry are from the same manufacturer and of the same model, the actual signals that have been mapped are used to generate mapping candidates for the missing signal equipment according to the signal parameters, and a single-round confidence level is assigned to the symmetric migration.
8. A test case instantiation system based on a test semantic model library, executing the test case instantiation method as described in any one of claims 1-7, characterized in that, The system includes: The semantic model management module is used to extract the signals required for testing from the standard test items, define morpheme feature templates for each signal and build a set of synonyms, and combine them with the test semantic signal identifiers to form a test standard semantic entry for a signal; the test standard semantic entries of all signals constitute the test semantic model library; The mapping engine module is used to distinguish the processing paths of actual signals in a normalized manner; for actual signals that fall into normalized paths, it calculates the similarity with the corresponding morpheme feature templates; based on the similarity, it establishes a mapping relationship between actual signals and test standard semantic entries; for actual signals that fall into non-normalized paths, it performs iterative matching based on the dictionary and calculates the cumulative confidence; based on the cumulative confidence, it establishes the mapping relationship. The instantiation processing module is used to extract the actual signal list from the expanded configuration file, establish a correspondence between the actual signal address and the test standard semantic entry in the test semantic model library according to the mapping relationship, and generate an instantiation mapping table; perform integrity and consistency verification on the mapping table; and when there is dualization asymmetry in the consistency verification, complete the symmetric migration of the mapping device to the missing signal device. The test case generation module is used to call the standard test template corresponding to the debugging task type, query the instantiation mapping table, replace the test semantic signal identifier placeholders in each test sub-item in the standard test template with the corresponding identifiers and parameters of the actual engineering signals, and calculate the fault parameters in combination with online setpoints; and organize each test sub-item into a debugging test case sequence according to the preset timing logic.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is loaded into the processor, it implements the test case instantiation method according to any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the test case instantiation method according to any one of claims 1-7.
