Intelligent Generation Method and Platform for Electromagnetic Safety Test Cases

By parsing historical test cases and electromagnetic safety standard documents using a natural language processing model, test cases that conform to electromagnetic safety anomaly scenarios are generated. This solves the problem of test cases not being associated with anomaly scenarios in existing technologies, and realizes intelligent generation of electromagnetic safety test cases and improves application effectiveness.

CN121090966BActive Publication Date: 2026-01-30MILITARY SECRECY QUALIFICATION EXAMINATION & CERTIFICATION CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511622123.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-07
Publication Date
2026-01-30
Estimated Expiration
2045-11-07

AI Technical Summary

Technical Problem

Existing methods for generating electromagnetic safety test cases fail to effectively link test cases with abnormal scenarios, resulting in poor practical application effects of the generated test cases.

Method used

By analyzing historical test cases using a pre-trained natural language processing model, abnormal electromagnetic safety scenarios are identified. Test information is obtained from electromagnetic safety standard documents to generate corresponding test cases. The generation model is then optimized by combining historical test cases and correction rules to improve accuracy.

Benefits of technology

It realizes the intelligent generation of electromagnetic safety test cases, improves the practical application effect of test cases, and ensures that the generated test cases can characterize specific electromagnetic safety anomaly scenarios and meet actual needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121090966B_ABST
    Figure CN121090966B_ABST
Patent Text Reader

Abstract

This disclosure relates to an intelligent generation method and platform for electromagnetic safety test cases, belonging to the field of computer technology. It analyzes historical test cases using a natural language processing model to obtain corresponding electromagnetic safety anomaly scenarios. When these scenarios fail to meet the requirements for power plant safety anomalies, a first electromagnetic safety anomaly scenario requiring test case generation is identified. The natural language processing model then parses the corresponding test information from electromagnetic safety standard documents to generate test cases for this first scenario. Using this test information, test cases for the first electromagnetic safety anomaly scenario are generated. Associating test cases with electromagnetic safety anomaly scenarios ensures that the generated test cases can characterize specific electromagnetic safety anomaly scenarios. By combining historical test cases, the electromagnetic safety anomaly scenarios requiring test case generation are determined, ensuring that the generated test cases meet actual test case requirements and improving the practical application effectiveness of the test cases.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and more specifically, to an intelligent generation method and platform for electromagnetic safety test cases. Background Technology

[0002] With the development of computer technology, test cases can be generated through artificial intelligence in more and more scenarios. This artificial intelligence approach can save the cost of manually writing test cases and improve the efficiency of test case generation.

[0003] In the field of electromagnetic safety, test cases can also be generated using artificial intelligence. However, current generation methods do not effectively associate test cases with abnormal scenarios and do not take into account the biases inherent in AI-generated test cases, resulting in poor practical application effects. Summary of the Invention

[0004] The purpose of this disclosure is to provide an intelligent generation method and platform for electromagnetic safety test cases. This intelligent generation method and platform can realize the intelligent generation of electromagnetic safety test cases and improve the practical application effect of test cases.

[0005] To achieve the above objectives, in a first aspect, this disclosure provides an intelligent generation method for electromagnetic safety test cases, comprising: parsing historical test cases using a pre-trained natural language processing model to obtain electromagnetic safety anomaly scenarios corresponding to the historical test cases; determining a first electromagnetic safety anomaly scenario for which test cases need to be generated when the electromagnetic safety anomaly scenarios corresponding to the historical test cases cannot meet the requirements; parsing electromagnetic safety standard documents using the pre-trained natural language processing model based on the first electromagnetic safety anomaly scenario to obtain test information corresponding to the first electromagnetic safety anomaly scenario; and generating test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario.

[0006] Optionally, generating test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario includes: generating initial test cases under the first electromagnetic safety anomaly scenario using a pre-trained generative model based on the test information corresponding to the first electromagnetic safety anomaly scenario; parsing the initial test cases under the first electromagnetic safety anomaly scenario using the pre-trained natural language processing model to obtain parsed information; and correcting the initial test cases under the first electromagnetic safety anomaly scenario based on the parsed information, the first electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario.

[0007] Optionally, the parsing information includes: a reference electromagnetic safety anomaly scenario and reference test information. The step of correcting the initial test cases under the first electromagnetic safety anomaly scenario based on the parsing information, the first electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario includes: comparing the reference electromagnetic safety anomaly scenario with the first electromagnetic safety anomaly scenario; if the reference electromagnetic safety anomaly scenario and the first electromagnetic safety anomaly scenario are the same, comparing the reference test information with the test information corresponding to the first electromagnetic safety anomaly scenario; if the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario match, performing rule correction on the initial test cases under the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario; if the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario do not match, correcting the initial test cases under the first electromagnetic safety anomaly scenario based on the difference information between the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario.

[0008] Optionally, the intelligent generation method for electromagnetic safety test cases further includes: when the reference electromagnetic safety anomaly scenario is different from the first electromagnetic safety anomaly scenario, generating optimized training data based at least on the reference test information, the reference electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario; optimizing and training the pre-trained generative model based on the optimized training data to obtain an optimized generative model; and generating corrected test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario using the optimized generative model.

