Fuzzy test method and device for intelligent terminal of power grid

By determining the target monitoring indicators on the grid smart terminal, generating and optimizing test cases, fuzzy testing of grid smart terminals is achieved, and the problem of fragile security of grid smart terminals is solved, and the network security protection capability of the grid system is improved.

CN119690822APending Publication Date: 2025-03-25NORTH CHINA ELECTRICAL POWER RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411616267.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively identify and repair potential vulnerabilities in the firmware of the power grid smart terminal, resulting in fragile firmware security of the power Internet of Things terminals and becoming a weak link in network security protection of the power grid system.

Method used

A fuzzy testing method for power grid intelligent terminals is proposed. By determining the target monitoring indicators that can cause abnormalities in the power grid intelligent terminals, an initial test case set is generated, and optimization test cases are generated through optimization and variant operations, fuzzy testing of power grid intelligent terminals is realized.

Benefits of technology

It improves the efficiency and coverage of fuzzy testing of smart grid terminals, can more effectively identify potential vulnerabilities, and enhances network security protection of power grid systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119690822A_ABST
    Figure CN119690822A_ABST
Patent Text Reader

Abstract

The invention provides a power grid intelligent terminal fuzzy testing method and device, and relates to the technical field of testing. The method comprises the following steps: determining a target monitoring index which can cause the abnormality of the intelligent terminal of the power grid, and generating an initial test case set according to the target monitoring index; optimizing target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring index; and determining target combination input data which can cause abnormity of the target monitoring value, performing mutation operation on the target combination input data, generating an optimization test case according to a mutation operation result, and executing the optimization test case so as to perform fuzzy testing on the power grid intelligent terminal. The device executes the method. According to the method and the device provided by the embodiment of the invention, the power grid intelligent terminal fuzzy test efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of testing technology, and in particular to a fuzzy testing method and device for a power grid intelligent terminal. Background Art

[0002] With the construction of new power systems, more and more intelligent, networked and interactive power grid terminals are continuously connected to the power system. These power grid smart terminals are usually deployed in uncontrolled environments, facing problems of insufficient security and weak protection, resulting in a significant increase in network security risks at the end of the power grid. This situation makes the power system face a variety of security threats such as malicious attacks, data leakage, and equipment tampering. Although measures such as secure access platforms and data encryption transmission can ensure the security of system operation to a certain extent, such traditional security measures, such as physical isolation and network access control, mainly focus on the peripheral security of equipment and are difficult to effectively identify and repair potential vulnerabilities in firmware. These deficiencies have jointly led to the vulnerability of the firmware security of power Internet of Things terminals, becoming a major weak link in the network security protection of power grid systems.

[0003] The mainstream methods for detecting vulnerabilities in smart power grid terminals currently include static analysis and fuzz testing. Static analysis can identify potential security vulnerabilities and unsafe programming patterns during the development phase by conducting a comprehensive inspection of source code or binary code, thereby reducing the cost of later repairs. However, this method has a high false positive rate and cannot capture the dynamic behavior of the program at runtime, which may lead to the omission of vulnerabilities caused by certain environmental or input changes. In contrast, fuzz testing can dynamically detect the actual operation of the program by inputting a large amount of random or specifically constructed data into the target program, and identify vulnerabilities that are difficult to find in static analysis. Although fuzz testing is more effective in discovering vulnerabilities, its efficiency and test case coverage are often not guaranteed. Summary of the invention

[0004] In view of the problems in the prior art, an embodiment of the present invention provides a fuzzy testing method and device for a power grid intelligent terminal, which can at least partially solve the problems in the prior art.

[0005] On the one hand, the present invention provides a fuzzy testing method for a power grid intelligent terminal, comprising:

[0006] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0007] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0008] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0009] The step of generating an initial test case set according to the target monitoring indicator includes:

[0010] Acquire a test input type associated with the target monitoring indicator; the test input type includes a legal input type, a boundary input type, and an abnormal input type;

[0011] Initial test cases are constructed according to the test input type, and all initial test cases are aggregated to obtain the initial test case set.

[0012] The step of optimizing the target test cases in the initial test case set includes:

[0013] Obtaining each initial test case in the initial test case set, and performing fitness evaluation on each initial test case;

[0014] An initial test case whose fitness evaluation result is greater than a preset fitness threshold is determined as the target test case.

[0015] The step of optimizing the target test cases in the initial test case set further includes:

[0016] Obtaining a target test input type corresponding to the target test case;

[0017] The combined input data of the target test input type is expanded through selection and crossover operations, and the expanded combined input data is added to the test case set.

[0018] The determining of target monitoring indicators that may cause abnormality in the power grid smart terminal includes:

[0019] Obtain the monitoring indicators to be identified;

[0020] Based on a preset power grid intelligent terminal abnormality identification model, the monitoring indicator to be identified is identified to obtain a power grid intelligent terminal abnormality identification result and a target monitoring indicator that may cause the power grid intelligent terminal to be abnormal;

[0021] The preset power grid intelligent terminal anomaly recognition model is obtained by training an isolation forest model based on power grid intelligent terminal anomaly recognition samples.

[0022] The preset power grid intelligent terminal abnormality recognition model is obtained by training the isolation forest model according to the power grid intelligent terminal abnormality recognition sample, including:

[0023] Randomly sampling and segmenting the abnormal identification samples of the power grid intelligent terminal to construct a decision tree;

[0024] Traversing the isolation path length of each data point in the decision tree, evaluating the abnormality of the current data point according to the isolation path length, and obtaining an abnormal score for each data point;

[0025] Mark each data point according to the anomaly score, and determine distribution statistics of each type of anomaly data point according to the timestamp and data type of the operation of the power grid intelligent terminal;

[0026] The target monitoring index is obtained according to the distribution statistical information of each type of abnormal data point and the status of the corresponding power grid intelligent terminal.

[0027] Wherein, obtaining the abnormality recognition sample of the power grid intelligent terminal includes:

[0028] Collecting monitoring data of the power grid intelligent terminal during operation, and performing feature extraction on the monitoring data;

[0029] The extracted features are preprocessed, and the preprocessed features are combined into feature vectors as abnormality recognition samples of the power grid intelligent terminal.

[0030] On the one hand, the present invention provides a fuzzy testing device for a power grid intelligent terminal, comprising:

[0031] A determination unit, configured to determine a target monitoring indicator that may cause an abnormality in a power grid intelligent terminal, and to generate an initial test case set according to the target monitoring indicator;

[0032] An acquisition unit, configured to optimize the target test cases in the initial test case set to obtain a test case set, and execute the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0033] The testing unit is used to determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to realize fuzzy testing of the power grid intelligent terminal.

[0034] In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein:

[0035] The processor and the memory communicate with each other via the bus;

[0036] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:

[0037] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0038] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0039] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0040] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:

[0041] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:

[0042] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0043] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0044] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0045] The power grid smart terminal fuzzy testing method and device provided by the embodiment of the present invention determine the target monitoring indicators that may cause the power grid smart terminal to be abnormal, and generate an initial test case set according to the target monitoring indicators; optimize the target test cases in the initial test case set to obtain a test case set, and execute the test cases in the test case set to obtain the target monitoring value of the target monitoring indicator; determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to realize fuzzy testing of the power grid smart terminal, and by generating reasonable test cases, improve the test case coverage, thereby improving the efficiency of fuzzy testing of power grid smart terminals. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0047] Figure 1 It is a flowchart of a fuzzy testing method for a power grid intelligent terminal provided in one embodiment of the present invention.

[0048] Figure 2 It is a structural diagram of a power grid intelligent terminal fuzzy testing device provided by an embodiment of the present invention.

[0049] Figure 3 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.

[0051] Explanation of related terms:

[0052] Fuzz testing: A method of testing software security by generating random or mutated input data.

[0053] Grid smart terminal: an intelligent device connected to the power network, responsible for data collection, transmission and control.

[0054] Isolation Forest Model: An unsupervised learning algorithm specifically used for anomaly detection. It divides the data step by step by building multiple random decision trees. Since anomalies are easier to isolate (i.e., they are segmented out faster), Isolation Forest can effectively identify these anomalies and is suitable for anomaly detection in large-scale data.

[0055] Genetic algorithm: It is an optimization algorithm that simulates biological evolution, generates new solutions through selection, crossover and mutation operations, and gradually optimizes the solution to the problem. It is suitable for global optimization of complex problems.

[0056] Crossover operation: It is an operation in the genetic algorithm that combines certain features of existing test cases to generate new test cases to achieve test input diversity. This operation can make the generated test cases retain the advantages of the original efficient input and have new features, thereby improving test coverage.

