A method and system for self-detection and self-recovery of energy controller software faults

By building a fault feature library and processing strategy library, combined with machine learning and distributed consistency protocols, the business dimension fault detection and self-recovery of the energy controller software are realized, which solves the problem of single fault detection and recovery methods in the existing technology. Improved software stability and complex fault handling capabilities.

CN118152172BActive Publication Date: 2024-08-23NANJING XINLIAN ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410586747.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-13
Publication Date
2024-08-23
Estimated Expiration
2044-05-13

AI Technical Summary

Technical Problem

Existing technology cannot effectively detect and self-recovery faults in the business dimension of energy controller software. Commonly used watchdog methods and heartbeat detection methods can only detect partial faults and have a single recovery method, and cannot deal with complex software faults.

Method used

By collecting and preprocessing historical operating data of the energy controller software, we build a fault feature library and processing strategy library, use machine learning models to automatically identify fault characteristics and provide processing strategies, combined with distributed consistency protocols and multi-node collaborative working methods, The fault matrix and fault indication vector are formed, and matrix multiplication and evolutionary algorithm are used to optimize the processing strategy to achieve targeted detection and diversity recovery of faults.

Benefits of technology

It realizes business-dimensional fault detection and self-recovery of energy controller software, improves the pertinence and diversity of fault handling, enhances the stability and reliability of the software, and can respond to complex fault situations more effectively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118152172B
    Figure CN118152172B
Patent Text Reader

Abstract

The present invention discloses a method and system for self-checking and self-recovering of energy controller software faults, the method comprising collecting historical operation data of the energy controller software, constructing a fault feature library and a processing strategy library based on the historical operation data; constructing a fault matrix based on the fault feature library and the processing strategy library; cyclically detecting whether each feature in the fault feature library is established, and forming a fault indication vector based on the result of the cyclic detection and the fault matrix; calculating and obtaining the benefits of each processing strategy based on the fault indication vector and the fault matrix, and sequentially executing the processing strategies in the processing strategy library according to the order of benefits. The present invention models the possible faults in the business dimension, and handles the faults in a way of benefit priority, so that the fault detection is more targeted, and at the same time increases the diversity of fault handling strategies, thereby realizing the self-checking and self-recovering of the energy controller software in the business dimension.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of electric power information collection and discloses a method and a system for self-checking and self-recovering software faults of an energy controller. Background Art

[0002] The energy controller is a power information collection terminal that can realize multiple functions such as data collection, intelligent fee control, clock synchronization, precise metering, orderly charging, energy consumption management, circuit status inspection, household-to-variable relationship identification, and power outage event reporting.

[0003] As energy controllers are installed in large numbers in power grids, their operating environments are becoming more diverse and their usage scenarios are becoming more complex, making the software of energy controllers more complex. Complex software systems require long-term stable operation, and even after a large number of tests, there may still be failures. In a production environment, users do not want software anomalies to affect their business.

[0004] At present, the commonly used software fault detection and recovery methods are the watchdog method and the heartbeat detection method. The solution of the watchdog method is: use a watchdog device, the software needs to send a specific signal to the watchdog regularly, which is called "feeding the dog". Once the software system fails, the "feeding the dog" may stop. After the watchdog is hungry for a period of time, it will reset the system from the hardware level, thereby recovering the software from the fault state. The solution of the heartbeat detection method is: use a main software entity to maintain other software entities. Other software entities periodically send an agreed signal to the main software entity, which is called "heartbeat". The main software entity receives the heartbeat. Once the software entity fails, the "heartbeat" may stop. After the software entity heartbeat stops for a period of time, the main software entity will reset the software entity whose heartbeat has stopped through the agreed protocol.

[0005] The watchdog method and the heartbeat detection method can indeed quickly recover the software from some faults, but the faults that can be detected are limited and the recovery method is single. They can only detect faults that cause the "feeding the dog" and "heartbeat" actions to stop, and other faults cannot be detected. The recovery method is just a simple reset, and there is nothing you can do about faults that cannot be recovered after the reset. Therefore, it is quite necessary to conduct fault detection and recovery in the business dimension in combination with the functional characteristics of the software.

[0006] For energy controller software, there is currently no effective business-dimensional fault self-detection and self-recovery method. Summary of the invention

[0007] Purpose of the invention: To provide a method and system for self-detection and self-recovery of energy controller software faults, so as to solve the above-mentioned problems existing in the prior art.

[0008] Technical solution: A method for self-detection and self-recovery of energy controller software faults, comprising the following steps:

[0009] S1. Collect historical operation data of energy controller software, and build fault feature library and processing strategy library based on the historical operation data;

[0010] S2. According to the mapping relationship between faults and processing strategies, a fault matrix is ​​constructed based on the fault feature library and the processing strategy library;

[0011] S3, loop detection of each feature in the fault feature library to see if it holds true, and forming a fault indication vector based on the loop detection result and the fault matrix;

[0012] S4. Perform matrix multiplication on the fault indication vector and the fault matrix, calculate and obtain the benefits of each processing strategy, and execute the processing strategies in the processing strategy library in sequence according to the order of benefits. The matrix multiplication here is the Hadamard product.

[0013] According to one aspect of the present application, step S1 further comprises:

[0014] S11. Collect historical operation data of the energy controller software and pre-process it to remove noise and abnormal values; the historical operation data includes system logs, performance indicators, fault records and processing methods;

[0015] S12, extracting features from the preprocessed historical operation data, and constructing a training set and a test set based on the extracted features;

[0016] S13. Build a machine learning model, use the training set to train the machine learning model, and use the test set to evaluate the performance of the trained machine learning model;

[0017] S14. Use the trained machine learning model to analyze the operating data of the energy controller software in real time, automatically identify fault characteristics, and provide processing strategies;

[0018] S15. Summarize the fault features to form a fault feature library, and summarize the processing strategies to form a processing strategy library.