[0009] Optionally, the intelligent generation method for electromagnetic safety test cases further includes: determining a second electromagnetic safety anomaly scenario that requires adjustment of test cases, provided that the electromagnetic safety anomaly scenario corresponding to the historical test cases can meet the requirements; parsing the electromagnetic safety standard document according to the second electromagnetic safety anomaly scenario using the pre-trained natural language processing model to obtain the test information corresponding to the second electromagnetic safety anomaly scenario; determining the historical test cases under the second electromagnetic safety anomaly scenario from the historical test cases; and generating updated test cases under the second electromagnetic safety anomaly scenario based on the test information corresponding to the second electromagnetic safety anomaly scenario and the historical test cases under the second electromagnetic safety anomaly scenario.

[0010] Optionally, generating updated test cases for the second electromagnetic safety anomaly scenario based on the test information corresponding to the second electromagnetic safety anomaly scenario and the historical test cases under the second electromagnetic safety anomaly scenario includes: generating initial test cases for the second electromagnetic safety anomaly scenario based on the test information corresponding to the second electromagnetic safety anomaly scenario using a pre-trained generative model; determining the test case similarity between the historical test cases under the second electromagnetic safety anomaly scenario and the initial test cases under the second electromagnetic safety anomaly scenario; correcting the test information corresponding to the second electromagnetic safety anomaly scenario based on the test case similarity to obtain corrected test information corresponding to the second electromagnetic safety anomaly scenario; and generating updated test cases for the second electromagnetic safety anomaly scenario based on the corrected test information corresponding to the second electromagnetic safety anomaly scenario using a pre-trained generative model.

[0011] Optionally, the step of correcting the test information corresponding to the second electromagnetic safety anomaly scenario based on the test case similarity to obtain the corrected test information corresponding to the second electromagnetic safety anomaly scenario includes: determining the type of test information that needs to be corrected in the test information corresponding to the second electromagnetic safety anomaly scenario based on the test case similarity; and re-parseing the electromagnetic safety standard document using a pre-trained natural language processing model based on the type of test information that needs to be corrected and the second electromagnetic safety anomaly scenario to obtain the corrected test information corresponding to the second electromagnetic safety anomaly scenario.

[0012] Optionally, the intelligent generation method for electromagnetic safety test cases further includes: acquiring a pre-trained first natural language processing model, which is used to parse test cases to obtain electromagnetic safety anomaly scenarios corresponding to the test cases; acquiring a pre-trained second natural language processing model, which is used to parse electromagnetic safety standard documents based on electromagnetic safety anomaly scenarios to obtain electromagnetic safety anomaly scenarios corresponding to the electromagnetic safety anomaly scenarios; and mounting the pre-trained first natural language processing model and the pre-trained second natural language processing model on different GPUs, wherein the performance of different GPUs matches the data processing volume of the corresponding natural language processing model.

[0013] Optionally, the intelligent generation method for electromagnetic safety test cases further includes: acquiring training data, the training data including: multiple training samples and real labels corresponding to the multiple training samples respectively, each training sample including: test information samples, wherein the multiple training samples include training samples corresponding to different electromagnetic safety anomaly scenarios; generating test case samples corresponding to the multiple training samples respectively based on the multiple training samples using the generation model to be trained; determining a first loss based on the deviation between the test case samples corresponding to the multiple training samples and the real labels; determining a second loss based on the deviation between the test case samples corresponding to the target training sample, wherein the electromagnetic safety anomaly scenarios corresponding to the target training sample are correlated; and training the generation model to be trained based on the first loss and the second loss to obtain the pre-trained generation model.

[0014] Secondly, this disclosure provides an intelligent generation platform for electromagnetic safety test cases, including:

[0015] The parsing module is used to parse historical test cases using a pre-trained natural language processing model to obtain the electromagnetic safety anomaly scenarios corresponding to the historical test cases; the determination module is used to determine the first electromagnetic safety anomaly scenario for which test cases need to be generated when the electromagnetic safety anomaly scenarios corresponding to the historical test cases cannot meet the requirements; the parsing module is also used to parse electromagnetic safety standard documents based on the first electromagnetic safety anomaly scenario using the pre-trained natural language processing model to obtain the test information corresponding to the first electromagnetic safety anomaly scenario; the generation module is used to generate test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario.

[0016] The above technical solution analyzes historical test cases using a natural language processing model to identify corresponding electromagnetic safety anomaly scenarios. When these scenarios fail to meet the power plant safety requirements, a first electromagnetic safety anomaly scenario requiring test case generation is determined. The natural language processing model then parses the corresponding test information from electromagnetic safety standard documents, generating test cases for this scenario. This technical solution associates test cases with electromagnetic safety anomaly scenarios, ensuring the generated test cases characterize specific scenarios. Furthermore, by combining existing historical test cases, the specific electromagnetic safety anomaly scenarios requiring test case generation are identified, ensuring the generated test cases correspond to actual test case requirements. Consequently, the generated test cases demonstrate good practical application effectiveness. Therefore, this technical solution enables intelligent generation of electromagnetic safety test cases and improves their practical application.

