Automatic use case generation method and system based on protection device training

By the generation of automated use cases of protecting device training, use machine learning to analyze data synchronization, extreme environment and user behavior abnormal data to generate abnormal coefficients to determine the production of use cases. Test efficiency and exception detection accuracy.

CN119377122AInactive Publication Date: 2025-01-28ANHUI JIYUAN SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411612670.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-01-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the automated use case generation process of protection device training, abnormalities in the generation of automated use cases cannot be discovered in time due to incorrect user operating habits or emergencies.

Method used

By obtaining the protection device test case data, including data synchronization abnormal data, extreme environmental data, and user behavior abnormal data, based on machine learning to establish use cases to generate abnormal models, generate use cases to generate abnormal coefficients, judge the abnormal situation of automated use cases, and send reminders and reminders and issues deal with.

Benefits of technology

The test coverage is improved, the fault positioning speed is accelerated, the manual intervention is reduced, the accuracy and efficiency of abnormal detection are improved, thereby accelerating the software quality guarantee process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377122A_ABST
    Figure CN119377122A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic case generation method and system based on protection device training, and relates to the technical field of automatic case generation, and the method comprises the following steps: obtaining protection device test case data, the test case data comprising data synchronization abnormal data, extreme environment data and user behavior abnormal data; establishing a case generation exception model for the protection device test case data based on machine learning, and generating a case generation exception coefficient; according to the use case generation abnormal coefficient, the abnormal condition of automatic use case generation is judged based on the use case generation stable coefficient range, and the system gives out a prompt and carries out processing according to the abnormal condition. According to the method and the device, the problem that in the automatic use case generation process of protection device training, abnormal conditions possibly caused by misoperation or emergencies cannot be found in time is solved through automatic generation abnormity analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of optimal decision-making for power grid technical transformation projects, and more specifically, to the technical field of an automated use case generation method and system based on protection device training. Background Art

[0002] As the scale and complexity of software development increase, traditional manual testing methods become increasingly inefficient, error-prone, and unable to cope with frequent changes and iterations. To solve these problems, automated testing came into being. Automated testing can improve test coverage, shorten the test cycle, and can repeatedly execute the same test cases without manual intervention.

[0003] For example, the invention patent with announcement number: CN115629967A discloses a method and system for completing interface automation use case generation and execution based on traffic collection. The present invention provides a method and system for completing interface automation use case generation and execution based on traffic collection, including: step S1: deploying the jvm sandbox repeater tool at the front end of the application, and adding configuration information to the target interface; step S2: after the configuration is completed, monitoring and recording the traffic of the target business module to obtain interface request information; step S3: providing a download function for the recorded interface traffic information, and completing the traffic download of the target request interface through the configuration information; step S4: generating an interface test automation use case by parsing the basic information of the downloaded traffic; step S5: executing the interface test automation use case, recording the execution results, and making a differential comparison between the execution results and the expected results; step S6: displaying the interface automation use case execution report.

[0004] For example, the invention patent announcement with announcement number: CN115934564A discloses a method for generating automated use cases based on manual use cases. The present invention discloses a user interface automation use case generation method and related devices, including: obtaining the buried point data for the target application through the pre-built operation path buried point SDK; for any operation cycle after the first operation cycle of the user, generating the operation link corresponding to the operation cycle according to the buried point data corresponding to the operation cycle and the operation link corresponding to the previous operation cycle of the operation cycle, wherein one operation cycle corresponds to one operation link; counting the occurrence frequency corresponding to each operation link, and determining the operation link whose occurrence frequency is higher than the preset frequency threshold or whose occurrence frequency ranks in the top N; generating the corresponding user interface automation use case according to the buried point data corresponding to the determined operation link. The present invention can automatically generate user interface automation use cases without manual participation, and the cost is relatively low.

[0005] The above disclosed technical solutions have at least the following technical problems: In the process of automatic use case generation for protection device training, the user's incorrect operating habits or unexpected situations may cause the automatic use case generation to fail to detect abnormal situations in time. In view of the above problems, the present invention proposes a solution. Summary of the invention

[0006] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides an automated use case generation method and system based on protection device training, which generates exception analysis through automated use cases to solve the problem that abnormal situations in automated use case generation cannot be discovered in time due to incorrect user operating habits or emergencies.