[0057] Figure 1 FIG. 1 is a flow chart of a fuzzy testing method for a power grid intelligent terminal provided by an embodiment of the present invention. Figure 1 As shown, the power grid intelligent terminal fuzzy testing method provided by the embodiment of the present invention includes:

[0058] Step S1: Determine target monitoring indicators that may cause abnormality in power grid smart terminals, and generate an initial test case set based on the target monitoring indicators.

[0059] Step S2: Optimize the target test cases in the initial test case set to obtain a test case set, and execute the test cases in the test case set to obtain the target monitoring value of the target monitoring indicator.

[0060] Step S3: Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0061] In the above step S1, the device determines the target monitoring indicator that may cause the abnormality of the power grid smart terminal, and generates an initial test case set according to the target monitoring indicator. The device may be a computer device that executes the method, etc. The target monitoring indicator may include the response time, error log and resource usage (such as CPU load, memory usage, network bandwidth, etc.) of the power grid smart terminal. The target monitoring indicator that may cause the abnormality of the power grid smart terminal includes:

[0062] Acquire the monitoring indicators to be identified; the monitoring indicators to be identified may include not only the above-mentioned target monitoring indicators, but also other indicators, without specific limitation.

[0063] Based on the preset power grid intelligent terminal abnormality recognition model, the monitoring indicator to be identified is identified to obtain the power grid intelligent terminal abnormality recognition result and the target monitoring indicator that may cause the abnormality of the power grid intelligent terminal; the power grid intelligent terminal abnormality recognition result may include abnormality or normality; the monitoring indicator to be identified can be input into the preset power grid intelligent terminal abnormality recognition model, and the output result of the preset power grid intelligent terminal abnormality recognition model is used as the power grid intelligent terminal abnormality recognition result and the target monitoring indicator.

[0064] The preset power grid intelligent terminal anomaly recognition model is obtained by training an isolation forest model based on power grid intelligent terminal anomaly recognition samples.

[0065] Generating an initial test case set according to the target monitoring indicator includes:

[0066] Acquire a test input type associated with the target monitoring indicator; the test input type includes a legal input type, a boundary input type, and an abnormal input type;

[0067] Initial test cases are constructed according to the test input type, and all initial test cases are aggregated to obtain the initial test case set.

[0068] In the initial test case generation stage, the present invention uses a genetic algorithm to construct a diverse test case set suitable for power grid smart terminals to ensure that the test process can widely cover the potential risk scenarios of power grid smart terminals. The genetic algorithm generates a set of test cases containing different test input types in the process of simulating biological evolution. These test input types include legal input, boundary input and abnormal input to adapt to various real environments where power grid smart terminals operate. The specific steps are as follows:

[0069] Initial population generation: Genetic algorithms randomly generate an initial set of test cases (i.e., "population"). In intelligent terminal detection, the initial test cases can include the following types:

[0070] Legal input: For example, the power grid intelligent terminal receives voltage and current data normally and keeps them within a reasonable range;

[0071] Boundary input: If the voltage or current reaches or approaches the physical limit of the grid intelligent terminal (for example, if the voltage limit is 220V, input data of about 220V is generated);

[0072] Abnormal input: For example, generating data with sudden and large fluctuations (such as voltage increasing or decreasing by more than 50% instantly) to simulate the response of the equipment under extreme conditions;

[0073] Fitness evaluation: The fitness of each initial test case is evaluated based on the response of the power grid smart terminal. Cases with higher fitness usually have a significant impact on the power grid smart terminal, such as excessive resource consumption, abnormal response, or other potential vulnerabilities. For example, if an initial test case causes a significant increase in the response time of the power grid smart terminal or causes error logging, the initial test case is considered to have a high fitness and is retained for the next round of optimization.

[0074] The optimizing the target test cases in the initial test case set includes:

[0075] Obtaining each initial test case in the initial test case set, and performing fitness evaluation on each initial test case;

[0076] The initial test case whose fitness evaluation result is greater than the preset fitness threshold is determined as the target test case. Please refer to the relevant description of the fitness evaluation above.

[0077] In the above step S2, the device optimizes the target test cases in the initial test case set to obtain a test case set, and executes the test cases in the test case set to obtain the target monitoring value of the target monitoring indicator. The optimization of the target test cases in the initial test case set also includes:

[0078] Obtaining a target test input type corresponding to the target test case;

[0079] The combined input data of the target test input type is expanded through selection and crossover operations, and the expanded combined input data is added to the test case set.

[0080] Referring to the above description, after the initial population generation step, it also includes:

[0081] Use case optimization: The target test cases with high fitness are retained, and new combination inputs are generated through crossover and selection to further enrich the test case types. For example, if the smart terminal of the power grid is abnormal when approaching the voltage limit, then through crossover operations, new input data (such as voltage values ​​slightly higher than the limit) are generated to expand the coverage of the test cases.

[0082] After the use case optimization step, it also includes:

[0083] Iterative optimization: After multiple rounds of iterations, the test case set is gradually optimized, and the generated case combination will be more in line with the actual operating environment of the power grid smart terminal. For example, if certain inputs frequently trigger faults, the test case set around the input feature is generated first to monitor the factors that cause the risk of the power grid smart terminal to the greatest extent.

[0084] Through the above steps of initial population generation, use case optimization and iterative optimization, the generated test case set fully considers the various operating scenarios of power grid smart terminals, providing a diverse input basis for dynamic feedback and adjustment in subsequent steps, thereby ensuring the effectiveness and comprehensiveness of the testing process.

[0085] In the above step S3, the device determines the target combination input data that may cause the target monitoring value to be abnormal, performs a mutation operation on the target combination input data, generates an optimized test case according to the mutation operation result, and executes the optimized test case to realize fuzzy testing of the power grid smart terminal.

[0086] In the method of the present invention, generating an initial test case set is the first step in optimizing and adjusting fuzzy test cases, and its purpose is to build a variety of input scenarios to monitor the possible vulnerabilities of power grid smart terminals. However, since the response behavior of power grid smart terminals may vary with different inputs, some potential problems will only be exposed under specific conditions. Even if the initially generated test cases have covered a variety of boundaries and abnormal inputs, their effectiveness cannot be fully verified in the initial stage.

[0087] Therefore, during the actual test execution process, the test cases will be dynamically adjusted based on the real-time feedback information of the power grid smart terminal (the target monitoring value of the target monitoring indicator). This dynamic feedback mechanism automatically adjusts the input parameters or structures by introducing a "mutation" operation to further monitor the impact of different inputs on the power grid smart terminal. This mechanism ensures that the test not only covers the initial preset scenario, but also gradually optimizes the test input to discover deeper system vulnerabilities and potential faults, thereby significantly improving the effectiveness and comprehensiveness of fuzz testing.

[0088] The specific steps are as follows:

[0089] 1) Real-time monitoring and data collection:

[0090] During the execution of each test case, the system will collect and analyze key parameters in real time. For example, in the test of the power grid intelligent terminal, the following data may be included:

[0091] Response time: used to measure the delay in the terminal processing input and accurately record the timestamp of the response;

[0092] Error log: records abnormal responses and system crashes to locate possible anomalies;

[0093] Resource consumption: including CPU and memory usage, network bandwidth and other information to capture potential abnormal consumption or high load phenomena;

[0094] If an input (such as a simulated peak load) causes resource exhaustion or a significant increase in response time, the input is marked as an anomaly and its characteristic information is recorded.

[0095] 2) Feedback-based mutation generation:

[0096] Mutation is a concept in genetic algorithms, which refers to making small adjustments or changes to existing test inputs to generate new test data, thereby covering as many possible vulnerabilities in the system as possible. The mutation operation simulates different environments or input conditions, and can make subtle changes in input parameters, data structures, etc. to test the system's sensitivity to diverse inputs. This mutation operation can significantly expand the coverage of the test and help discover potential defects that are difficult to detect in static analysis. Feedback-based mutation generation includes the following operations:

[0097] Parameter fine-tuning: Make small adjustments to input parameters that cause anomalies. For example, the current value input can be increased or decreased by 1% to test the system's sensitivity to small changes. If a large current suddenly fluctuates (such as a significant increase in voltage in a short period of time), the terminal's safety response capabilities can be tested.

[0098] Timing variation: Adjust the order or delay of the input data packets to simulate the jitter of the network environment. For example, if the terminal crashes under the peak network load, by extending the packet interval or increasing the delay, the situation under different network conditions can be simulated.

[0099] Format or data type adjustment: Fine-tune the input data packet structure, such as inserting special characters or noise data, to test the system's response to data integrity anomalies. For example, if the terminal receives an illegal format data packet (such as a data packet containing special characters), observe whether it triggers an anomaly.

[0100] In the actual detection of smart power grid terminals, if the system detects excessive resource consumption logs during peak periods of power load fluctuations, it will generate variant data packets based on this input and further refine the fault test scenarios by continuously adjusting current, voltage parameters or transmission delays.