[0017] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0018] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the following detailed description to explain the present disclosure, but do not constitute a limitation thereof. In the drawings:

[0019] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment.

[0020] Figure 2 This is a flowchart illustrating an intelligent generation method for electromagnetic safety test cases according to an exemplary embodiment.

[0021] Figure 3 This is a schematic diagram of a data processing architecture according to an exemplary embodiment.

[0022] Figure 4 This is a block diagram illustrating an intelligent generation platform for electromagnetic safety test cases according to an exemplary embodiment.

[0023] Figure 5 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation

[0024] The specific embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit this disclosure.

[0025] As mentioned in the background section, in the field of electromagnetic safety, test cases can be generated using artificial intelligence. However, current generation methods do not effectively associate test cases with abnormal scenarios and do not consider the biases inherent in AI-generated test cases, resulting in poor practical application effects.

[0026] Based on this, the present disclosure provides a technical solution that analyzes historical test cases using a natural language processing model to obtain corresponding electromagnetic safety anomaly scenarios. In cases where the electromagnetic safety anomaly scenario cannot meet the requirements of power plant safety anomaly scenarios, a first electromagnetic safety anomaly scenario for which test cases need to be generated is determined. Then, the natural language processing model is used to parse the test information corresponding to the first electromagnetic safety anomaly scenario from the electromagnetic safety standard document, and the test information is used to generate test cases under the first electromagnetic safety anomaly scenario.

[0027] This technical solution associates test cases with electromagnetic safety anomaly scenarios, enabling the generated test cases to characterize specific electromagnetic safety anomaly scenarios. Furthermore, by combining existing historical test cases, the specific electromagnetic safety anomaly scenarios requiring test case generation are determined, ensuring that the generated test cases correspond to actual test case requirements. Consequently, the generated test cases demonstrate good practical application effectiveness. Therefore, this technical solution can achieve intelligent generation of electromagnetic safety test cases and improve their practical application effectiveness.

[0028] Figure 1 This is a schematic diagram illustrating an application scenario according to an exemplary embodiment, such as... Figure 1 As shown, this application scenario involves an intelligent generation terminal for electromagnetic safety test cases, an application terminal for electromagnetic safety test cases, and a data platform.

[0029] Among them, any two of the three components—the intelligent generation terminal for electromagnetic safety test cases, the application terminal for electromagnetic safety test cases, and the data platform—can communicate with each other via the Internet.

[0030] In some embodiments, the data platform is used to provide a data foundation for the intelligent generation terminal of electromagnetic safety test cases, and can also be used to store the test cases generated by the intelligent generation terminal of electromagnetic safety test cases.

[0031] In some embodiments, the intelligent generation terminal for electromagnetic safety test cases is used to generate electromagnetic safety test cases. The generated electromagnetic safety test cases can be provided to the data platform for storage or for application.

[0032] In some embodiments, the electromagnetic safety test case application end can obtain electromagnetic safety test cases from the electromagnetic safety test case intelligent generation end and / or data platform as needed, and then apply the electromagnetic safety test cases, such as performing electromagnetic safety tests.

[0033] Figure 2 This is a flowchart illustrating an intelligent generation method for electromagnetic safety test cases according to an exemplary embodiment. This method can be applied to... Figure 1 The intelligent generation terminal for electromagnetic safety test cases in the method includes the following steps:

[0034] Step S21: The historical test cases are parsed using a pre-trained natural language processing model to obtain the electromagnetic safety anomaly scenarios corresponding to the historical test cases.

[0035] Step S22: In cases where the electromagnetic safety anomaly scenarios corresponding to historical test cases cannot meet the requirements, determine the first electromagnetic safety anomaly scenario for which test cases need to be generated.

[0036] Step S23: Using a pre-trained natural language processing model, the electromagnetic safety standard document is parsed according to the first electromagnetic safety anomaly scenario to obtain the test information corresponding to the first electromagnetic safety anomaly scenario.

[0037] Step S24: Generate test cases for the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario.

[0038] In this embodiment of the disclosure, electromagnetic safety test cases are not generated directly and proactively. Instead, a requirement judgment is performed first, and based on the result of the requirement judgment, specific electromagnetic safety anomaly scenarios for which test cases need to be generated are identified.

[0039] Electromagnetic safety testing is a series of standardized methods used to verify the compatibility and anti-interference capabilities of equipment or systems in an electromagnetic environment, ensuring that they function normally without interfering with other equipment.

[0040] The electromagnetic safety anomaly scenarios in the embodiments of this disclosure can correspond to different electromagnetic safety anomaly types. The following are some example electromagnetic safety anomaly scenarios:

[0041] Conducted interference testing aims to test electromagnetic noise emitted outward through power lines or signal lines.

[0042] The purpose of radiation interference testing is to test whether electromagnetic waves radiated through space exceed the limits.

[0043] Conducted immunity testing aims to test the ability to resist interference signals injected through wires.

[0044] The purpose of radiation immunity testing is to test the ability to resist interference from electromagnetic fields in space.