[0007] To achieve the above object, the present invention provides the following technical solutions: The method and system for automatically generating use cases based on protection device training include the following steps: obtaining protection device test case data, wherein the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data; establishing a use case generation abnormality model based on the protection device test case data based on machine learning, and generating a use case generation abnormality coefficient; judging the abnormal situation of automatic use case generation based on the use case generation abnormality coefficient and the use case generation stability coefficient range, and issuing a reminder and taking action based on the abnormal situation.

[0008] In a preferred embodiment, the specific method for obtaining the data synchronization abnormal data is as follows: obtain the input data of the test scenario, the input data including the set current, voltage value, response time and trigger value of the relay; calculate the standard deviation of each data point based on the z-score method according to the input data of the test scenario, and draw an input data curve chart of the input data of the test scenario based on the standard deviation; obtain the stable data of the current, voltage, response time and trigger value of the relay of the pre-set protection device test case, and calculate the standard deviation of the stable data based on the z-score method, and obtain the test data stability curve chart based on the standard deviation of the stable data; compare the input curve chart with the test data stability curve chart to obtain the residual of each data point; combine the residual of each data point to obtain data synchronization abnormal data.

[0009] In a preferred embodiment, the extreme environment data is specifically acquired by the following method: real-time monitoring and acquisition of the temperature, humidity, electromagnetic noise data and load fluctuation data of the test environment; real-time tracking of the frequency parameters of the power grid based on SCADA technology, acquisition of multiple frequency change data of the entire power grid, and acquisition of the frequency fluctuation data of the entire power grid by averaging method based on multiple frequency change data; acquisition of the intensity of the electric field and magnetic field of the external electromagnetic signal interference source, and acquisition of the external electromagnetic interference data by calculation based on the electromagnetic noise data combined with the intensity of the electric field and magnetic field of the external electromagnetic signal interference source; and calculation based on the extreme environment formula to obtain the extreme environment data according to the temperature, humidity and load fluctuation data of the test environment and the power grid frequency fluctuation data.

[0010] In a preferred embodiment, the user behavior abnormal data is specifically obtained by the following method: obtaining the user's The number of quick clicks during the automated use case generation process within a time period; monitor and obtain traffic data during user file downloads and transmissions; collect abnormal operation text data during the user automated use case generation process, and pre-process the abnormal operation text data; perform word segmentation on the processed abnormal operation text data to obtain an abnormal operation keyword sequence; use word embedding technology to convert the abnormal operation keyword sequence into an abnormal operation keyword feature vector based on a semantic converter; The number of clicks and traffic data within a time period are combined with the abnormal operation keyword feature vector to obtain user behavior abnormality data based on a preset user behavior formula.

[0011] In a preferred embodiment, the protection device test case data is used to establish a use case generation anomaly model based on machine learning to generate a use case generation anomaly coefficient, and the specific steps are as follows: obtain historical protection device test case data, wherein the historical protection device test case data includes historical data synchronization anomaly data, historical extreme environment data, and historical user behavior anomaly data; perform data cleaning and feature extraction on the historical protection device test case data, and divide the extracted historical protection device test case data into a training set and a test set; use the training set as an input value for training based on a machine learning algorithm, and through automatic adjustment, assign parameter weights to the data synchronization anomaly data, extreme environment data, and user behavior anomaly data, respectively, and obtain a use case generation anomaly model; input the test set into the use case generation anomaly model for testing to obtain an optimized use case generation anomaly model; input the newly acquired data synchronization anomaly data, extreme environment data, and user behavior anomaly data into the optimized use case generation anomaly model to generate a use case generation anomaly coefficient.

[0012] In a preferred embodiment, the abnormal situation of automated use case generation is judged based on the use case generation abnormal coefficient and the use case generation stability coefficient range, and the system issues a reminder and takes action based on the abnormal situation. The specific steps are as follows: execute each test case multiple times, and record the stability coefficient each time the test case is automatically generated; obtain all stability coefficients, and obtain the mean and standard deviation of the stability coefficient by calculation; determine the use case generation stability coefficient range according to the mean and standard deviation of the stability coefficient, take the mean of the stability coefficient as the minimum parameter range, and take K times the standard deviation of the stability coefficient as the maximum parameter range; when the use case generation abnormal coefficient exceeds or is not within the use case generation stability coefficient range, it means that an abnormal situation has occurred in the automated use case generation of the protection device; when the use case generation abnormal coefficient is within the use case generation stability coefficient range, there is no abnormal situation in the automated use case generation of the protection device.