[0101] 3) Adaptive adjustment and coverage optimization:

[0102] As mutation testing continues, the system will analyze feedback information in real time and update the test strategy, mainly in the following two aspects:

[0103] Prioritize testing of high-risk areas: If the system detects that certain input types (such as peak loads) are more likely to trigger failures, subsequent testing will focus on such input variations, thereby giving priority to covering high-risk areas.

[0104] Adaptive adjustment of input parameters: Based on feedback data, the system will adjust input parameters after each round of testing. For example, if anomalies frequently occur within a certain voltage range, the system will prioritize generating diverse test cases within that range.

[0105] Throughout the entire process, through feedback variation and adaptive adjustment mechanisms, the system can reduce invalid tests, ensure more efficient coverage of potential fault areas in power grid smart terminals, and significantly improve the comprehensiveness and accuracy of vulnerability detection.

[0106] Through the above steps, the dynamic feedback and adjustment mechanism realizes the complete process from real-time monitoring, feedback-driven variation generation to adaptive adjustment. Combining the test case optimization and dynamic feedback of the genetic algorithm, the present invention improves the coverage and efficiency of fuzzy testing in fault detection of power grid intelligent terminals, and provides an innovative solution for the security protection of power Internet of Things terminals.

[0107] The preset power grid intelligent terminal abnormality recognition model is obtained by training the isolation forest model according to the power grid intelligent terminal abnormality recognition sample, including:

[0108] Randomly sampling and segmenting the abnormal identification samples of the power grid intelligent terminal to construct a decision tree;

[0109] Traversing the isolation path length of each data point in the decision tree, evaluating the abnormality of the current data point according to the isolation path length, and obtaining an abnormal score for each data point;

[0110] Mark each data point according to the anomaly score, and determine distribution statistics of each type of anomaly data point according to the timestamp and data type of the operation of the power grid intelligent terminal;

[0111] The target monitoring index is obtained according to the distribution statistical information of each type of abnormal data point and the status of the corresponding power grid intelligent terminal.

[0112] Acquiring the abnormality recognition sample of the power grid intelligent terminal includes:

[0113] Collecting monitoring data of the power grid intelligent terminal during operation, and performing feature extraction on the monitoring data;

[0114] The extracted features are preprocessed, and the preprocessed features are combined into feature vectors as abnormality recognition samples of the power grid intelligent terminal.

[0115] The instructions are as follows:

[0116] A real-time monitoring module is embedded in the power grid smart terminal, and key data of the power grid smart terminal operation is collected using embedded sensors and system logs. Specifically, the monitoring data includes response time, error logs, resource usage (such as CPU load, memory usage, network bandwidth, etc.), and abnormal events. The response time can record the input response delay through a timestamp, and the error log records the system crash or unexpected behavior of the power grid smart terminal. Resource usage monitoring regularly collects and stores resource consumption data through embedded statistical tools.

[0117] All collected data will be protected by encryption algorithms to prevent data leakage. To ensure the security of data during transmission to the server executing this method, the present invention uses AES-256 (Advanced Encryption Standard) encryption algorithm to encrypt the data to ensure that the data cannot be tampered with during transmission. The encrypted data is securely transmitted through the TLS protocol to ensure the confidentiality and integrity of the data during transmission.

[0118] After the data is transmitted, it needs to be feature extracted. Each set of running data corresponding to the collection time interval corresponds to a feature vector, and the feature values ​​include values ​​such as response time delay, CPU usage, and memory consumption. In order for the isolation forest algorithm to efficiently process and identify anomalies, these features will be processed through normalization or standardization to keep the data at a consistent scale. The generated feature vector will be input into the isolation forest algorithm as the basic data for detection.

[0119] The Isolation Forest Algorithm is an unsupervised learning algorithm designed specifically for anomaly detection and is suitable for processing large-scale high-dimensional data. The algorithm detects anomalies in the data by generating a set of random decision trees. Its main feature is that anomalies are isolated faster in decision trees than normal points. The following steps are used to build and train the model:

[0120] 1. Random sampling and segmentation: Randomly extract a feature from all feature vectors, such as response time delay, CPU usage, memory consumption, and other values, and then randomly select a segmentation point on this feature. This is equivalent to creating a segmentation surface in the feature space to divide the data. This process will be repeated many times to form a large number of segmentation surfaces, and finally a decision tree will be constructed.