[0045] The purpose of electrostatic discharge immunity testing is to simulate the effects of electrostatic discharge on the human body or objects.

[0046] The purpose of the fast transient burst test is to test the tolerance to transient pulse interference on power lines or signal lines.

[0047] It can be seen that different electromagnetic safety anomaly scenarios correspond to different testing objectives.

[0048] In step S21, historical test cases can be test cases that have already been used. These test cases can be manually written test cases or intelligently generated test cases, and they have been verified as usable test cases.

[0049] Therefore, by using a pre-trained natural language processing model, it is possible to analyze electromagnetic safety anomaly scenarios corresponding to historical test cases.

[0050] In step S22, the required electromagnetic safety anomaly scenario can be a pre-configured power plant safety anomaly scenario that needs to be tested.

[0051] In some embodiments, the electromagnetic safety anomaly scenarios that cannot meet the requirements of the historical test cases can be: the required electromagnetic safety anomaly scenarios, including electromagnetic safety anomaly scenarios that do not exist in the electromagnetic safety anomaly scenarios corresponding to the historical test cases.

[0052] That is, the first electromagnetic safety anomaly scenario can be an electromagnetic safety anomaly scenario for which there is no corresponding historical test case.

[0053] In step S23, the electromagnetic safety standard document is parsed using a pre-trained natural language processing model based on the first electromagnetic safety anomaly scenario to obtain the test information corresponding to the first electromagnetic safety anomaly scenario.

[0054] In some embodiments, an electromagnetic safety standard document may be a testing standard set in the electromagnetic field, which records test information for various electromagnetic safety anomaly scenarios, including: test parameters, limit conditions, test environment requirements, test steps, test procedures, etc.

[0055] Because natural language processing models have strong language analysis capabilities, they can obtain relevant test information from electromagnetic safety standard documents based on specific electromagnetic safety anomaly scenarios.

[0056] In some embodiments, the natural language processing model may be a model type such as BERT (Bidirectional Encoder Representations from Transformers, a pre-trained language model based on the Transformer architecture) or GPT (Generative Pretrained Transformer), and is not limited here.

[0057] The specific details regarding natural language processing models are mature technologies in this field and will not be discussed in detail here.

[0058] As can be seen, in this embodiment of the disclosure, the natural language processing model has two parsing capabilities: one is to parse the electromagnetic safety anomaly scenario corresponding to the test case, and the other is to parse the test information in the electromagnetic safety standard document. In order to achieve the stability of these two functions, the natural language processing model can be deployed in advance.

[0059] Therefore, as an optional implementation, the deployment of the natural language processing model includes: acquiring a pre-trained first natural language processing model, which is used to parse test cases to obtain electromagnetic safety anomaly scenarios corresponding to the test cases; acquiring a pre-trained second natural language processing model, which is used to parse electromagnetic safety standard documents based on electromagnetic safety anomaly scenarios to obtain electromagnetic safety anomaly scenarios corresponding to the electromagnetic safety anomaly scenarios; and mounting the pre-trained first natural language processing model and the pre-trained second natural language processing model on different GPUs (Graphics Processing Units), wherein the performance of different GPUs matches the data processing volume of the corresponding natural language processing model.

[0060] In this implementation, natural language processing models with different functions are mounted on different hardware platforms.

[0061] In some embodiments, the larger the amount of data processed by the natural language processing model, the better the performance of its corresponding GPU.

[0062] Figure 3 This is a schematic diagram of a data processing architecture according to an exemplary embodiment, such as... Figure 3 As shown, this data processing architecture includes: CPU (Central Processing Unit), GPU1, and GPU2.

[0063] GPU2 outperforms GPU1. A first natural language processing model for parsing test cases is deployed on GPU1, while a second natural language processing model for parsing electromagnetic safety standard documents based on electromagnetic safety anomaly scenarios is deployed on GPU2.

[0064] The CPU categorizes the acquired data and distributes it to GPU1 or GPU2 for processing. After GPU1 or GPU2 has finished processing, it feeds back the processing results to the CPU.

[0065] In step S24, test cases under the first electromagnetic safety anomaly scenario are generated based on the test information corresponding to the first electromagnetic safety anomaly scenario.

[0066] As an optional implementation, step S24 includes: generating initial test cases under the first electromagnetic safety anomaly scenario using a pre-trained generative model based on the test information corresponding to the first electromagnetic safety anomaly scenario; parsing the initial test cases under the first electromagnetic safety anomaly scenario using a pre-trained natural language processing model to obtain parsed information; and correcting the initial test cases under the first electromagnetic safety anomaly scenario based on the parsed information, the first electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario.

[0067] In some embodiments, the pre-trained generative model may be a diffusion model, a variational autoencoder, or the like.

[0068] In some embodiments, the training process of the pre-trained generative model may include: acquiring training data, the training data including: multiple training samples and real labels corresponding to the multiple training samples respectively, each training sample including: test information samples, wherein the multiple training samples include training samples corresponding to different electromagnetic safety anomaly scenarios; generating test case samples corresponding to the multiple training samples based on the multiple training samples using the generative model to be trained; determining a first loss based on the deviation between the test case samples corresponding to the multiple training samples and the real labels; determining a second loss based on the deviation between the test case samples corresponding to the target training sample, wherein the electromagnetic safety anomaly scenarios corresponding to the target training sample are correlated; and training the generative model to be trained based on the first loss and the second loss to obtain the pre-trained generative model.