[0013] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By automating the use cases to generate exception analysis, we can improve test coverage, speed up fault location, reduce manual intervention, improve the accuracy and efficiency of exception detection, and thus accelerate the software quality assurance process.

[0014] 2. Through machine learning technology, an automated test case generation anomaly model is constructed, which can intelligently identify potential defects, optimize the test case generation process, improve the accuracy and efficiency of anomaly detection, reduce manual intervention and enhance the system's adaptive capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 A schematic diagram of the structure of an automated use case generation method based on protection device training provided in an embodiment of the present application.

[0016] Figure 2 A schematic diagram of the structure of an automated use case generation system based on protection device training provided in an embodiment of the present application. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] Embodiment 1, Figure 1 The schematic diagram of the structure of the method for generating an automated use case based on protection device training provided in the embodiment of the present application comprises the following steps: S1, obtaining protection device test case data, wherein the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data.

[0019] In this example, the protection device test case data refers to the abnormality of the generation caused by problems in the test case generation process, where the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data. Data synchronization abnormality data refers to the abnormality of the automated case generation caused by illegal or erroneous input data in the process of automated case generation.

[0020] Synchronizing exception data through analytical data has the following advantages for automated use case exception handling: Improve the accuracy of anomaly detection: By analyzing historical synchronization anomaly data, common anomaly patterns, trends, or data inconsistencies can be identified. For example, data synchronization errors are more frequent during certain time periods or under certain operations, or the cause of data synchronization failure can be attributed to certain system configurations, interface timeouts, network problems, etc. By identifying these patterns in advance, anomalies can be captured and located more accurately in automated testing. Automated testing may generate some false positive errors during execution, that is, test cases that appear to have failed are not actually true failures. By analyzing historical anomaly data, the test system can be helped to better distinguish between real failures and other irrelevant factors, thereby reducing false positives.

[0021] Optimize exception handling strategies: Through in-depth analysis of synchronization exception data, data support can be provided for the exception handling strategies of test cases. For example, based on the types and frequencies of past synchronization errors, a more targeted exception handling mechanism can be designed to reduce unnecessary manual intervention and improve processing efficiency. After analyzing synchronization exception data, decision support can be provided for automated testing tools, enabling them to automatically select appropriate exception handling strategies (such as retry, ignore, skip, or log) when faced with similar errors, thereby reducing manual intervention and improving test efficiency.

[0022] Improve the robustness of the system: In response to system changes, data synchronization anomalies are often related to factors such as the system environment, data format changes, and interface changes. By analyzing these abnormal data, the automated testing system can adapt to changes in the system environment more flexibly, foresee possible anomalies in advance, and make corresponding adjustments. In this way, when the system changes, the automated use cases can reflect them in a timely manner and take appropriate handling measures. Dynamically adjust test cases. Based on the analysis of synchronization exception data, the automated use cases can dynamically adjust the execution order or method of the test cases according to the specific circumstances of the data synchronization errors. For example, if synchronization problems occur frequently on a certain interface, the related tests of the interface can be automatically suspended, and other unaffected tests can be executed first. Improve troubleshooting efficiency: Locate the root cause. Analysis of data synchronization anomalies can help the development team quickly locate the root cause of the problem. For example, by analyzing the time point, data source, interface call, network status, etc. when the anomaly occurred, the automated testing tool can provide more accurate clues to the failure, helping the team to quickly identify and fix the problem. Log and report optimization. Abnormal data analysis can also improve the log and report format of automated testing, helping developers and testers to see the occurrence point and cause of the failure more clearly in the log, reducing the time cost of troubleshooting.

[0023] Improve test coverage and efficiency: Accurate anomaly reproduction, data synchronization anomaly data analysis can help the automated test system better reproduce historical anomalies, thereby increasing test coverage. For synchronization errors that have occurred frequently in the past, automated testing can prepare relevant test cases in advance for reproduction to avoid missing potential problems that may affect the system. Prevent problems in advance. By analyzing historical data synchronization anomalies, automated testing can predict and prevent possible synchronization problems before system deployment, helping the development team resolve potential synchronization failures before software delivery, and improving software quality and delivery efficiency.