[0121] 2. Construction of multiple decision trees: The Isolation Forest algorithm generates multiple random decision trees to form a so-called "forest". Each decision tree is constructed in the same way, but its segmentation method and path are random. Since abnormal data points have significantly different feature values ​​from normal data points, abnormal points tend to be isolated quickly in the shallow layers of the decision tree.

[0122] 3. Abnormality score calculation: After all decision trees are generated, the algorithm evaluates the abnormality of each data point by traversing the "isolation path length" in the decision tree. The shorter the isolation path, the more likely the data point is to be quickly isolated, and therefore the greater the abnormality. By combining the isolation results in all decision trees, the abnormality score of each data point is calculated. Points with higher scores are considered more abnormal, indicating that the point may correspond to a potential vulnerability.

[0123] After obtaining the anomaly score for each data point, by setting a threshold (such as 0.6 or 0.7), when the anomaly score is greater than the threshold, the data point will be marked as abnormal. Combined with the timestamp and data type (response time, error log, resource usage) of the power grid smart terminal operation, the time period corresponding to the abnormal data and the state of the power grid smart terminal (abnormal or normal) can be identified. According to the distribution of each type of abnormal data point, the state of the power grid smart terminal in these time periods will be further analyzed to identify which monitoring indicators will cause the power grid smart terminal to be prone to vulnerabilities or performance degradation. These monitoring indicators may be scenario-related indicators of excessive consumption of system resources, long response time, or unexpected behavior (such as system crashes). Subsequent testing and optimization will be based on these monitoring indicators first to further explore potential vulnerabilities or repair existing security risks.

[0124] The fuzzy testing method for power grid intelligent terminals provided in an embodiment of the present invention aims to improve the accuracy and efficiency of detection. The method monitors the operating status of power grid intelligent terminals in real time, analyzes their response characteristics, and identifies potential vulnerability areas. Based on the collected dynamic feedback information, the system will adaptively adjust the test input and data mutation strategy, giving priority to covering high-risk and complex paths. This adaptive mechanism not only improves the coverage and accuracy of vulnerability detection, but also effectively reduces the time and resource consumption caused by invalid testing, providing more efficient technical support for the security of the power Internet of Things.

[0125] The unsupervised learning algorithm Isolation Forest is introduced to detect system anomalies and identify vulnerabilities, and a genetic algorithm is applied in the dynamic feedback stage to generate diverse test cases. The system continuously optimizes input parameters and adjusts test strategies based on real-time feedback to enhance the adaptability and coverage of the test. The innovation of this method lies in its real-time feedback and adaptive adjustment capabilities, which make the fuzzy testing process more in line with the actual operating conditions of the power grid smart terminal, thereby significantly improving the detection effect and efficiency.

[0126] The fuzzy testing method for a power grid smart terminal provided in an embodiment of the present invention determines a target monitoring indicator that may cause an abnormality in a power grid smart terminal, generates an initial test case set according to the target monitoring indicator; optimizes the target test cases in the initial test case set to obtain a test case set, and executes the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator; determines target combination input data that may cause an abnormality in the target monitoring value, performs a mutation operation on the target combination input data, generates an optimized test case according to the mutation operation result, and executes the optimized test case to implement fuzzy testing of the power grid smart terminal, and improves the test case coverage by generating reasonable test cases, thereby improving the efficiency of fuzzy testing of power grid smart terminals.

[0127] Furthermore, generating an initial test case set according to the target monitoring indicator includes:

[0128] Obtain a test input type associated with the target monitoring indicator; the test input type includes a legal input type, a boundary input type, and an abnormal input type; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0129] An initial test case is constructed according to the test input type, and all initial test cases are summarized to obtain the initial test case set. The above description can be referred to in the embodiment, which will not be repeated here.

[0130] Further, the optimizing the target test cases in the initial test case set includes:

[0131] Obtain each initial test case in the initial test case set, and perform fitness evaluation on each initial test case; refer to the above embodiment for description, which will not be repeated here.

[0132] The initial test case whose fitness evaluation result is greater than the preset fitness threshold is determined as the target test case. The above embodiment can be referred to for description and will not be repeated here.

[0133] Furthermore, the optimizing the target test cases in the initial test case set further includes:

[0134] Obtain a target test input type corresponding to the target test case; please refer to the above embodiment for description and will not repeat them here.

[0135] The combined input data of the target test input type is expanded by selection and crossover operations, and the expanded combined input data is added to the test case set. The above embodiments can be referred to for explanation, and no further description is given.