[0069] In some embodiments, the first loss can characterize the deviation between the test case samples and the real labels corresponding to multiple training samples, that is, the deviation between the model output and the real labels, which can be implemented by cross-entropy loss, contrastive loss, etc.

[0070] In some embodiments, the second loss can characterize the deviation between specified test case samples, i.e. the deviation between test case samples under correlated electromagnetic safety anomaly scenarios, which can be implemented using a synchronous loss.

[0071] Regarding the correlation between abnormal electromagnetic safety scenarios, for example, conducted interference testing and conducted immunity testing are related.

[0072] In some embodiments, the first loss and the second loss can be weighted and summed to obtain the final loss, which can then be used to train the generative model to be trained, resulting in a pre-trained generative model. It is understood that the implementation methods for using model loss to train the model can be found in mature technologies in the art, and will not be described in detail here.

[0073] In some embodiments, the real labels corresponding to multiple training samples can be the actual test cases corresponding to the test information samples.

[0074] In some embodiments, the actual application effect of the initial test cases generated by the pre-trained generative model under the first electromagnetic safety anomaly scenario is difficult to predict, while the function of the pre-trained natural language processing model is reliable and stable. Therefore, the analytical capabilities of the pre-trained natural language processing model can be used to correct the test cases.

[0075] In some embodiments, the parsed information may include: reference electromagnetic safety anomaly scenarios and reference test information.

[0076] It is understandable that test cases are composed of test information. Decomposing test cases into test information and electromagnetic safety anomaly scenarios is relatively easy to implement using natural language processing models.

[0077] In some embodiments, the initial test cases under the first electromagnetic safety anomaly scenario are corrected based on the parsed information, the first electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario. This includes: comparing a reference electromagnetic safety anomaly scenario with the first electromagnetic safety anomaly scenario; if the reference electromagnetic safety anomaly scenario and the first electromagnetic safety anomaly scenario are the same, comparing the reference test information with the test information corresponding to the first electromagnetic safety anomaly scenario; if the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario match, performing rule correction on the initial test cases under the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario; if the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario do not match, correcting the initial test cases under the first electromagnetic safety anomaly scenario based on the difference information between the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario to obtain corrected test cases under the first electromagnetic safety anomaly scenario.

[0078] In some embodiments, the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario are matched, which may be that the test information corresponding to the first electromagnetic safety anomaly scenario covers (includes) all the information in the reference test information.

[0079] In some embodiments, rule correction of the initial test cases under the first electromagnetic safety anomaly scenario may include: obtaining pre-configured correction rules; and correcting the initial test cases under the first electromagnetic safety anomaly scenario according to the correction rules.

[0080] In some embodiments, the calibration rules may be: calibrating for limits to ensure that the limits are within a specified range; calibrating for test requirements to ensure the feasibility of the test requirements; and calibrating for the test environment to determine the feasibility of the test environment.

[0081] In some embodiments, the pre-configured calibration rules may be in the form of a calibration rule base, which includes normative requirements for a large amount of test information.

[0082] In some embodiments, the mismatch between the reference test information and the test information corresponding to the first electromagnetic safety anomaly scenario may be due to the test information corresponding to the first electromagnetic safety anomaly scenario including information that is not present in the reference test information.

[0083] In this case, it is necessary to correct the initial test cases under the first electromagnetic safety anomaly scenario based on the difference information.

[0084] As an example, in the initial test cases under the first electromagnetic safety anomaly scenario, difference information is added, where the specific test information corresponding to the difference information can be based on the pre-configured correction rules.

[0085] This method can avoid missing test information and effectively correct test cases.

[0086] In some embodiments, the intelligent generation method for electromagnetic safety test cases further includes: when the reference electromagnetic safety anomaly scenario is different from the first electromagnetic safety anomaly scenario, generating optimized training data based at least on reference test information, the reference electromagnetic safety anomaly scenario, and the test information corresponding to the first electromagnetic safety anomaly scenario; optimizing and training the pre-trained generative model based on the optimized training data to obtain an optimized generative model; and generating corrected test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario using the optimized generative model.

[0087] In this implementation, since the reference electromagnetic safety anomaly scenario differs from the first electromagnetic safety anomaly scenario, the accuracy of the generated model is difficult to guarantee. Therefore, in this case, it is necessary to first optimize and train the pre-trained generated model.

[0088] In some embodiments, reference test information and reference electromagnetic safety anomaly scenarios are used as new training samples, and corresponding real labels are configured for them for optimized training. Furthermore, the deviation between the test information corresponding to the first electromagnetic safety anomaly scenario and the reference test information is used as a model loss for optimized model training.

[0089] Furthermore, after obtaining the optimized generative model, the test information corresponding to the first electromagnetic safety anomaly scenario can be used to generate corrected test cases under the first electromagnetic safety anomaly scenario.