[0019] According to one aspect of the present application, step S2 is further:

[0020] S21, analyzing the relationship between faults and processing strategies, and constructing a fault matrix based on the fault feature library and the processing strategy library; wherein 1 in the row vector represents an available processing strategy for a certain fault, and 1 in the column vector represents a fault to which a certain processing strategy is applicable;

[0021] S22. Conduct qualitative and quantitative evaluation on the severity, impact scope and occurrence frequency of each fault in the fault signature library;

[0022] S23. Qualitatively and quantitatively evaluate the effectiveness, side effects, and implementation costs of each treatment strategy in the treatment strategy library;

[0023] S24, based on the evaluation results of the faults and processing strategies, calculating the weight value of each element in the fault matrix to form a weighted fault matrix;

[0024] S25. According to a preset weight threshold, the weighted fault matrix is ​​converted into a Boolean matrix.

[0025] According to one aspect of the present application, step S3 is further:

[0026] S31. Build a P2P communication network based on energy controller nodes, using a distributed consistency protocol;

[0027] S32, obtaining status information of the energy controller node, analyzing the spatiotemporal correlation of the status information, and detecting whether the fault is propagated in the P2P communication network based on the spatiotemporal correlation;

[0028] S33. Based on the detection results, the multi-node collaborative working method and cross-validation method are used to determine the fault location and fault cause;

[0029] S34. Form a fault indication vector based on the fault location and the fault matrix.

[0030] According to one aspect of the present application, step S4 is further:

[0031] S41, based on the fault indication vector and the fault matrix, calculate and obtain the benefits of each processing strategy;

[0032] S42, construct a multi-objective evaluation function, encode various combinations of processing strategies into a solution space, and generate an initial feasible solution through heuristic rules;

[0033] S43. Based on the initial feasible solution, an evolutionary algorithm is used to find the Pareto optimal solution set in the solution space through selection, crossover and mutation operations;

[0034] S44. Based on the order of benefits, select the optimal processing strategy from the Pareto optimal solution set.

[0035] According to one aspect of the present application, the fault feature library and the processing strategy library are optimized, specifically:

[0036] S1a, collects multi-source heterogeneous data from energy controllers, including application logs, system indicators, network traffic, and call chains;

[0037] S1b, preprocess the multi-source heterogeneous data, including time-space alignment, format conversion and semantic mapping, and build a unified fault feature space based on the preprocessed multi-source heterogeneous data;

[0038] S1c, in the fault feature space, extract key fault features, including abnormal indicators, error log keywords and abnormal call patterns;

[0039] S1d, use statistical and machine learning methods to detect anomalies of key features;

[0040] S1e, based on the results of anomaly detection, feature correlation analysis and timing analysis techniques are used to infer the root cause of the fault and provide corresponding processing strategies;

[0041] S1f. Add key fault features to the fault feature library, and add corresponding processing strategies to the processing strategy library.

[0042] According to one aspect of the present application, step S21 is further:

[0043] S211,Use call chain tracing technology to identify microservices in energy controller software;

[0044] S212. Based on the fault feature library and the processing strategy library, a local fault matrix is ​​constructed for each microservice.

[0045] S213, obtaining the call relationship, resource dependency and data flow of the energy controller, and constructing a microservice dependency graph;

[0046] S214. Based on the service dependency graph, reason about the propagation path of the fault between microservices;

[0047] S215. Construct a global fault matrix based on the propagation path, the fault feature library and the processing strategy library.

[0048] S216. Form a distributed fault matrix based on the local fault matrix and the global fault matrix.

[0049] According to one aspect of the present application, step S15 further includes adding potential fault features to a fault feature library, specifically:

[0050] S15a, collecting historical operation data of the energy controller, including time series data of various indicators;

[0051] S15b, preprocessing the historical operation data, including time alignment, missing value processing and normalization operations, to generate a time series for modeling;

[0052] S15c, extracting statistical and morphological features from the time series through time domain analysis, frequency domain analysis and signal processing techniques;

[0053] S15d. Based on statistical features and morphological features, a deep learning model for time series prediction is constructed, and the deep learning model is trained using historical operation data;

[0054] S15e. Use the trained deep learning model to obtain potential fault features, and add the potential fault features to the fault feature library.

[0055] According to one aspect of the present application, it also includes:

[0056] S5. Use knowledge graph technology to build a business-system-resource multi-level entity relationship graph of the energy controller. Based on the results of the cycle detection, use the business-system-resource multi-level entity relationship graph to trace the root cause of the fault; specifically:

[0057] S51. Construct the energy controller domain ontology and define the core concepts, attributes and relationships in the energy controller domain;

[0058] S52, collecting historical operation data of the energy controller, and extracting entities from the historical operation data based on the energy controller domain ontology, including hardware, software, services, indicators, and faults;

[0059] S53, based on the extracted entities, rule matching and statistical learning methods are used to extract semantic relationships between entities from historical operation data, including inclusion, dependency and influence;

[0060] S54, using ontology matching, knowledge alignment and instance linking technology to integrate entities and semantic relationships to form a multi-level entity relationship graph of business-system-resources;

[0061] S55. Based on the results of loop detection and the business-system-resource multi-level entity relationship graph, graph traversal and shortest path search algorithm are used to trace the fault propagation path and locate the root cause of the fault.

[0062] A system for self-detection and self-recovery of energy controller software faults, comprising:

[0063] at least one processor; and

[0064] a memory communicatively connected to at least one of the processors; wherein,

[0065] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the method for self-detection and self-recovery of energy controller software faults described in any of the above technical solutions.

[0066] Beneficial effect: The present invention models possible faults in the business dimension and handles the faults in a profit-first manner, making fault detection more targeted and increasing the diversity of fault handling strategies, thereby achieving self-inspection and self-recovery of the energy controller software in the business dimension. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 It is a flow chart of the present invention.