[0136] Furthermore, the determination of target monitoring indicators that may cause abnormality of the power grid smart terminal includes:

[0137] Obtain the monitoring indicator to be identified; please refer to the above embodiment for description and will not repeat them here.

[0138] Based on the preset power grid intelligent terminal abnormality identification model, the monitoring indicators to be identified are identified to obtain the power grid intelligent terminal abnormality identification result and the target monitoring indicators that may cause the abnormality of the power grid intelligent terminal; please refer to the above embodiment for description and no further details will be given.

[0139] The preset power grid intelligent terminal abnormality recognition model is obtained by training an isolation forest model based on power grid intelligent terminal abnormality recognition samples. The above-mentioned embodiments can be referred to for explanation and will not be described in detail.

[0140] Furthermore, the preset power grid intelligent terminal abnormality recognition model is obtained by training the isolation forest model according to the power grid intelligent terminal abnormality recognition sample, including:

[0141] The abnormal identification samples of the power grid intelligent terminal are randomly sampled and segmented to construct a decision tree; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0142] The isolation path length of each data point in the decision tree is traversed, and the abnormality of the current data point is evaluated according to the isolation path length to obtain the abnormal score of each data point; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0143] Each data point is marked according to the abnormal score, and the distribution statistics of each type of abnormal data point is determined according to the timestamp and data type of the operation of the power grid intelligent terminal; the above-mentioned embodiment can be referred to for description and will not be repeated here.

[0144] The target monitoring index is obtained according to the distribution statistics of each type of abnormal data point and the status of the corresponding power grid intelligent terminal. The above-mentioned embodiment can be referred to for explanation and will not be described in detail.

[0145] Further, obtaining the abnormality recognition sample of the power grid intelligent terminal includes:

[0146] The monitoring data of the power grid intelligent terminal during operation is collected, and features are extracted from the monitoring data; the above-mentioned embodiments can be referred to for description and will not be described in detail.

[0147] The extracted features are preprocessed, and the preprocessed features are combined into feature vectors as the abnormality recognition samples of the power grid intelligent terminal. The above embodiments can be referred to for explanation, and no further description is given.

[0148] Figure 2 FIG. 1 is a schematic diagram of a fuzzy testing device for a power grid intelligent terminal provided by an embodiment of the present invention. Figure 2 As shown, the power grid intelligent terminal fuzzy testing device provided by the embodiment of the present invention includes a determination unit 201, an acquisition unit 202 and a testing unit 203, wherein:

[0149] The determination unit 201 is used to determine the target monitoring indicator that may cause the abnormality of the power grid smart terminal, and generate an initial test case set according to the target monitoring indicator; the acquisition unit 202 is used to optimize the target test case in the initial test case set to obtain a test case set, and execute the test case in the test case set to obtain the target monitoring value of the target monitoring indicator; the testing unit 203 is used to determine the target combination input data that may cause the abnormality of the target monitoring value, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to realize fuzzy testing of the power grid smart terminal.

[0150] Specifically, the determination unit 201 in the device is used to determine the target monitoring indicator that may cause the abnormality of the power grid smart terminal, and generate an initial test case set according to the target monitoring indicator; the acquisition unit 202 is used to optimize the target test case in the initial test case set to obtain a test case set, and execute the test case in the test case set to obtain the target monitoring value of the target monitoring indicator; the testing unit 203 is used to determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to realize fuzzy testing of the power grid smart terminal.

[0151] The power grid intelligent terminal fuzzy testing device provided by the embodiment of the present invention determines the target monitoring index that may cause the power grid intelligent terminal to be abnormal, and generates an initial test case set according to the target monitoring index; optimizes the target test case in the initial test case set to obtain a test case set, and executes the test case in the test case set to obtain the target monitoring value of the target monitoring index; determines the target combination input data that may cause the target monitoring value to be abnormal, performs a mutation operation on the target combination input data, generates an optimized test case according to the mutation operation result, and executes the optimized test case to realize fuzzy testing of the power grid intelligent terminal, and improves the test case coverage by generating reasonable test cases, thereby improving the efficiency of fuzzy testing of power grid intelligent terminals.

[0152] The embodiment of the present invention provides an embodiment of a fuzzy testing device for a power grid intelligent terminal, which can be specifically used to execute the processing flow of the above-mentioned method embodiments. Its functions are not repeated here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0153] Figure 3 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 3 As shown, the electronic device includes: a processor (processor) 301, a memory (memory) 302 and a bus 303;