[0090] It is understandable that in the process of generating corrected test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario using the optimized generation model, the aforementioned implementation method is also required to determine whether the test cases need to be corrected. If they need to be corrected, they are corrected, and the specific correction method is the same as the aforementioned embodiment, thereby ensuring that the final generated test cases have practical applicability.

[0091] In some embodiments, the intelligent generation method for electromagnetic safety test cases further includes: determining a second electromagnetic safety anomaly scenario where the electromagnetic safety anomaly scenario corresponding to the historical test cases can meet the requirements; parsing the electromagnetic safety standard document according to the second electromagnetic safety anomaly scenario using a pre-trained natural language processing model to obtain the test information corresponding to the second electromagnetic safety anomaly scenario; determining the historical test cases under the second electromagnetic safety anomaly scenario from the historical test cases; and generating updated test cases under the second electromagnetic safety anomaly scenario based on the test information corresponding to the second electromagnetic safety anomaly scenario and the historical test cases under the second electromagnetic safety anomaly scenario.

[0092] In this implementation, since the electromagnetic safety anomaly scenarios corresponding to the historical test cases can meet the required electromagnetic safety anomaly scenarios, there is no need to add new electromagnetic safety anomaly scenarios, but the existing test cases can be adjusted.

[0093] In some embodiments, the second electromagnetic safety anomaly scenario that needs to be adjusted in the test cases may be an electromagnetic safety anomaly scenario that occurs less frequently in historical test cases, or an electromagnetic safety anomaly scenario whose corresponding test results do not meet the relevant requirements.

[0094] In some embodiments, generating updated test cases for a second electromagnetic safety anomaly scenario based on test information corresponding to the second electromagnetic safety anomaly scenario and historical test cases under the second electromagnetic safety anomaly scenario includes: generating initial test cases for the second electromagnetic safety anomaly scenario using a pre-trained generative model based on the test information corresponding to the second electromagnetic safety anomaly scenario; determining the test case similarity between historical test cases under the second electromagnetic safety anomaly scenario and the initial test cases under the second electromagnetic safety anomaly scenario; correcting the test information corresponding to the second electromagnetic safety anomaly scenario based on the test case similarity to obtain corrected test information corresponding to the second electromagnetic safety anomaly scenario; and generating updated test cases for the second electromagnetic safety anomaly scenario using a pre-trained generative model based on the corrected test information corresponding to the second electromagnetic safety anomaly scenario.

[0095] In some embodiments, determining the similarity of test cases may include: first determining the similarity between various test information in the test cases, and then integrating the similarity between different test information to obtain the overall similarity.

[0096] In some embodiments, the test information corresponding to the second electromagnetic safety anomaly scenario is corrected based on the test case similarity to obtain the corrected test information corresponding to the second electromagnetic safety anomaly scenario. This includes: determining the type of test information that needs to be corrected in the test information corresponding to the second electromagnetic safety anomaly scenario based on the test case similarity; and re-parseing the electromagnetic safety standard document using a pre-trained natural language processing model, based on the type of test information to be corrected and the second electromagnetic safety anomaly scenario, to obtain the corrected test information corresponding to the second electromagnetic safety anomaly scenario.

[0097] In some embodiments, the higher the similarity of test cases, the higher the information complexity and richness of the test information types that need to be corrected. That is, when the similarity is high, it is necessary to adjust the test information types that have adjustment value.

[0098] As an example, if the similarity of test cases is higher than 90%, the test steps can be adjusted for this type of test information.

[0099] As an example, if the similarity of test cases is less than 50%, the test environment can be adjusted to reflect this type of test information.

[0100] In different application scenarios, different test case similarity levels can be pre-configured to determine the types of test information that need to be adjusted, and then adjustments can be made according to the test information types.

[0101] Furthermore, by correcting the test information, the test cases can be updated.

[0102] Figure 4 This is a block diagram illustrating an intelligent electromagnetic safety test case generation platform 400 according to an exemplary embodiment, such as... Figure 4 As shown, the platform includes:

[0103] The parsing module 401 is used to parse historical test cases using a pre-trained natural language processing model to obtain the electromagnetic safety anomaly scenarios corresponding to the historical test cases.

[0104] The determination module 402 is used to determine the first electromagnetic safety anomaly scenario for which test cases need to be generated when the electromagnetic safety anomaly scenario corresponding to the historical test cases cannot meet the requirements.

[0105] The parsing module 401 is further configured to use the pre-trained natural language processing model to parse the electromagnetic safety standard document according to the first electromagnetic safety anomaly scenario, and obtain the test information corresponding to the first electromagnetic safety anomaly scenario.

[0106] The generation module 403 is used to generate test cases under the first electromagnetic safety anomaly scenario based on the test information corresponding to the first electromagnetic safety anomaly scenario.

[0107] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0108] Figure 5 This is a block diagram illustrating an electronic device 500 according to an exemplary embodiment. For example... Figure 5 As shown, the electronic device 500 may include a processor 501 and a memory 502. The electronic device 500 may also include one or more of a multimedia component 503, an input / output (I / O) interface 504, and a communication component 505.