[0068] Figure 2 This is a flow chart of step S1 of the present invention.

[0069] Figure 3 This is a flow chart of step S2 of the present invention.

[0070] Figure 4 This is a flow chart of step S3 of the present invention.

[0071] Figure 5 This is a flow chart of step S4 of the present invention.

[0072] Figure 6 The present invention is a flowchart of an execution of a method for self-detection and self-recovery of energy controller software faults.

[0073] Figure 7 The present invention is a flowchart of a method for self-diagnosis and self-recovery of energy controller software faults for uplink communication abnormality.

[0074] Figure 8 The present invention is a method for self-checking and self-recovering software faults of an energy controller and a flowchart for handling abnormal file systems. DETAILED DESCRIPTION

[0075] like Figure 1 As shown, the present application proposes a method for self-detection and self-recovery of energy controller software faults, the specific steps are:

[0076] S1. Collect historical operation data of energy controller software, and build fault feature library and processing strategy library based on the historical operation data;

[0077] S2. According to the mapping relationship between faults and processing strategies, a fault matrix is ​​constructed based on the fault feature library and the processing strategy library;

[0078] S3, loop detection of each feature in the fault feature library to see if it holds true, and forming a fault indication vector based on the loop detection result and the fault matrix;

[0079] S4. Perform matrix multiplication on the fault indication vector and the fault matrix, calculate and obtain the benefits of each processing strategy, and execute the processing strategies in the processing strategy library in sequence according to the order of benefits.

[0080] In a further embodiment, feature information of possible faults of various services is summarized from the business dimension to form a fault feature library, and processing methods are provided for various faults to form a processing strategy library; since a fault may have multiple processing strategies, and a processing strategy may repair multiple faults, a fault matrix is ​​defined to describe this relationship. The elements of the fault matrix are only 1 and 0. 1 in the row of the matrix indicates a processing strategy available for a certain fault, and 1 in the column of the matrix indicates a fault to which a certain processing strategy is applicable. If there are m types of faults and n types of processing strategies, the fault matrix is ​​an m×n matrix; the fault detection module cyclically detects each feature in the fault feature library Whether it is established, thereby judging whether a fault occurs, according to the order of the faults represented by the rows of the fault matrix, the information on whether the fault is detected is represented as a row vector, recorded as the fault indication vector p, the detected fault is 1, the undetected fault is 0, and there are m kinds of faults, then the fault indication vector p has m elements; the fault processing module multiplies the fault indication vector p with the fault matrix F, and the obtained row vector represents the benefit of each processing strategy, the processing strategy with high benefit is executed first, and if the fault is still detected after the processing strategy is executed, the current processing strategy can be retried within the limited number of retries, and then the processing strategy with low benefit can be executed.

[0081] The benefit priority principle is that when there are multiple processing strategies for a fault, the execution order is determined according to the benefit obtained after executing each processing strategy. The strategy with higher benefits is executed first, and the strategy with lower benefits is executed later. Benefit means that when a processing strategy can solve multiple faults, the more faults solved by the processing strategy, the higher the benefit.

[0082] This embodiment classifies the faults of the energy controller software in the business dimension and handles the faults in a way that prioritizes benefits. Compared with the watchdog and heartbeat methods, this embodiment can target more types of faults. The fault types and fault handling strategies are combined with the business characteristics of the energy controller software, so that faults can be detected in a targeted manner. The fault handling strategies are also more diverse, and the principle of priority benefits can be used to execute one strategy to solve multiple faults at the same time, thereby improving the efficiency of fault handling.

[0083] like Figure 2 As shown, according to one aspect of the present application, step S1 is further:

[0084] S11. Collect historical operation data of the energy controller software and pre-process it to remove noise and abnormal values; the historical operation data includes system logs, performance indicators, fault records and processing methods;

[0085] S12, extracting features from the preprocessed historical operation data, and constructing a training set and a test set based on the extracted features;

[0086] S13. Build a machine learning model, use the training set to train the machine learning model, and use the test set to evaluate the performance of the trained machine learning model;

[0087] S14. Use the trained machine learning model to analyze the operating data of the energy controller software in real time, automatically identify fault characteristics, and provide processing strategies;

[0088] S15. Summarize the fault features to form a fault feature library, and summarize the processing strategies to form a processing strategy library.

[0089] In a further embodiment, historical operation data of the energy controller software is collected, including system logs, performance indicators, fault records, processing methods, etc.; log analysis tools are used to filter out error messages, and statistical methods are used to identify and eliminate anomalies in performance data, so as to ensure the quality of the data and provide accurate input for subsequent analysis; key features are extracted from the cleaned data, and training sets and test sets for machine learning are constructed based on these features, so as to identify key factors affecting system performance and stability and provide a basis for model training; appropriate machine learning algorithms, such as decision trees, random forests, support vector machines, etc., are selected, trained on the training set, hyperparameters are adjusted, and model performance is optimized; the fault detection and classification effects of the model are evaluated on the test set, and indicators such as accuracy, recall rate, and F1 value are calculated; the trained model is deployed to the energy controller software, the operation data is analyzed in real time, fault features are automatically identified, and processing strategies are given; new fault data is regularly collected, the model is retrained, incremental learning is achieved, and the generalization performance of the model is continuously improved.

[0090] This embodiment introduces a machine learning method to automatically summarize fault features and processing strategies by analyzing historical fault data, and dynamically update the feature library and strategy library. This can adapt to the ever-changing software system and operating environment and improve the intelligent level of fault detection and processing.

[0091] According to one aspect of the present application, the fault feature library and the processing strategy library are optimized, specifically:

[0092] S1a, collects multi-source heterogeneous data from energy controllers, including application logs, system indicators, network traffic, and call chains;