[0024] Enhance the intelligence of automated testing: Through the analysis results of data synchronization exceptions, more intelligent functions can be provided for the test framework. For example, based on historical exception data and combined with machine learning algorithms, automated testing tools can adaptively optimize exception detection and processing strategies, continuously improve their ability to handle complex exceptions, and gradually reduce the need for manual intervention. Dynamic exception classification and response: Based on the results of abnormal data analysis, the automated testing framework can automatically classify and respond to different types of exceptions. For example, some exceptions may be temporary, and the test framework can automatically retry; while other types of exceptions require immediate testing stop or notification of developers for manual intervention.

[0025] The specific method for obtaining the data synchronization abnormality data is as follows: Acquire input data of the test scenario, wherein the input data includes set current, voltage value, response time, and trigger value of the relay; Calculate the standard deviation of each data point based on the z-score method according to the input data of the test scenario, and draw an input data curve graph of the input data of the test scenario based on the standard deviation; Obtain stable data of current, voltage, response time and trigger value of relay of pre-set protection device test case, calculate standard deviation of stable data based on z-score method, and obtain stable curve of test data based on standard deviation of stable data; Compare the input curve with the test data stability curve to obtain the residual of each data point; Combine the residuals of each data point to obtain data synchronization anomaly data.

[0026] The specific calculation method of the standard deviation of each data point is as follows:

[0027] The residual of each data point is combined to obtain data synchronization abnormal data. The specific calculation method is as follows:

[0028] In the formula, For data synchronization abnormal data, is the combination function, is the standard deviation of the ith data point. is the standard deviation of the stable data, is the data to be input, V is the voltage value, I is the current, t is the response time, G is the trigger value of the relay, N is the number of data points to be measured, i is the data point, where i=1,2,3,...,N, N is an integer.

[0029] It should be noted that the configuration parameters of different versions of protection devices may be different, resulting in inconsistency between the input data and the basic stable data set by the original device, which may lead to errors in acquisition, thereby affecting the correctness of the automated use case, causing the generated test case to fail to execute correctly or causing the device to behave as expected. Therefore, obtaining data anomaly data plays a significant role in analyzing the anomalies generated by automated use cases.

[0030] Extreme environmental data refers to the situation in which excessively high or low temperatures may cause the use case to generate erroneous protection actions or reactions under extreme environmental conditions, thus affecting the accuracy of the use case generation. Changes in humidity may cause electrical equipment to malfunction or short-circuit, and protection devices may malfunction in high-humidity environments, causing data deviations and affecting the generation of automated use cases. Strong external electromagnetic interference may affect the electronic components of the protection device, causing sensor data distortion or abnormal equipment operation, affecting the generation of automated use cases. Load fluctuations in the power system may cause delayed or inaccurate action of the protection device, affecting the generation of automated use cases.

[0031] Analyzing extreme environment data has the following advantages for automated use case exception handling: Predict and identify potential failures: Extreme environmental data (such as temperature, humidity, load fluctuations, etc.) can help predict possible failures of the system under extreme conditions. By monitoring and analyzing this data in real time, the system can identify abnormal conditions in advance, and automated use cases can automatically trigger corresponding protection mechanisms when extreme environmental changes occur to reduce the occurrence of failures. Enhance fault-tolerant design and analyze extreme environmental data to enable the system to design more fault-tolerant automated use cases. For example, by setting more reasonable protection thresholds or redundancy mechanisms, ensure that the system can still operate reliably and respond appropriately even in extreme situations.

[0032] Dynamically adjust protection strategies: Under extreme environmental conditions (such as sudden load changes, high temperatures, or lightning), the system may require a more sensitive or more conservative protection response. Analyzing extreme data helps to dynamically adjust the thresholds and logic strategies of protection devices under different environmental conditions to avoid false or delayed actions, thereby optimizing the accuracy of automated use case generation.

[0033] Adaptive protection action: The system can adjust the reaction time, trigger threshold and other parameters of the protection device according to the real-time environmental data to adapt it to environmental changes. For example, in extremely low temperature environments, the protection device may need to act more cautiously, while in overload or frequent fluctuations, the protection device may need to act more quickly.

[0034] Quickly locate the source of the problem: Analysis of extreme environmental data can help diagnose which environmental factors (such as excessively high or low voltage, temperature, humidity, etc.) may have caused abnormal operation of the protection device or system failure. This helps to quickly locate the source of the problem, reduce system fault repair time, and improve fault recovery speed. By analyzing extreme environmental data, it is possible to more accurately distinguish between real faults and abnormalities caused by environmental factors, thereby reducing false alarms and missed alarms, improving fault handling efficiency, and reducing unnecessary protection actions.