[0109] The processor 501 controls the overall operation of the electronic device 500 to complete all or part of the steps in the aforementioned intelligent generation method for electromagnetic safety test cases. The memory 502 stores various types of data to support the operation of the electronic device 500. This data may include, for example, instructions for any application or method operating on the electronic device 500, and application-related data such as contact data, sent and received messages, pictures, audio, video, etc. The memory 502 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, disk, or optical disk. The multimedia component 503 may include a screen and audio components. The screen may be, for example, a touchscreen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in memory 502 or transmitted via communication component 505. The audio component also includes at least one speaker for outputting audio signals. I / O interface 504 provides an interface between processor 501 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual or physical buttons. Communication component 505 is used for wired or wireless communication between the electronic device 500 and other devices. Wireless communication may include Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof; therefore, the corresponding communication component 505 may include a Wi-Fi module, a Bluetooth module, or an NFC module.

[0110] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the above-described intelligent generation method for electromagnetic safety test cases.

[0111] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, which, when executed by a processor, implement the steps of the above-described intelligent generation method for electromagnetic safety test cases. For example, the computer-readable storage medium may be the memory 502 including the program instructions, which may be executed by the processor 501 of the electronic device 500 to complete the above-described intelligent generation method for electromagnetic safety test cases.

[0112] In another exemplary embodiment, a computer program product is also provided, which includes a computer program executable by a processor, which, when executed by the processor, implements the steps of the above-described intelligent generation method for electromagnetic safety test cases.

[0113] The preferred embodiments of this disclosure have been described in detail above with reference to the accompanying drawings. However, this disclosure is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this disclosure, various simple modifications can be made to the technical solutions of this disclosure, and these simple modifications all fall within the protection scope of this disclosure.

[0114] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this disclosure will not describe the various possible combinations separately.

[0115] Furthermore, various different embodiments of this disclosure can be combined in any way, as long as they do not violate the spirit of this disclosure, they should also be regarded as the content disclosed in this disclosure.

Claims

1. An electromagnetic safety test case intelligent generation method, characterized in that, The method comprises the following steps: parsing the historical test cases by a pre-trained natural language processing model to obtain electromagnetic safety abnormal scene corresponding to the historical test cases; in the case that the electromagnetic safety abnormal scene corresponding to the historical test cases cannot meet the demand of electromagnetic safety abnormal scene, determining a first electromagnetic safety abnormal scene that needs to generate a test case; parsing the electromagnetic safety standard document according to the first electromagnetic safety abnormal scene by the pre-trained natural language processing model to obtain test information corresponding to the first electromagnetic safety abnormal scene; generating a test case under the first electromagnetic safety abnormal scene according to the test information corresponding to the first electromagnetic safety abnormal scene, which comprises: generating an initial test case under the first electromagnetic safety abnormal scene according to the test information corresponding to the first electromagnetic safety abnormal scene by a pre-trained generation model; parsing the initial test case under the first electromagnetic safety abnormal scene by the pre-trained natural language processing model to obtain parsing information; correcting the initial test case under the first electromagnetic safety abnormal scene according to the parsing information, the first electromagnetic safety abnormal scene and the test information corresponding to the first electromagnetic safety abnormal scene to obtain a corrected test case under the first electromagnetic safety abnormal scene.

2. The method of claim 1, wherein, The parsing information comprises a reference electromagnetic safety abnormal scene and reference test information, and the correcting the initial test case under the first electromagnetic safety abnormal scene according to the parsing information, the first electromagnetic safety abnormal scene and the test information corresponding to the first electromagnetic safety abnormal scene to obtain a corrected test case under the first electromagnetic safety abnormal scene comprises: comparing the reference electromagnetic safety abnormal scene with the first electromagnetic safety abnormal scene; in the case that the reference electromagnetic safety abnormal scene is the same as the first electromagnetic safety abnormal scene, comparing the reference test information with the test information corresponding to the first electromagnetic safety abnormal scene; in the case that the reference test information matches the test information corresponding to the first electromagnetic safety abnormal scene, performing rule correction on the initial test case under the first electromagnetic safety abnormal scene to obtain a corrected test case under the first electromagnetic safety abnormal scene; in the case that the reference test information does not match the test information corresponding to the first electromagnetic safety abnormal scene, correcting the initial test case under the first electromagnetic safety abnormal scene according to the difference information between the reference test information and the test information corresponding to the first electromagnetic safety abnormal scene to obtain a corrected test case under the first electromagnetic safety abnormal scene.

3. The method of claim 2, wherein, The method further comprises: in the case that the reference electromagnetic safety abnormal scene is not the same as the first electromagnetic safety abnormal scene, generating optimization training data according to at least the reference test information, the reference electromagnetic safety abnormal scene and the test information corresponding to the first electromagnetic safety abnormal scene. According to the optimization training data, the pre-trained generation model is subjected to optimization training to obtain an optimized generation model; According to the test information corresponding to the first electromagnetic safety abnormal scene, the optimized generation model generates a corrected test case under the first electromagnetic safety abnormal scene.