[0093] S1b, preprocess the multi-source heterogeneous data, including time-space alignment, format conversion and semantic mapping, and build a unified fault feature space based on the preprocessed multi-source heterogeneous data;

[0094] S1c, in the fault feature space, extract key fault features, including abnormal indicators, error log keywords and abnormal call patterns;

[0095] S1d, use statistical and machine learning methods to detect anomalies of key features;

[0096] S1e, based on the results of anomaly detection, feature correlation analysis and timing analysis techniques are used to infer the root cause of the fault and provide corresponding processing strategies;

[0097] S1f. Add key fault features to the fault feature library, and add corresponding processing strategies to the processing strategy library.

[0098] In this embodiment, various types of data such as application logs, system indicators, network traffic and call chains are collected from the energy controller to ensure the comprehensiveness of the data and provide a rich source of information for fault diagnosis; the collected data is time-space aligned, format converted and semantically mapped to unify data from different sources and formats; in a unified fault feature space, key fault features such as abnormal indicators, error log keywords and abnormal call patterns are identified, so that possible fault points can be quickly located and the efficiency of fault diagnosis can be improved; key features are analyzed using statistical methods and machine learning algorithms to detect anomalies, so that abnormal behaviors can be automatically identified, manual intervention can be reduced, and the accuracy of fault detection can be improved; based on the anomaly detection results, feature correlation analysis and timing analysis techniques are used to infer the root cause of the fault and formulate corresponding processing strategies, which helps to understand the deep-seated causes of the fault and provide a scientific basis for solving the problem; the identified key fault features and formulated processing strategies are added to the corresponding library, and the fault feature library and processing strategy library are continuously enriched to improve the system's response capability and processing efficiency to new faults.

[0099] This embodiment makes full use of the multi-source heterogeneous data of the energy controller, adds the detected new fault features to the fault feature library, continuously enriches and improves the feature library, and thus constructs more comprehensive and accurate fault features.

[0100] Furthermore, step S15 also includes adding the potential fault feature to the fault feature library, specifically:

[0101] S15a, collecting historical operation data of the energy controller, including time series data of various indicators;

[0102] S15b, preprocessing the historical operation data, including time alignment, missing value processing and normalization operations, to generate a time series for modeling;

[0103] S15c, extracting statistical and morphological features from the time series through time domain analysis, frequency domain analysis and signal processing techniques;

[0104] S15d. Based on statistical features and morphological features, a deep learning model for time series prediction is constructed, and the deep learning model is trained using historical operation data;

[0105] S15e. Use the trained deep learning model to obtain potential fault features, and add the potential fault features to the fault feature library.

[0106] In this embodiment, the trained prediction model is used to predict real-time data, and the deviation between the predicted value and the actual value is used as the anomaly score. The warning threshold is set according to the anomaly score. When the anomaly continues to accumulate to a certain extent, a fault warning is issued to trigger active defense measures. This embodiment further attempts predictive fault detection by constructing a deep learning model for time series prediction. Through algorithms such as time series analysis and anomaly detection, the precursors of faults are discovered in advance, faults are actively avoided, and some features of potential faults are added to the fault feature library.

[0107] like Figure 3 As shown, according to one aspect of the present application, step S2 is further:

[0108] S21, analyzing the relationship between faults and processing strategies, and constructing a fault matrix based on the fault feature library and the processing strategy library; wherein 1 in the row vector represents an available processing strategy for a certain fault, and 1 in the column vector represents a fault to which a certain processing strategy is applicable;

[0109] S22. Conduct qualitative and quantitative evaluation on the severity, impact scope and occurrence frequency of each fault in the fault signature library;

[0110] S23. Qualitatively and quantitatively evaluate the effectiveness, side effects, and implementation costs of each treatment strategy in the treatment strategy library;

[0111] S24, based on the evaluation results of the faults and processing strategies, calculating the weight value of each element in the fault matrix to form a weighted fault matrix;

[0112] S25. According to a preset weight threshold, the weighted fault matrix is ​​converted into a Boolean matrix.

[0113] In a further embodiment, historical data in a fault database is used to score newly discovered faults, and their severity is evaluated by the frequency of occurrence, the number of users affected, and the criticality of the system, so that the faults with the greatest impact on the system can be quickly identified and handled with priority; existing processing strategies are reviewed and analyzed to evaluate their efficiency in solving problems, possible negative impacts, and implementation costs, to ensure that the adopted processing strategy is the most cost-effective and to avoid waste of resources; based on the results of fault and strategy evaluation, an algorithm model is used to calculate the weight value of each fault type and processing strategy, and the importance of faults and strategies can be more accurately reflected through the allocation of weight values, providing a quantitative basis for decision-making; combined with expert experience and historical data analysis, a threshold is set for different faults and strategies to determine whether action is needed, wherein the setting of the threshold helps to automate the processing process and reduce unnecessary manual intervention; based on the actual effect of fault handling, the weights and thresholds are adjusted regularly to reflect the latest system status and fault handling experience, so as to ensure that the fault handling mechanism can adapt to system changes and continuously optimize performance.

[0114] This embodiment introduces the concept of weights into the fault matrix, performs quantitative evaluation on the severity of different faults and the effects of different processing strategies, and constructs a weighted fault matrix, so that the priorities can be weighed more finely when selecting subsequent processing strategies.

[0115] Considering that the deployment form of the energy controller in the cloud-native environment may be containers or microservices, the traditional single-body fault matrix may no longer be applicable. The present application proposes that step S21 is further as follows:

[0116] S211,Use call chain tracing technology to identify microservices in energy controller software;

[0117] S212. Based on the fault feature library and the processing strategy library, a local fault matrix is ​​constructed for each microservice.

[0118] S213, obtaining the call relationship, resource dependency and data flow of the energy controller, and constructing a microservice dependency graph;

[0119] S214. Based on the service dependency graph, reason about the propagation path of the fault between microservices;