[0035] Intelligent learning and adaptation: Through machine learning or data-driven intelligent analysis, the system can optimize the generation logic of automated use cases based on historical extreme environmental data. For example, by analyzing past extreme weather data or load fluctuations, the system can learn how to respond best in similar environments.

[0036] Enhanced real-time decision-making capabilities: Automation systems can make intelligent decisions based on real-time extreme environment data, for example, automatically adjusting the action rules of protection devices under abnormal current or voltage conditions, rather than relying solely on preset fixed conditions.

[0037] Maintain stable operation under unstable conditions: Power systems or other industrial control systems often face complex external environments (such as climate change, load fluctuations, etc.). Through in-depth analysis of these extreme environmental data, the system's operational stability under unstable or extreme conditions can be enhanced. Automation use cases can avoid system failures in high-risk situations through real-time environmental perception.

[0038] Multi-level anomaly detection and response: Analyzing extreme environmental data helps establish a multi-level anomaly detection and response mechanism. When the system detects a drastic change in environmental factors, it can adjust the protection strategy in a hierarchical manner to ensure that the system can still operate reliably in extreme environments and avoid overall system failure.

[0039] The specific method for obtaining the extreme environment data is as follows: Real-time monitoring and acquisition of the temperature, humidity, electromagnetic noise data and load fluctuation data of the test environment; Based on SCADA technology, the frequency parameters of the power grid are tracked in real time to obtain multiple frequency change data of the entire power grid. Based on multiple frequency change data, the frequency fluctuation data of the entire power grid is obtained by averaging method; Obtaining the strength of the electric field and magnetic field of the external electromagnetic signal interference source, and obtaining the external electromagnetic interference data by calculation according to the electromagnetic noise data combined with the strength of the electric field and magnetic field of the external electromagnetic signal interference source; The extreme environment data is calculated based on the extreme environment formula according to the temperature, humidity, load fluctuation data and grid frequency fluctuation data of the test environment.

[0040] The specific calculation formula for the extreme environment data is as follows:

[0041] In the formula, Y is the extreme environment data, T is the temperature, is humidity, u is the grid frequency fluctuation data, is the damage factor, E is the external electromagnetic interference data, is the load fluctuation number.

[0042] Abnormal user behavior data refers to abnormalities in the generation of automatic use cases for protection devices due to incorrect operations by users during the generation of automatic use cases for protection devices. Analyzing abnormal user behavior data has the following advantages for handling abnormalities in automatic use cases: Improve test coverage: Fully capture real user scenarios. Abnormal user behavior data can reflect various situations that users may encounter during real use, including routine operations and extreme situations. By analyzing these behaviors, automated test cases can cover common, abnormal or marginal operations of users, thereby improving the comprehensiveness and coverage of tests. Mining potential abnormal paths. By analyzing the user's click flow, input mode and operation sequence, potential abnormal paths that automated test scripts fail to cover (such as users skipping steps, repeated clicks, etc.) can be discovered to ensure that test cases can cover all important scenarios.

[0043] Improve the accuracy of automated testing: Closer to actual user behavior, analyzing abnormal user behavior data helps identify which operations are more frequent in actual use and which behaviors may trigger abnormal states of the system. When generating automated test cases, if these real user behaviors can be fully considered, the actual usage environment can be simulated more accurately to avoid generating test cases that do not conform to reality. Reduce false positives and false negatives. By analyzing behavioral data, the system can distinguish between true abnormal situations and normal misoperations or boundary behaviors. This can help optimize anomaly detection rules, avoid unnecessary test cases and abnormal alarms, and thus improve the accuracy of automated testing.

[0044] Improve the intelligence and adaptability of test cases: Through continuous analysis of abnormal user behavior data, the test framework can continuously adjust and optimize automated test cases. For example, analyze user behavior patterns, access paths, and operation frequencies, and automatically generate or update test cases to adapt to changing needs and usage scenarios. This adaptive capability makes automated testing more flexible and intelligent, and can be dynamically adjusted as the system and user behavior change. After analyzing abnormal user behavior data, the automated testing framework can modify or expand the use case based on real-time user feedback and behavior changes. For example, if a certain operation often causes system crashes or performance degradation, the automation tool can automatically generate abnormal test cases for this operation and focus on it.