4. The method of claim 1, wherein, The electromagnetic safety test case intelligent generation method further includes: In the case that the electromagnetic safety abnormal scene corresponding to the historical test case can meet the demand of the electromagnetic safety abnormal scene, a second electromagnetic safety abnormal scene requiring adjustment of the test case is determined; According to the second electromagnetic safety abnormal scene, the pre-trained natural language processing model analyzes the electromagnetic safety standard document to obtain test information corresponding to the second electromagnetic safety abnormal scene; From the historical test cases, a historical test case under the second electromagnetic safety abnormal scene is determined; According to the test information corresponding to the second electromagnetic safety abnormal scene and the historical test case under the second electromagnetic safety abnormal scene, an updated test case under the second electromagnetic safety abnormal scene is generated.

5. The method of claim 4, wherein, The generation of the updated test case under the second electromagnetic safety abnormal scene according to the test information corresponding to the second electromagnetic safety abnormal scene and the historical test case under the second electromagnetic safety abnormal scene includes: According to the test information corresponding to the second electromagnetic safety abnormal scene, a pre-trained generation model generates an initial test case under the second electromagnetic safety abnormal scene; Determination of a test case similarity between the historical test case under the second electromagnetic safety abnormal scene and the initial test case under the second electromagnetic safety abnormal scene; According to the test case similarity, the test information corresponding to the second electromagnetic safety abnormal scene is corrected to obtain corrected test information corresponding to the second electromagnetic safety abnormal scene; According to the corrected test information corresponding to the second electromagnetic safety abnormal scene, a pre-trained generation model generates an updated test case under the second electromagnetic safety abnormal scene.

6. The method of claim 5, wherein, The correction of the test information corresponding to the second electromagnetic safety abnormal scene according to the test case similarity to obtain the corrected test information corresponding to the second electromagnetic safety abnormal scene includes: According to the test case similarity, a test information type requiring correction in the test information corresponding to the second electromagnetic safety abnormal scene is determined; According to the test information type requiring correction and the second electromagnetic safety abnormal scene, a pre-trained natural language processing model reanalyzes the electromagnetic safety standard document to obtain the corrected test information corresponding to the second electromagnetic safety abnormal scene.

7. The method of claim 1-6, wherein, The electromagnetic safety test case intelligent generation method further includes: A pre-trained first natural language processing model is obtained, and the pre-trained first natural language processing model is used to analyze a test case to obtain an electromagnetic safety abnormal scene corresponding to the test case; obtaining a pre-trained second natural language processing model, the pre-trained second natural language processing model being used to parse an electromagnetic safety standard document according to an electromagnetic safety abnormal scene to obtain an electromagnetic safety abnormal scene corresponding to the electromagnetic safety abnormal scene; the pre-trained first natural language processing model and the pre-trained second natural language processing model are respectively carried in different GPUs, wherein the performance of different GPUs matches the data processing amount of the corresponding natural language processing model.

8. The method of claim 2-6, wherein, The electromagnetic safety test case intelligent generation method further comprises: obtaining training data, the training data comprising: a plurality of training samples and real labels corresponding to the plurality of training samples, each training sample comprising: a test information sample, wherein the plurality of training samples include training samples corresponding to different electromagnetic safety abnormal scenes; generating test case samples corresponding to the plurality of training samples by a to-be-trained generation model according to the plurality of training samples; determining a first loss according to the deviation between the test case samples corresponding to the plurality of training samples and the real labels; determining a second loss according to the deviation between the test case samples corresponding to the target training sample, wherein the electromagnetic safety abnormal scene corresponding to the target training sample has relevance; training the to-be-trained generation model according to the first loss and the second loss to obtain the pre-trained generation model.

9. An electromagnetic safety test case intelligent generation platform, characterized in that, comprises: The analysis module is configured to parse historical test cases by a pre-trained natural language processing model to obtain electromagnetic safety abnormal scenes corresponding to the historical test cases. The determination module is configured to determine a first electromagnetic safety abnormal scene for which a test case needs to be generated in a case where the electromagnetic safety abnormal scenes corresponding to the historical test cases cannot meet the demand. The analysis module is further configured to parse an electromagnetic safety standard document according to the first electromagnetic safety abnormal scene by the pre-trained natural language processing model to obtain test information corresponding to the first electromagnetic safety abnormal scene. The generation module is configured to generate a test case under the first electromagnetic safety abnormal scene according to the test information corresponding to the first electromagnetic safety abnormal scene, and is configured to: generate an initial test case under the first electromagnetic safety abnormal scene by a pre-trained generation model according to the test information corresponding to the first electromagnetic safety abnormal scene; parse the initial test case under the first electromagnetic safety abnormal scene by the pre-trained natural language processing model to obtain parsing information; correct the initial test case under the first electromagnetic safety abnormal scene according to the parsing information, the first electromagnetic safety abnormal scene, and the test information corresponding to the first electromagnetic safety abnormal scene to obtain a corrected test case under the first electromagnetic safety abnormal scene.

Citation Information

Patent Citations

  • Electromagnetic environment hybrid automatic test method and system, storage medium and terminal equipment

    CN112988590A

  • Abnormal test case generation method and device, electronic equipment and storage medium

    CN115129595A