[0120] S215. Construct a global fault matrix based on the propagation path, the fault feature library and the processing strategy library.

[0121] S216. Form a distributed fault matrix based on the local fault matrix and the global fault matrix.

[0122] In this embodiment, the topology of microservices is automatically discovered through means such as a service registration center, configuration management, and call chain tracking. Automated topology discovery can reduce the need for manual configuration and updates, and ensure the accuracy and latest status of the system map; the call relationship, resource dependency, data flow, etc. between microservices are analyzed to build a service dependency graph, which can help understand the dependencies between services. When a failure occurs, the possible impact range can be quickly located; a local fault matrix is ​​built for each microservice to characterize its internal fault characteristics and processing strategies. The local fault matrix helps to understand the health status of a single service in detail; based on the service dependency graph, the propagation path of the fault between microservices is inferred, and a global fault matrix is ​​built. The global fault matrix can show how the fault propagates throughout the microservice architecture, which helps to formulate a more effective recovery strategy; when a failure occurs, the impact range of the fault is determined according to the local and global fault matrices, and isolation and recovery operations are performed, which can minimize the impact of the fault, quickly restore services, and ensure high availability and stability of the system.

[0123] This embodiment designs a distributed fault matrix for cloud native, characterizes the fault propagation relationship within different microservices and between microservices, and achieves rapid response and effective management of faults in the microservice architecture, thereby improving the overall stability and reliability of the system. This method also helps to reduce system downtime and improve user satisfaction.

[0124] According to another aspect of the present application, in a complex microservice system, the processing strategy of service A may affect service B, and there is a game relationship. It can be modeled as a multi-agent reinforcement learning problem, and a robust joint processing strategy can be trained through self-game, specifically: each microservice of the energy controller is modeled as an autonomous agent, which can observe the local environment state and make action decisions, where the agent is a software entity that can act and make decisions autonomously, and it can observe the environment and respond according to the observation results; extract key indicators reflecting the health status of microservices and construct a global state space; abstract various fault handling actions of microservices into a set of discrete or continuous action spaces; calculate the instant reward value for each agent based on the effect of fault recovery, such as recovery time, business loss, etc.; the agent continuously optimizes the action strategy by interacting with the environment and other agents using reinforcement learning algorithms (such as DQN, MADDPG, etc.); introduce an exploration mechanism to encourage the agent to try new strategies, while taking into account the exploitation mechanism to select known high-return strategies; deploy the trained agent strategy to the production environment, and autonomously select the optimal recovery action based on local state observations.

[0125] In this embodiment, through the action decision-making of the autonomous agent, the system can better adapt to environmental changes and internal state changes; using the reinforcement learning algorithm to optimize the action strategy can reduce fault recovery time and business losses; through continuous learning and optimization, the agent can more effectively handle various faults and improve the overall stability of the system; introducing an exploration mechanism to encourage the agent to try new strategies may discover more effective problem-solving methods; through the balance of exploitation and exploration, it is ensured that the agent can use known effective strategies while trying new strategies; deploying the trained agent strategy to the production environment can achieve more automated operations, reduce manual intervention, and improve efficiency.

[0126] like Figure 4 As shown, according to one aspect of the present application, step S3 is further:

[0127] S31. Build a P2P communication network based on energy controller nodes, using a distributed consistency protocol;

[0128] S32, obtaining status information of the energy controller node, analyzing the spatiotemporal correlation of the status information, and detecting whether the fault is propagated in the P2P communication network based on the spatiotemporal correlation;

[0129] S33. Based on the detection results, the multi-node collaborative working method and cross-validation method are used to determine the fault location and fault cause;

[0130] S34. Form a fault indication vector based on the fault location and the fault matrix.

[0131] In a further embodiment, a P2P communication network is established between energy controller nodes, and health status information of the nodes is exchanged regularly, so as to ensure that the information between nodes is updated in real time, which helps to quickly discover and respond to potential faults; then a distributed consistency protocol is designed to ensure the accuracy and consistency of fault detection, such as a failure detection protocol based on gossip. The distributed consistency protocol can improve the fault tolerance of the system and ensure the accuracy of fault detection; by analyzing the spatiotemporal correlation of node states, the propagation of faults in the P2P network is detected, which can help determine the source and propagation path of the fault and provide key information for fault response; through the collaborative analysis of fault symptoms by multiple nodes and cross-validation, the accuracy of fault location is improved; finally, decentralized technologies such as blockchain are introduced to achieve tamper-proof recording and multi-party verification of fault information. The decentralized recording method increases the security of the system because fault information cannot be tampered with by a single node and is easy to audit.

[0132] Based on self-monitoring, this embodiment introduces collaborative monitoring of other energy controllers, builds a point-to-point gossip protocol, exchanges health status, and implements distributed fault detection, thereby improving the efficiency and reliability of fault management, reducing system downtime, and improving the overall service quality, which is very helpful for quickly discovering faults such as network partitions.

[0133] like Figure 5 As shown, according to one aspect of the present application, step S4 is further:

[0134] S41, based on the fault indication vector and the fault matrix, calculate and obtain the benefits of each processing strategy;

[0135] S42, construct a multi-objective evaluation function, encode various combinations of processing strategies into a solution space, and generate an initial feasible solution through heuristic rules;

[0136] S43. Based on the initial feasible solution, an evolutionary algorithm is used to find the Pareto optimal solution set in the solution space through selection, crossover and mutation operations;

[0137] S44. Based on the order of benefits, select the optimal processing strategy from the Pareto optimal solution set.