[0045] Improve the quality of user experience: Discover potential user experience problems. By analyzing abnormal user behavior data, the test framework can identify pain points or difficulties that users encounter during use, such as some operation paths being too complicated, some buttons or interface elements being difficult to find, and other issues. Automated test cases can be generated based on these feedbacks to help the development team discover and resolve these issues that affect user experience in advance. Simulate user operating habits. Different user groups have different operating habits and preferences in the product. Analyzing these habits can help automated testing tools generate test cases that better meet user needs, thereby improving system stability and user satisfaction.

[0046] Improve the efficiency of anomaly detection and error troubleshooting: Identify common abnormal behavior patterns: By analyzing a large amount of user behavior abnormality data, some common abnormal behavior patterns can be summarized (such as illegal input, repeated operations, browser compatibility issues, etc.). In the process of generating automated test cases, these abnormal patterns can be simulated and tested first, thereby improving the system's ability to deal with common anomalies. By analyzing user behavior, automated testing can help identify potential vulnerabilities or errors in the system earlier. For example, certain specific operations may cause the system to crash. Analyzing these behavioral data can help automated testing tools generate test cases for these operations, thereby discovering and fixing problems in advance.

[0047] Improve the fault tolerance and stability of the system: Strengthen the exception handling mechanism. The analysis of abnormal user behavior data can help the automated testing framework identify the weak links of the system, especially the handling capabilities under abnormal circumstances. For example, a specific operation may cause the system to crash under certain conditions. The automated testing system can generate use cases based on this behavior to enhance the system's fault tolerance in this scenario. Real-time feedback mechanism. By continuously analyzing abnormal user behavior data, automated testing can better simulate user operations in different states and verify the stability of the system in various abnormal scenarios. The system can dynamically adjust its exception handling logic based on real-time data to further improve the robustness of the system.

[0048] The specific method for obtaining the abnormal user behavior data is as follows: Get the user The number of quick clicks during the automated use case generation process within the time period; Monitor and obtain user download files and traffic data during the transmission process; Collect the abnormal operation text data in the process of user automated use case generation, and pre-process the abnormal operation text data; Perform word segmentation on the processed operation abnormality text data to obtain an operation abnormality keyword sequence; The abnormal operation keyword sequence is converted into an abnormal operation keyword feature vector based on a semantic converter by using a word embedding technology; based on The number of clicks and traffic data within a time period are combined with the abnormal operation keyword feature vector to obtain user behavior abnormality data based on a preset user behavior formula.

[0049] The specific calculation formula for the abnormal user behavior data is as follows:

[0050] In the formula, H is the abnormal user behavior data, d is the number of clicks, The time when the user clicks. is the traffic data, S is the number of files, is the feature vector of abnormal operation keywords, and g is the abnormal coefficient factor.

[0051] It should be noted that obtaining the number of user clicks can be understood as users clicking multiple buttons or links in a very short period of time, which may cause the automation tool to fail to correctly record or synchronize these behaviors, generating inconsistent or erroneous test cases. Traffic data can be understood as abnormal behaviors such as account blasting, remote login, port scanning, downloading files from the OA system, and excessive transmission traffic in the abnormal user behavior data, which may cause abnormal automation use cases to generate abnormalities.

[0052] S2, establish a case generation anomaly model based on machine learning for the protection device test case data, and generate a case generation anomaly coefficient. The specific steps are as follows; Acquiring historical protection device test case data, wherein the historical protection device test case data includes historical data synchronization abnormality data, historical extreme environment data, and historical user behavior abnormality data; Performing data cleaning and feature extraction on the historical protection device test case data, and dividing the extracted historical protection device test case data into a training set and a test set; The training set is used as the input value for training based on the machine learning algorithm. Through automatic adjustment, the parameter weights of data synchronization abnormal data, extreme environment data, and user behavior abnormal data are assigned respectively, and the use case generation abnormal model is obtained. Input the test set into the use case generation exception model for testing, and obtain the optimized use case generation exception model; The newly acquired data synchronization anomaly data, extreme environment data, and user behavior anomaly data are input into the optimized use case generation anomaly model to generate the use case generation anomaly coefficient.

[0053] The use case generates an exception model, and the specific calculation formula is as follows:

[0054] In the formula, R is the abnormal coefficient generated by the use case, and Y is the extreme environment data. is data synchronization abnormal data, H is user behavior abnormal data, , , is the weight coefficient.

[0055] It should be noted that when the extreme environment data is getting bigger and bigger, As data synchronization exception data grows, user behavior exception data grows, and the exception coefficient generated by use cases grows.