[0154] The processor 301 and the memory 302 communicate with each other via a bus 303;

[0155] The processor 301 is used to call the program instructions in the memory 302 to execute the methods provided by the above method embodiments, for example, including:

[0156] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0157] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0158] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0159] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above method embodiments, for example, including:

[0160] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0161] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0162] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0163] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables the computer to execute the methods provided by the above method embodiments, for example, including:

[0164] Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators;

[0165] Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator;

[0166] Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

[0167] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0168] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0169] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0170] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0171] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0172] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A fuzzy testing method for a power grid intelligent terminal, characterized in that: include: Determine target monitoring indicators that may cause abnormality in the power grid smart terminal, and generate an initial test case set according to the target monitoring indicators; Optimizing the target test cases in the initial test case set to obtain a test case set, and executing the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator; Determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to implement fuzzy testing on the power grid smart terminal.

2. The power grid intelligent terminal fuzzy testing method according to claim 1 is characterized in that: Generating an initial test case set according to the target monitoring indicator includes: Acquire a test input type associated with the target monitoring indicator; the test input type includes a legal input type, a boundary input type, and an abnormal input type; Initial test cases are constructed according to the test input type, and all initial test cases are aggregated to obtain the initial test case set.

3. The power grid intelligent terminal fuzzy testing method according to claim 1 is characterized in that: The optimizing the target test cases in the initial test case set includes: Obtaining each initial test case in the initial test case set, and performing fitness evaluation on each initial test case; An initial test case whose fitness evaluation result is greater than a preset fitness threshold is determined as the target test case.

4. The fuzzy testing method for power grid intelligent terminal according to claim 3 is characterized in that: The optimizing the target test cases in the initial test case set also includes: Obtaining a target test input type corresponding to the target test case; The combined input data of the target test input type is expanded through selection and crossover operations, and the expanded combined input data is added to the test case set.

5. The power grid intelligent terminal fuzzy testing method according to claim 1 is characterized in that: The determination of target monitoring indicators that may cause abnormality in the power grid smart terminal includes: Obtain the monitoring indicators to be identified; Based on a preset power grid intelligent terminal abnormality identification model, the monitoring indicator to be identified is identified to obtain a power grid intelligent terminal abnormality identification result and a target monitoring indicator that may cause the power grid intelligent terminal abnormality; The preset power grid intelligent terminal anomaly recognition model is obtained by training an isolation forest model based on power grid intelligent terminal anomaly recognition samples.

6. The power grid intelligent terminal fuzzy testing method according to claim 5 is characterized in that: The preset power grid intelligent terminal abnormality recognition model is obtained by training the isolation forest model according to the power grid intelligent terminal abnormality recognition sample, including: Randomly sampling and segmenting the abnormal identification samples of the power grid intelligent terminal to construct a decision tree; Traversing the isolation path length of each data point in the decision tree, evaluating the abnormality of the current data point according to the isolation path length, and obtaining an abnormal score for each data point; Mark each data point according to the anomaly score, and determine distribution statistics of each type of anomaly data point according to the timestamp and data type of the operation of the power grid intelligent terminal; The target monitoring index is obtained according to the distribution statistical information of each type of abnormal data point and the status of the corresponding power grid intelligent terminal.

7. The fuzzy testing method for power grid intelligent terminal according to claim 6 is characterized in that: Acquiring the abnormality recognition sample of the power grid intelligent terminal includes: Collecting monitoring data of the power grid intelligent terminal during operation, and performing feature extraction on the monitoring data; The extracted features are preprocessed, and the preprocessed features are combined into feature vectors as abnormality recognition samples of the power grid intelligent terminal.

8. A fuzzy testing device for a power grid intelligent terminal, characterized in that: include: A determination unit, configured to determine a target monitoring indicator that may cause an abnormality in a power grid intelligent terminal, and to generate an initial test case set according to the target monitoring indicator; An acquisition unit, configured to optimize the target test cases in the initial test case set to obtain a test case set, and execute the test cases in the test case set to obtain a target monitoring value of the target monitoring indicator; The testing unit is used to determine the target combination input data that may cause the target monitoring value to be abnormal, perform a mutation operation on the target combination input data, generate an optimized test case according to the mutation operation result, and execute the optimized test case to realize fuzzy testing of the power grid intelligent terminal.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.