[0138] In this embodiment, a multi-objective evaluation function is constructed based on factors such as recovery time, resource consumption, and data loss, and different strategy combinations are encoded into points in the solution space. The initial feasible solution set is generated using heuristic rules, which ensures that in the process of searching for a treatment solution, not only a single objective is considered, but multiple important factors are comprehensively considered to find a more comprehensive treatment solution; starting from the initial feasible solution, an evolutionary algorithm such as NSGA-II is used for iterative optimization. In each iteration, the solution space is explored through selection, crossover, and mutation operations to find the Pareto optimal solution set, that is, those solutions that perform well on multiple objectives. The evolutionary algorithm can find the optimal or approximately optimal solution in a wide range of solution spaces, which improves the efficiency and quality of the search; according to the order of benefits, the optimal treatment strategy that meets the constraints and balances each objective is selected from the Pareto optimal solution set to generate a specific executable emergency plan.

[0139] In this embodiment, in addition to restoring the system, the processing strategy can also collect fault information, isolate affected components, and other goals, forming a multi-objective optimization problem. Using AI optimization technologies such as heuristic search and evolutionary algorithms, online search for the optimal processing strategy combination helps organizations handle faults more accurately and efficiently, reduce system downtime, and improve user satisfaction and business continuity.

[0140] According to another aspect of the present application, it also includes:

[0141] S5. Use knowledge graph technology to build a business-system-resource multi-level entity relationship graph of the energy controller. Based on the results of the cycle detection, use the business-system-resource multi-level entity relationship graph to trace the root cause of the fault; specifically:

[0142] S51. Construct the energy controller domain ontology and define the core concepts, attributes and relationships in the energy controller domain;

[0143] S52, collecting historical operation data of the energy controller, and extracting entities from the historical operation data based on the energy controller domain ontology, including hardware, software, services, indicators, and faults;

[0144] S53, based on the extracted entities, rule matching and statistical learning methods are used to extract semantic relationships between entities from historical operation data, including inclusion, dependency and influence;

[0145] S54, using ontology matching, knowledge alignment and instance linking technology to integrate entities and semantic relationships to form a multi-level entity relationship graph of business-system-resources;

[0146] S55. Based on the results of loop detection and the business-system-resource multi-level entity relationship graph, graph traversal and shortest path search algorithm are used to trace the fault propagation path and locate the root cause of the fault.

[0147] In this embodiment, by constructing the energy controller domain ontology, defining core concepts, attributes and relationships, and forming a unified knowledge representation framework; then extracting entities such as hardware, software, services, indicators, faults, etc. from structured, semi-structured and unstructured data; extracting semantic relationships between entities such as inclusion, dependency, influence, etc. from the data through rule matching, statistical learning and other methods; integrating multi-source heterogeneous entities and relationships into a consistent knowledge graph by using technologies such as ontology matching, knowledge alignment, and instance linking; selecting a suitable graph database, such as Neo4j, for persistent storage of the knowledge graph to support efficient graph query and reasoning; when a fault occurs, traversing the graph, finding the shortest path and other algorithms are used to trace the fault propagation path and quickly locate the root cause; after the fault is handled, provide explainability for the fault analysis results, present the ontology knowledge and data evidence used in the reasoning process, and facilitate human-computer interaction.

[0148] This embodiment uses knowledge graph technology to construct a multi-level entity relationship graph of the business-system-resource of the energy controller, infer the fault propagation path, and trace the root cause of the fault. It not only improves the fault response speed, but also enhances the transparency of the system. It uses knowledge graphs to analyze and predict faults, guide maintenance work, reduce unnecessary maintenance costs, provide data support for intelligent management and automated control of power grids, and promote efficient use of energy.

[0149] According to another aspect of the present application, in addition to passively responding to online faults, faults can also be actively injected offline / online to collect system performance, enriching the fault feature library on the one hand and evaluating the effectiveness of the processing strategy on the other. Specifically: define the fault model, abstract a set of common fault types based on historical faults and expert experience to form a standardized fault model; design injection strategies, design comprehensive coverage and non-business-affecting fault injection strategies, including dimensions such as space (location), time, and intensity; automated injection, automatically perform fault injection through scripts, tools, and other technical means, and collect performance data of the system under test; fault drill evaluation, evaluate the injected faults, including indicators such as discovery time, recovery time, and impact range; weakness analysis improvement, based on the weak links exposed by the fault drill, supplement the fault characteristics in a targeted manner, improve the processing strategy, and improve the system resilience.

[0150] like Figure 6 As shown, in a further embodiment, a fault feature library and a processing strategy library are first established. From the business dimension, the faults of the energy controller software can be divided into repeated APP restarts, file system abnormalities, insufficient storage space, uplink communication abnormalities, online upgrade abnormalities, container environment abnormalities, etc.

[0151] Fault characteristics of repeated APP restarts: The process information of the APP keeps changing while it is running.

[0152] Fault symptoms of file system abnormalities: Folders or files cannot be accessed.

[0153] Fault symptoms of insufficient storage space: The disk space usage is greater than the threshold.

[0154] Fault symptoms of abnormal upstream communication: Unable to communicate with the upstream device.

[0155] Fault characteristics of abnormal online upgrade: The upgraded program cannot run normally.

[0156] Fault characteristics of abnormal container environment: The container is not running or the APP in the container is not running.

[0157] The solution for repeated APP restarts: restart the system and restore factory settings.

[0158] Strategy for handling file system exceptions: restart the system

[0159] Insufficient storage space: Delete logs.

[0160] Strategy for handling abnormal uplink communication: restart the system and enable the backup communication program.

[0161] Online upgrade exception handling strategy: rollback.

[0162] Strategy for handling container environment abnormalities: Reinstall the container.

[0163] Then, a fault matrix is ​​established. According to the characteristics of energy control software, the rows of the matrix represent the available processing strategies for several abnormalities, including repeated APP restarts, file system abnormalities, insufficient storage space, uplink communication abnormalities, online upgrade abnormalities, and container environment abnormalities. The columns of the matrix represent the faults applicable to the processing strategies of restarting the system, restoring factory settings, deleting logs, enabling backup communication programs, rolling back, and reinstalling containers. Therefore, the fault matrix F can be listed as follows:

[0164]

[0165] The fault detection module cyclically detects whether each fault characteristic is satisfied, such as Figure 7 As shown in the figure, one method of detecting abnormal upstream communication failure is: the software will refresh a flag bit each time it successfully communicates with the upstream, and the fault detection module will periodically detect the flag bit. If the flag update is not detected for more than 24 hours, it is considered that there is no communication with the upstream device and an abnormal upstream communication failure is detected. Figure 8 As shown, one method of detecting abnormal file system failure is to repeatedly test whether the file is opened and written successfully. If the number of failures cannot be successfully counted and the number of failures exceeds 10 times, it is considered that the file cannot be opened and an abnormal file system failure is detected. At this time, the fault indication vector is as follows:

[0166] p = (0 1 0 1 0 0)

[0167] The fault processing module multiplies the fault indication vector p by the fault matrix F. The resulting row vector represents the benefit of each processing strategy, which is called the benefit vector. The benefit vector q is expressed as follows:

[0168]

[0169] From the value of the benefit vector, we can see that the benefit of the processing strategy of restarting the system is 2, and the restarting system can handle both the uplink communication abnormality and the file system abnormality. The benefit of the processing strategy of enabling the backup communication program is 1, and enabling the backup communication program can only handle the uplink communication abnormality. Therefore, the processing strategy of restarting the system is executed first. In this embodiment, the restarting system is limited to 3 times, so in Figure 7 and Figure 8 In the process, the system restart is limited to no more than 3 times. If the fault is still detected, the processing strategy of enabling the backup communication program will be executed.

[0170] A system for self-detection and self-recovery of energy controller software faults, comprising:

[0171] at least one processor; and

[0172] a memory communicatively connected to at least one of the processors; wherein,

[0173] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the method for self-detection and self-recovery of energy controller software faults described in any of the above technical solutions.

[0174] In a specific embodiment, a system for self-detection and self-recovery of energy controller software faults includes a fault feature library, a processing strategy library, a fault detection module, and a fault processing module. The fault feature library is a collection of features of possible faults in energy control software; the processing strategy library is a collection of processing strategies for possible faults in energy controller software; the fault detection module detects faults based on the fault feature library; and the fault processing module performs fault processing based on the processing strategy library and the benefit priority principle.

[0175] The present invention proposes a method and system for self-checking and self-recovering faults of energy controller software. The method models possible faults in the business dimension to form a fault feature library and a corresponding processing strategy library. Fault self-checking is implemented based on the fault feature library. When a fault occurs, the processing strategies are executed in sequence according to the principle of maximum benefit to achieve fault self-recovery, thereby solving the problem that the energy controller software has no self-checking and self-recovery method in the business dimension.

[0176] In a certain embodiment, the specific processing process is as follows:

[0177] The microservices in the system are identified through call chain tracing technology, and then a local fault matrix is ​​built for each microservice based on the pre-built fault feature library and processing strategy library. The fault feature library contains feature descriptions of various faults, such as "meter data collection timeout", "demand response instruction failure", etc.; the processing strategy library contains various processing measures, such as "re-issuing instructions" and "switching to backup channels".

[0178] Next, analyze the system's call relationships, resource dependencies, and data flows, and build a microservice dependency graph. For example, the electricity price optimization service depends on the electricity data provided by the meter data collection service, and the demand response service depends on the calculation results of the electricity price optimization service. Based on the service dependency graph, you can infer the propagation path of the fault between microservices. For example, if the meter data collection service fails, it may cause errors in the calculation results of the electricity price optimization service, which in turn affects the demand response service.

[0179] On this basis, a global fault matrix can be constructed, which comprehensively considers the local fault matrix and fault propagation between services, and finally forms a distributed fault matrix. The distributed fault matrix covers the local status of each microservice and the mutual influence between them.

[0180] For each fault in the matrix, a qualitative and quantitative evaluation is performed from three dimensions: severity, scope of impact, and frequency of occurrence. For example, the severity of a meter data collection timeout may be low, and the scope of impact is limited to the service, but the frequency of occurrence may be high. Similarly, each handling strategy is evaluated for effectiveness, side effects, and execution cost.

[0181] Based on the above evaluation results, the weight value of each element in the fault matrix can be calculated (S24). The calculation formula of the weight value can be:

[0182] Weight = severity × impact × frequency of occurrence ÷ (effectiveness × (1-side effects) × (1-implementation cost)).

[0183] Finally, according to the preset weight threshold, the weighted fault matrix is ​​converted into a Boolean matrix. The Boolean matrix can more clearly indicate whether the corresponding processing strategy should be adopted in the current state.

[0184] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.

Claims

1. A method for self-detection and self-recovery of energy controller software faults, It is characterized in that The steps include: S1. Collect historical operation data of energy controller software, and build fault feature library and processing strategy library based on the historical operation data; S2. According to the mapping relationship between faults and processing strategies, a fault matrix is ​​constructed based on the fault feature library and the processing strategy library; S3, loop detection of each feature in the fault feature library to see if it holds true, and forming a fault indication vector based on the loop detection result and the fault matrix; S4. Perform matrix multiplication on the fault indication vector and the fault matrix to calculate and obtain a row vector, which represents the benefits of each processing strategy. According to the order of benefits, the processing strategies in the processing strategy library are executed in sequence; the benefit means that when a processing strategy solves multiple faults, the more faults solved by the processing strategy, the higher the benefit; Step S3 is further as follows: S31. Build a P2P communication network based on energy controller nodes, using a distributed consistency protocol; S32, obtaining status information of the energy controller node, analyzing the spatiotemporal correlation of the status information, and detecting whether the fault is propagated in the P2P communication network based on the spatiotemporal correlation; S33. Based on the detection results, the multi-node collaborative working method and cross-validation method are used to determine the fault location and fault cause; S34. Form a fault indication vector based on the fault location and the fault matrix.