[0056] S3, based on the abnormal coefficient of the use case generation and the range of the stability coefficient of the use case generation, the abnormal situation of the automated use case generation is judged, and the system issues a reminder and takes action according to the abnormal situation. The specific steps are as follows: Execute each test case multiple times and record the stability coefficient of each test case when it is automatically generated; Obtain all stability coefficients, and obtain the mean and standard deviation of the stability coefficients by calculation; The use case generates a stability coefficient range based on the mean and standard deviation of the stability coefficient. The mean of the stability coefficient is used as the minimum parameter range, and K times the standard deviation of the stability coefficient is used as the maximum parameter range. k is a constant that determines the tolerable fluctuation range. When the use case generation abnormality coefficient exceeds or is not within the use case generation stability coefficient range, it indicates that the automatic use case generation of the protection device has an abnormality. The system will issue an alarm and record the abnormality in the diary for subsequent analysis. The system will also send a notification to the operation and maintenance personnel via email or SMS, so that the relevant personnel can conduct investigation and repair. When the use case generation abnormality coefficient is within the use case generation stability coefficient range, there is no abnormality in the automatic use case generation of the protection device.

[0057] Embodiment 2, Figure 2 The schematic diagram of the structure of the automatic use case generation system based on protection device training provided in the embodiment of the present application includes an abnormal data acquisition module, an abnormal model generation module, and an abnormal situation processing module, and there are connections between the modules: An abnormal data acquisition module is used to acquire protection device test case data, wherein the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data; An abnormal model generation module, used to establish a case generation abnormal model based on machine learning for the protection device test case data, and generate a case generation abnormal coefficient; The abnormal situation processing module is used to judge the abnormal situation generated by the automated use case based on the abnormal coefficient generated by the use case and the range of the stability coefficient generated by the use case, and the system issues reminders and takes action based on the abnormal situation.

[0058] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0059] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments may be implemented in whole or in part in the form of a computer program product.

[0060] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0061] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0062] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0063] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. An automated use case generation method based on protection device training, characterized in that: The steps include: Acquire protection device test case data, wherein the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data; The protection device test case data is used to establish a case generation anomaly model based on machine learning to generate a case generation anomaly coefficient; The abnormal situation of automated use case generation is judged based on the abnormal coefficient generated by the use case and the stability coefficient range of the use case generation. The system issues reminders and takes action based on the abnormal situation.

2. The method and system for generating automatic use cases based on protection device training according to claim 1, characterized in that: The specific method for obtaining the data synchronization abnormality data is as follows: Acquire input data of the test scenario, wherein the input data includes set current, voltage value, response time, and trigger value of the relay; Calculate the standard deviation of each data point based on the z-score method according to the input data of the test scenario, and draw an input data curve graph of the input data of the test scenario based on the standard deviation; Obtain stable data of current, voltage, response time and trigger value of relay of pre-set protection device test case, calculate standard deviation of stable data based on z-score method, and obtain stable curve of test data based on standard deviation of stable data; Compare the input curve with the test data stability curve to obtain the residual of each data point; The residuals of each data point are combined to obtain data synchronization anomaly data.

3. The method and system for generating automatic use cases based on protection device training according to claim 1, characterized in that: The specific method for obtaining the extreme environment data is as follows: Real-time monitoring and acquisition of the temperature, humidity, electromagnetic noise data and load fluctuation data of the test environment; Based on SCADA technology, the frequency parameters of the power grid are tracked in real time to obtain multiple frequency change data of the entire power grid. Based on multiple frequency change data, the frequency fluctuation data of the entire power grid is obtained by averaging method; Obtaining the strength of the electric field and magnetic field of the external electromagnetic signal interference source, and obtaining the external electromagnetic interference data by calculation according to the electromagnetic noise data combined with the strength of the electric field and magnetic field of the external electromagnetic signal interference source; The extreme environment data is calculated based on the extreme environment formula according to the temperature, humidity, load fluctuation data and grid frequency fluctuation data of the test environment.

4. The method and system for automatically generating use cases based on protection device training according to claim 1, characterized in that: The specific method for obtaining the abnormal user behavior data is as follows: Get the user in The number of quick clicks during the automated use case generation process within the time period; Monitor and obtain user download files and traffic data during the transmission process; Collect the abnormal operation text data in the process of user automated use case generation, and pre-process the abnormal operation text data; Perform word segmentation on the processed operation abnormality text data to obtain an operation abnormality keyword sequence; The abnormal operation keyword sequence is converted into an abnormal operation keyword feature vector based on a semantic converter by using a word embedding technology; based on The number of clicks and traffic data within a time period are combined with the abnormal operation keyword feature vector to obtain user behavior abnormality data based on a preset user behavior formula.

5. The method and system for automatically generating use cases based on protection device training according to claim 1, characterized in that: The protection device test case data is used to establish a case generation anomaly model based on machine learning to generate a case generation anomaly coefficient. The specific steps are as follows; Acquiring historical protection device test case data, wherein the historical protection device test case data includes historical data synchronization abnormality data, historical extreme environment data, and historical user behavior abnormality data; Performing data cleaning and feature extraction on the historical protection device test case data, and dividing the extracted historical protection device test case data into a training set and a test set; The training set is used as the input value for training based on the machine learning algorithm. Through automatic adjustment, the parameter weights of data synchronization abnormal data, extreme environment data, and user behavior abnormal data are assigned respectively, and the use case generation abnormal model is obtained. Input the test set into the use case generation exception model for testing, and obtain the optimized use case generation exception model; The newly acquired data synchronization anomaly data, extreme environment data, and user behavior anomaly data are input into the optimized use case generation anomaly model to generate the use case generation anomaly coefficient.

6. The method and system for automatically generating use cases based on protection device training according to claim 1, characterized in that: The abnormal situation of automatic use case generation is judged based on the abnormal coefficient generated by the use case and the stability coefficient range of the use case generation. The system issues a reminder and takes action according to the abnormal situation. The specific steps are as follows: Execute each test case multiple times and record the stability coefficient of each test case when it is automatically generated; Obtain all stability coefficients, and obtain the mean and standard deviation of the stability coefficients by calculation; Determine the range of stability coefficients generated by the use case based on the mean and standard deviation of the stability coefficients, take the mean of the stability coefficients as the minimum parameter range, and take K times the standard deviation of the stability coefficients as the maximum parameter range; When the use case generation abnormality coefficient exceeds or is not within the use case generation stability coefficient range, the automatic use case generation of the protection device has an abnormal situation; When the use case generation abnormality coefficient is within the use case generation stability coefficient range, there is no abnormality in the automatic use case generation of the protection device.

7. The method and system for automatically generating use cases based on protection device training according to claim 2, characterized in that: The specific calculation method of the standard deviation of each data point is as follows: The residual of each data point is combined to obtain data synchronization abnormal data. The specific calculation method is as follows: In the formula, For data synchronization abnormal data, is the combination function, is the standard deviation of the ith data point, is the standard deviation of the stable data, is the data to be input, V is the voltage value, I is the current, t is the response time, G is the trigger value of the relay, N is the number of data points to be measured, i is the data point, where i=1,2,3,...,N, N is an integer.

8. The method and system for automatically generating use cases based on protection device training according to claim 3, characterized in that: The specific calculation formula for the extreme environment data is as follows: In the formula, Y is the extreme environment data, T is the temperature, is humidity, u is the grid frequency fluctuation data, is the damage factor, E is the external electromagnetic interference data, is the load fluctuation number.

9. The method and system for automatically generating use cases based on protection device training according to claim 4, characterized in that: The specific calculation formula for the abnormal user behavior data is as follows: In the formula, H is the abnormal user behavior data, d is the number of clicks, The time when the user clicks. is the traffic data, S is the number of files, is the feature vector of abnormal operation keywords, and g is the abnormal coefficient factor.

10. A system using the automatic use case generation method based on protection device training as claimed in any one of claims 1 to 9, characterized in that: It includes abnormal data acquisition module, abnormal model generation module and abnormal situation processing module. There are connections between the modules: An abnormal data acquisition module is used to acquire protection device test case data, wherein the test case data includes data synchronization abnormality data, extreme environment data, and user behavior abnormality data; An abnormal model generation module, used to establish a case generation abnormal model based on machine learning for the protection device test case data, and generate a case generation abnormal coefficient; The abnormal situation processing module is used to judge the abnormal situation generated by the automated use case based on the abnormal coefficient generated by the use case and the range of the stability coefficient generated by the use case, and the system issues reminders and takes action based on the abnormal situation.

Citation Information

Patent Citations

  • Method and system for completing interface automation use case generation and execution based on flow collection

    CN115629967A

  • User interface automatic use case generation method and related device

    CN115934564A