2. The method for self-detection and self-recovery of energy controller software faults according to claim 1, It is characterized in that Step S1 is further as follows: S11. Collect historical operation data of the energy controller software and pre-process it to remove noise and abnormal values; the historical operation data includes system logs, performance indicators, fault records and processing methods; S12, extracting features from the preprocessed historical operation data, and constructing a training set and a test set based on the extracted features; S13. Build a machine learning model, use the training set to train the machine learning model, and use the test set to evaluate the performance of the trained machine learning model; S14. Use the trained machine learning model to analyze the operating data of the energy controller software in real time, automatically identify fault characteristics, and provide processing strategies; S15. Summarize the fault features to form a fault feature library, and summarize the processing strategies to form a processing strategy library.

3. The method for self-detection and self-recovery of energy controller software faults according to claim 2, It is characterized in that Step S2 is further as follows: S21, analyzing the relationship between faults and processing strategies, and constructing a fault matrix based on the fault feature library and the processing strategy library; wherein 1 in the row vector represents an available processing strategy for a certain fault, and 1 in the column vector represents a fault to which a certain processing strategy is applicable; S22. Conduct qualitative and quantitative evaluation on the severity, impact scope and occurrence frequency of each fault in the fault signature library; S23. Qualitatively and quantitatively evaluate the effectiveness, side effects, and implementation costs of each treatment strategy in the treatment strategy library; S24, based on the evaluation results of the faults and processing strategies, calculating the weight value of each element in the fault matrix to form a weighted fault matrix; S25. According to a preset weight threshold, the weighted fault matrix is ​​converted into a Boolean matrix.

4. The method for self-detection and self-recovery of energy controller software faults according to claim 3, It is characterized in that Step S4 is further as follows: S41, based on the fault indication vector and the fault matrix, calculate and obtain the benefits of each processing strategy; S42, construct a multi-objective evaluation function, encode various combinations of processing strategies into a solution space, and generate an initial feasible solution through heuristic rules; S43. Based on the initial feasible solution, an evolutionary algorithm is used to find the Pareto optimal solution set in the solution space through selection, crossover and mutation operations; S44. Based on the order of benefits, select the optimal processing strategy from the Pareto optimal solution set.

5. The method for self-detection and self-recovery of energy controller software faults according to claim 4, It is characterized in that Step S1 also includes optimizing the fault feature library and the processing strategy library, specifically: S1a, collects multi-source heterogeneous data from energy controllers, including application logs, system indicators, network traffic, and call chains; S1b, preprocess the multi-source heterogeneous data, including time-space alignment, format conversion and semantic mapping, and build a unified fault feature space based on the preprocessed multi-source heterogeneous data; S1c, in the fault feature space, extract key fault features, including abnormal indicators, error log keywords and abnormal call patterns; S1d, use statistical and machine learning methods to detect anomalies of key features; S1e, based on the results of anomaly detection, feature correlation analysis and timing analysis techniques are used to infer the root cause of the fault and provide corresponding processing strategies; S1f. Add key fault features to the fault feature library, and add corresponding processing strategies to the processing strategy library.

6. The method for self-detection and self-recovery of energy controller software faults according to claim 4, It is characterized in that Step S21 is further as follows: S211,Use call chain tracing technology to identify microservices in energy controller software; S212. Based on the fault feature library and the processing strategy library, a local fault matrix is ​​constructed for each microservice. S213, obtaining the call relationship, resource dependency and data flow of the energy controller, and constructing a microservice dependency graph; S214. Based on the service dependency graph, reason about the propagation path of the fault between microservices; S215, constructing a global fault matrix based on the propagation path, the fault feature library and the processing strategy library; S216. Form a distributed fault matrix based on the local fault matrix and the global fault matrix.

7. The method for self-detection and self-recovery of energy controller software faults according to claim 4, It is characterized in that Step S15 also includes adding potential fault features to the fault feature library, specifically: S15a, collecting historical operation data of the energy controller, including time series data of various indicators; S15b, preprocessing the historical operation data, including time alignment, missing value processing and normalization operations, to generate a time series for modeling; S15c, extracting statistical and morphological features from the time series through time domain analysis, frequency domain analysis and signal processing techniques; S15d. Based on statistical features and morphological features, a deep learning model for time series prediction is constructed, and the deep learning model is trained using historical operation data; S15e. Use the trained deep learning model to obtain potential fault features, and add the potential fault features to the fault feature library.

8. The method for self-detection and self-recovery of energy controller software faults according to claim 4, It is characterized in that Also includes: S5. Use knowledge graph technology to build a business-system-resource multi-level entity relationship graph of the energy controller. Based on the results of the cycle detection, use the business-system-resource multi-level entity relationship graph to trace the root cause of the fault; specifically: S51. Construct the energy controller domain ontology and define the core concepts, attributes and relationships in the energy controller domain; S52, collecting historical operation data of the energy controller, and extracting entities from the historical operation data based on the energy controller domain ontology, including hardware, software, services, indicators, and faults; S53, based on the extracted entities, rule matching and statistical learning methods are used to extract semantic relationships between entities from historical operation data, including inclusion, dependency and influence; S54, using ontology matching, knowledge alignment and instance linking technology to integrate entities and semantic relationships to form a multi-level entity relationship graph of business-system-resources; S55. Based on the results of loop detection and the business-system-resource multi-level entity relationship graph, graph traversal and shortest path search algorithm are used to trace the fault propagation path and locate the root cause of the fault.

9. A system for self-detection and self-recovery of energy controller software faults. It is characterized in that include: at least one processor; as well as a memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the method for self-detection and self-recovery of energy controller software faults as described in any one of claims 1 to 8.