Power distribution network fault real-time feature library design method and system
By designing a real-time feature library in the distribution network and using the Redis protocol and machine learning algorithm, the problem of untimely response to faults in traditional distribution network management is solved, intelligent and real-time fault management is achieved, and the stability and stability of the power system are improved. Response efficiency.
Patent Information
- Application Number
- CN202410568873.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-09-24
AI Technical Summary
Traditional distribution network management is difficult to achieve timely response to faults in the context of big data, threatening the reliability and stability of the power system.
A real-time feature library of distribution network faults is designed. The fault-time electrical data in the sensor is written into the nested key value space through the Redis protocol, and compared with the preset fault identification feature data. If consistent, it is stored in the library. If they are inconsistent, manual annotation and updating will be performed, and machine learning algorithms will be used to extract fault characteristics to achieve intelligent and real-time fault management.
It improves the efficiency of distribution network fault response, realizes intelligent and real-time fault characteristic management, enhances the stability and reliability of distribution network, and supports more accurate fault prediction and optimized management.
Smart Images

Figure CN118688562A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distribution network fault real-time feature library design, and in particular to a distribution network fault real-time feature library design method and system. Background Art
[0002] With the continuous development of power system technology, distribution networks are becoming more intelligent and complex.
[0003] Smart distribution grids tend to develop in a modular way, which leads to a continuous increase in the amount and type of data of relevant information.
[0004] In this big data context, traditional distribution network management faces the challenge of untimely response to faults, which threatens the reliability and stability of the power system.
[0005] Non-relational databases have demonstrated outstanding scalability, flexibility, and high performance, and are particularly adaptable when processing large-scale and complex data types of information.
[0006] In particular, Redis, with its efficient read and write performance, real-time data update function, and support for distributed computing and fault handling, perfectly meets the big data processing requirements of modern smart distribution networks.
[0007] Therefore, the present invention provides an innovative solution, which uses Redis to implement an efficient and real-time feature library for collecting, storing and processing distribution network fault features. Summary of the invention
[0008] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.
[0009] In view of the above existing problems, the present invention is proposed.
[0010] Therefore, the present invention provides a method and system for designing a real-time feature library of distribution network faults, which can solve the problems mentioned in the background technology.
[0011] In order to solve the above technical problems, the present invention provides the following technical solutions, a method for designing a real-time feature library of distribution network faults, comprising:
[0012] Establishing a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data;
[0013] The electrical data at the time of the fault in the sensor is written into the corresponding key value space in the nested key value space of the real-time feature library of the distribution network fault by using the Redis protocol, and the electrical data at the time of the fault is compared with the preset fault identification feature data;
[0014] If the electrical data at the time of the fault is consistent with any preset fault identification feature data, the electrical data at the time of the fault is stored in the nested key value space of the distribution network fault real-time feature library;
[0015] If the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, the electrical data at the time of the fault is manually labeled, and the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library to complete the establishment of the distribution network fault real-time feature library.
[0016] As a preferred solution of the method for designing a real-time feature library for distribution network faults described in the present invention, it also includes:
[0017] After the manual labeling of the electrical data at the time of the fault is completed, the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library, and at the same time, the data of several Redis databases within a preset fixed time are integrated into the permanent database, and the temporary key is deleted, thereby completing the establishment of the distribution network fault real-time feature library, and the temporary key includes the key established when the fault occurs;
[0018] After updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the fault features of the updated nested key value space data of the distribution network fault real-time feature library are extracted in combination with the machine learning algorithm, and the fault identification feature data is updated and stored in the nested key value space.
[0019] As a preferred solution of the method for designing a real-time feature library of distribution network faults described in the present invention, wherein: the nested key value space for establishing the real-time feature library of distribution network faults also includes a first layer key value space, a second layer key value space and a third layer key value space;
[0020] The first-layer key value space is of string type, and the first-layer key value space at least includes keys of historical data, electrical data, and fault characteristics;
[0021] The second-layer key value space corresponds to the historical data key of the first-layer key value space, is used to store historical data of JSON type, and the key value space type is a list type;
[0022] The second-layer key value space also corresponds to the fault feature key of the first-layer key value space, and at least includes the keys of overload, short circuit, ground fault, voltage fluctuation, frequency change, harmonics, voltage imbalance, voltage sag or instantaneous interruption, current imbalance, and resonance, and the key value space type is a string type;
[0023] The second-layer key value space also corresponds to the electrical data key of the first-layer key value space and contains at least the keys of voltage, current and frequency, and the key value space type is a string type;
[0024] The third-layer key value space is of hash table type, and the hash table fields include at least event type, possible cause and characteristic data.
[0025] As a preferred solution of the method for designing a real-time feature library for distribution network faults of the present invention, the method of writing the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the real-time feature library for distribution network faults by adopting the Redis protocol includes:
[0026] The sensor and the Redis database are connected via TCP. The sensor initiates a connection request to the Redis server.
[0027] The sensor sends a text command that complies with the Redis protocol to the Redis server, and the command includes at least data writing, reading, and updating operations;
[0028] The sensor receives a response from the Redis server after parsing the text command sent by the sensor, and the format of the response complies with the Redis protocol;
[0029] When reading data, the sensor sends the corresponding read command, and the sensor receives the response from the Redis server according to the read command sent by the sensor;
[0030] After the communication is completed, the sensor closes the connection to the Redis server.
[0031] As a preferred solution of the method for designing a real-time feature library for distribution network faults of the present invention, the fault features of the nested key-value space data of the real-time feature library for distribution network faults extracted by combining a machine learning algorithm include:
[0032] After updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the electrical data is cleaned, standardized and feature extracted to form a preliminary fault feature library;
[0033] The fault feature library is sampled using the Bootstrap method, and a sample subset is randomly selected from the fault feature library in a method with replacement to generate a plurality of sub-data sets for training;
[0034] For each Bootstrap subset, combined with machine learning algorithms, targeted training and optimization are performed for electrical equipment fault types;
[0035] The prediction results of each base model on the newly acquired real-time electrical data are collected, and a voting mechanism is designed to obtain the final fault judgment conclusion by integrating the prediction outputs of each model;
[0036] Implement a cross-validation process to evaluate and optimize model performance. When new real-time data appears, dynamically adjust the base model weights or selectively update model parameters based on the actual prediction effect of the integrated model to ensure that the fault feature library reflects the latest fault mode in real time.
[0037] As a preferred solution of the method for designing a real-time feature library of distribution network faults described in the present invention, wherein: comparing the electrical data at the time of the fault with the preset fault identification feature data includes: broadcasting the comparison result by adopting the MQTT protocol;
[0038] On the database server side, use Mosquitto to build an MQTT Broker, which is responsible for receiving and forwarding messages, and the database server is used to generate real-time data, system notifications, and update broadcast messages;
[0039] The database server is connected to the MQTT Broker. The database server is connected to the built MQTT Broker via TCP / IP.
[0040] The database server defines a topic for broadcasting, where the topic is an identifier for publishing and subscribing to a message, and the terminal receives the broadcast message after subscribing to the corresponding topic;
[0041] The database server uses the MQTT protocol to publish broadcast messages to the corresponding topics and sends the messages to the MQTT Broker at the same time;
[0042] After receiving the message published by the database server, the MQTT Broker forwards the message to all terminals that have subscribed to the corresponding topic;
[0043] After connecting to the MQTT Broker, the terminal needs to subscribe to the broadcast topic defined by the database server;
[0044] When the terminal subscribes to the corresponding topic, it is eligible to receive the broadcast message published by the database server. After receiving the message, the terminal performs the corresponding operation.
[0045] As a preferred solution of the method for designing a real-time feature library for distribution network faults described in the present invention, it also includes:
[0046] Check whether the expired dictionary contains a target detection key. If so, obtain the key expiration time. The target detection key is used to verify whether the previous fault data is cleared.
[0047] Check whether the current system time is greater than the key expiration time. If so, the key value is considered to have expired. Otherwise, the key value is not expired.
[0048] The deletion strategy for expired keys uses a combination of lazy deletion and periodic deletion.
[0049] The lazy deletion is to first check whether the key value is expired when obtaining the key from the key space. If it is not expired, the key value is returned to continue the operation, otherwise, it is deleted;
[0050] The periodic deletion includes randomly taking a certain number of key values from a certain number of databases at regular intervals to check whether they are expired, and deleting them if they are expired.
[0051] A distribution network fault real-time feature library design system, characterized by comprising:
[0052] A space establishment module, used to establish a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space at least includes a space for storing historical data, a space for storing electrical data at the time of a fault, and a space for storing fault identification feature data;
[0053] A comparison module is used to write the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library by using the Redis protocol, and compare the fault electrical data with the preset fault identification feature data;
[0054] A first judgment module is used to judge if the electrical data at the time of the fault is consistent with any preset fault identification feature data, and then store the electrical data at the time of the fault into the nested key value space of the distribution network fault real-time feature library;
[0055] The second judgment module is used to determine if the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, then manually mark the electrical data at the time of the fault, update the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, and complete the establishment of the distribution network fault real-time feature library.
[0056] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the above method when executing the computer program.
[0057] A computer-readable storage medium stores a computer program thereon, wherein the computer program implements the steps of the method described above when executed by a processor.
[0058] Beneficial effects of the present invention: The present invention proposes a method and system for designing a real-time feature library for distribution network faults, and establishes a nested key value space for the real-time feature library for distribution network faults, wherein the nested key value space at least includes a space for storing historical data, a space for storing electrical data at the time of fault, and a space for storing fault identification feature data; the electrical data at the time of fault in the sensor is written into the corresponding key value space in the nested key value space of the real-time feature library for distribution network faults by adopting the Redis protocol, and the electrical data at the time of fault is compared with the preset fault identification feature data; if the electrical data at the time of fault is consistent with any preset fault identification feature data, the electrical data at the time of fault is stored in the nested key value space of the real-time feature library for distribution network faults; if the electrical data at the time of fault is inconsistent with any preset fault identification feature data, the electrical data at the time of fault is manually annotated, and the corresponding new preset fault identification feature data is updated to the nested key value space of the real-time feature library for distribution network faults, and the establishment of the real-time feature library for distribution network faults is completed. The present invention provides an innovative solution, realizes intelligent and real-time fault feature management, and thus improves the efficiency of distribution network fault response. The future development direction of this invention includes further utilizing the characteristics of Redis, combining artificial intelligence and machine learning technologies, to achieve more accurate fault prediction and optimize distribution network management goals. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. 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 labor. Among them:
[0060] Figure 1 A method and system for designing a real-time feature library of distribution network faults provided by an embodiment of the present invention;
[0061] Figure 2 A spatial example of a method and system for designing a real-time feature library for distribution network faults provided by an embodiment of the present invention;
[0062] Figure 3 A flow chart of a method for designing a real-time feature library of distribution network faults and system for deleting expired keys provided by an embodiment of the present invention;
[0063] Figure 4 A schematic diagram of a cache read-write strategy principle diagram of a method and system for designing a real-time feature library of distribution network faults provided by an embodiment of the present invention;
[0064] Figure 5A data flow diagram of a method and system for designing a real-time feature library for distribution network faults provided by an embodiment of the present invention;
[0065] Figure 6 An internal structural diagram of a computer device of a method and system for designing a real-time feature library for distribution network faults provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0066] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0067] Example 1
[0068] Reference Figure 1-6 , is the first embodiment of the present invention, which provides a distribution network fault real-time feature library design method and system, including a distribution network fault real-time feature library design method and a distribution network fault real-time feature library design system, wherein a distribution network fault real-time feature library design method includes:
[0069] S101, establishing a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of a fault, and a space for storing fault identification feature data;
[0070] Among them, establishing the nested key value space of the real-time feature library of distribution network faults also includes the first layer key value space, the second layer key value space and the third layer key value space;
[0071] Specifically, the first-layer key value space is of string type, and the first-layer key value space contains at least the keys of historical data, electrical data, and fault characteristics;
[0072] The second-level key-value space corresponds to the historical data key of the first-level key-value space and is used to store historical data of JSON type. The key-value space type is a list type.
[0073] The second-layer key value space also corresponds to the fault feature key of the first-layer key value space, and at least includes the keys of overload, short circuit, ground fault, voltage fluctuation, frequency change, harmonic, voltage unbalance, voltage sag or instantaneous interruption, current unbalance, and resonance, and the key value space type is a string type;
[0074] The second-layer key value space also corresponds to the electrical data key of the first-layer key value space and contains at least the keys of voltage, current, and frequency, and the key value space type is a string type;
[0075] The third-level key value space is of hash table type, and the hash table fields include at least event type, possible cause, and characteristic data.
[0076] After establishing the nested key-value space of the S101 distribution network fault real-time feature library, its efficient management and application can be further realized.
[0077] It should be noted that the first-level key value space can be regarded as a primary index, which is responsible for organizing and guiding the access of the entire nested key value space. Historical data, electrical data, and fault characteristics are clearly marked as keys, so that users can directly access the corresponding data through these keys. The second-level key value space further refines the storage of data. For the historical data key, a list of JSON type is used to store historical data, which makes it easy to add, delete, and query data. For the fault feature key, a series of possible fault types such as overload, short circuit, and ground fault are defined. These types are stored in the form of strings to facilitate rapid identification and classification of faults. For the electrical data key, the string type is also used to store key parameters such as voltage, current, and frequency. The third-level key value space provides a detailed description of the event in the form of a hash table. The fields of the hash table include event type, possible cause, and feature data. The event type is used to distinguish different power events, the possible cause is a preliminary speculation on the cause of the event, and the feature data is a specific description of the event, such as the voltage and current values when the fault occurs.
[0078] Through the design of this nested key-value space, comprehensive and efficient management of distribution network fault data can be achieved. Not only can historical data and real-time data be quickly queried, but faults can also be quickly identified and analyzed. At the same time, this design also has good scalability and can easily add new data types and fault types to adapt to the ever-changing power system environment.
[0079] S102, writing the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library by using the Redis protocol, and comparing the fault electrical data with the preset fault identification feature data;
[0080] Among them, the electrical data of the fault in the sensor is written into the nested key value space of the real-time feature library of the distribution network fault by using the Redis protocol. The corresponding key value space includes:
[0081] The sensor and the Redis database are connected via TCP. The sensor initiates a connection request to the Redis server.
[0082] Furthermore, the sensor sends text commands that comply with the Redis protocol to the Redis server, and the commands include at least data write, read, and update operations;
[0083] Furthermore, the sensor receives the response from the Redis server after parsing the text command sent by the sensor, and the format of the response complies with the Redis protocol;
[0084] It should be noted that when reading data, the sensor sends a corresponding read command, and the sensor receives a response from the Redis server according to the read command sent by the sensor;
[0085] Furthermore, after the communication is completed, the sensor closes the connection with the Redis server.
[0086] It should be noted that by using the Redis protocol to write the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library, the efficiency and real-time performance of data processing can be greatly improved. As a high-performance key-value storage protocol, the Redis protocol has the advantages of fast response, high concurrency, and persistence, and is very suitable for processing large amounts of real-time sensor data. In the fault identification process, by comparing with the preset fault identification feature data, it is possible to accurately determine whether a fault occurs in the distribution network, and take corresponding measures to repair it in a timely manner. This can not only improve the stability and reliability of the distribution network, but also avoid adverse effects such as power outages caused by faults, and improve the user's power experience.
[0087] In addition, establishing a connection through TCP can ensure the stability and reliability of data transmission between the sensor and the Redis database. The sensor can write, read, and update data by sending text commands that comply with the Redis protocol to the Redis server, making data processing more flexible and convenient.
[0088] At the same time, the sensor receives the response from the Redis server after parsing the text command sent by the sensor, which can ensure the correctness and consistency of the data. When reading data, the sensor sends the corresponding read command and receives the response from the Redis server according to the read command sent by the sensor, thereby obtaining the latest data.
[0089] After the communication is completed, the sensor closes the connection with the Redis server, which can release resources and reduce the system load. At the same time, it can also ensure the security of the system and avoid security risks that may be caused by long-term connection.
[0090] In summary, the use of the Redis protocol to write the fault electrical data in the sensor into the corresponding key-value space in the nested key-value space of the distribution network fault real-time feature library can bring many beneficial effects, including improving data processing efficiency, improving the stability and reliability of the distribution network, improving the user's electricity experience, ensuring the stability and reliability of data transmission, realizing flexible data processing, ensuring data correctness and consistency, releasing resources to reduce system load, and ensuring system security.
[0091] S103, if the electrical data at the time of the fault is consistent with any preset fault identification feature data, the electrical data at the time of the fault is stored in the nested key value space of the distribution network fault real-time feature library;
[0092] S104, if the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, the electrical data at the time of the fault is manually labeled, and the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library to complete the establishment of the distribution network fault real-time feature library.
[0093] It should be noted that after the manual labeling of the electrical data at the time of the fault is completed, the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library, and at the same time, the data of several Redis databases within a preset fixed time are integrated into the permanent database, and the temporary key is deleted, thereby completing the establishment of the distribution network fault real-time feature library, and the temporary key includes the key established when the fault occurs;
[0094] It should be noted that after updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the machine learning algorithm is used to extract the fault characteristics of the updated distribution network fault real-time feature library nested key value space data, and the fault identification feature data is updated and stored in the nested key value space.
[0095] Among them, the fault features of the nested key-value space data of the updated distribution network fault real-time feature library extracted by combining machine learning algorithms include:
[0096] After updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the electrical data is cleaned, standardized and feature extracted to form a preliminary fault feature library;
[0097] The Bootstrap method is used to sample the fault feature library, and a sample subset is randomly selected from the fault feature library with replacement to generate multiple sub-datasets for training;
[0098] For each Bootstrap subset, combined with machine learning algorithms, targeted training and optimization are performed for electrical equipment fault types;
[0099] The prediction results of each base model on the newly acquired real-time electrical data are collected, and a voting mechanism is designed to obtain the final fault judgment conclusion by integrating the prediction outputs of each model;
[0100] Implement a cross-validation process to evaluate and optimize model performance. When new real-time data appears, dynamically adjust the base model weights or selectively update model parameters based on the actual prediction effect of the integrated model to ensure that the fault feature library reflects the latest fault mode in real time.
[0101] In an optional embodiment, the following specific operation steps may be used to perform feature extraction:
[0102] Step 1: Feature library update and preprocessing
[0103] Data cleaning: Use data quality rules to filter invalid, duplicate or outlier values.
[0104] standardization:
[0105] Min-Max Scaling:
[0106]
[0107] Or Z-score normalization:
[0108]
[0109] Here, x is the original data value, μ is the mean of the data set, and σ is the standard deviation.
[0110] When the implementation focuses on the relative proportions between features and maintaining the boundary information of the original data, the minimum and maximum scaling is selected.
[0111] If the goal is to eliminate feature scale differences and make the data conform to a standard normal distribution, and the algorithm is sensitive to the center position and discreteness of the data distribution, then Z-score standardization is used.
[0112] Step 2: Bootstrap Sampling
[0113] From the fault signature library D i A sample set of size N is extracted with replacement to construct a training subset D i , where the probability of each draw is independent and equal.
[0114] Step 3: Base model training
[0115] For each Bootstrap subset D i . Train a model M j, such as logistic regression, support vector machine or neural network, whose loss function L(θ,D i ) needs to be minimized, e.g.
[0116] Among them, for logistic regression is the cross entropy loss:
[0117]
[0118] Among them, h θ (x) is the model’s predicted probability for input x, and θ is the model parameter.
[0119] Step 4: Prediction result integration
[0120] Assume that for a new real-time data point x t , base model M j The output class probability vector is p j (x t ), then a weighted voting mechanism can be used to obtain the final category:
[0121]
[0122] Where J is the number of base models. jc (x t ) indicates that the jth model predicts x t The probability of belonging to category c, w j is the model weight, t j is a threshold.
[0123] Step 5: Cross-validation and model tuning
[0124] K-fold cross validation was used to evaluate the model performance and calculate the generalization error of each base model and the ensemble model.
[0125] Update model weights w j Based on metrics such as AUC, F1 score, precision or recall, the optimization algorithm dynamically adjusts:
[0126]
[0127] in, is the evaluation function on the validation set, is the validation data in the k-fold cross validation.
[0128] When new real-time data flows in, model parameters can be updated using online learning techniques or regular retraining based on the actual prediction effect of the integrated model to ensure that the model can adapt to the latest failure modes.
[0129] When the average error of the model in K-fold cross validation is lower than the pre-set minimum acceptable error threshold, it means that the current model performance is already quite good and has a high degree of fit to the training data. At this point, there is no need to make major adjustments to the model parameters. You can maintain the existing settings and consider making some fine-tuning work on the generalization ability of the model, such as fine-tuning the learning rate, regularization coefficient, etc., or exploring methods such as feature selection and dimensionality reduction to further improve model performance.
[0130] When the average error of the model exceeds the preset maximum acceptable error threshold, it indicates that the model may be too complex or too simple, resulting in insufficient learning or overfitting of the training data. In this regard, it is necessary to re-examine and adjust the model parameters, such as reducing the learning rate to increase the training time, increasing the regularization strength to prevent overfitting, changing the model structure or adding more layers to meet the complexity requirements, or even considering replacing other model algorithms that are more suitable for the problem.
[0131] When the average error of the model is within the two preset threshold intervals, it means that the model performance is acceptable but there is still room for improvement. At this time, it is recommended to adopt a more detailed parameter adjustment strategy, including but not limited to gradually adjusting the hyperparameter range, trying different optimizers, increasing the data set size or sampling strategy, etc., in an effort to find a balance point that can both fit the training data well and effectively avoid overfitting. At the same time, ensemble learning technology can also be used as an alternative solution to improve model performance.
[0132] Furthermore, comparing the electrical data at the time of the fault with the preset fault identification characteristic data includes: broadcasting the comparison result by adopting the MQTT protocol;
[0133] On the database server side, use Mosquitto to build an MQTT Broker, which is responsible for receiving and forwarding messages. The database server is used to generate real-time data, system notifications, and update broadcast messages.
[0134] The database server is connected to the MQTT Broker. The database server is connected to the built MQTT Broker via TCP / IP.
[0135] The database server defines the topic for broadcasting. The topic is the identifier of message publishing and subscription. The terminal receives the broadcast message after subscribing to the corresponding topic.
[0136] The database server uses the MQTT protocol to publish broadcast messages to the corresponding topics and sends the messages to the MQTT Broker at the same time;
[0137] After receiving the message published by the database server, the MQTT Broker forwards the message to all terminals that have subscribed to the corresponding topic;
[0138] After connecting to the MQTT Broker, the terminal needs to subscribe to the broadcast topic defined by the database server;
[0139] When the terminal subscribes to the corresponding topic, it is eligible to receive the broadcast message published by the database server. After receiving the message, the terminal performs the corresponding operation.
[0140] It should be noted that by adopting the above method, efficient and accurate identification and processing of distribution network faults can be achieved. Specifically, in step S104, when the electrical data at the time of the fault is inconsistent with the preset fault identification feature data, the electrical data at the time of the fault is manually labeled and updated to the real-time feature library of distribution network faults, so that the feature library can continuously learn and adapt to new fault modes. At the same time, the updated feature library is combined with a machine learning algorithm to extract and identify fault features, thereby improving the accuracy and real-time performance of fault judgment.
[0141] In addition, by using the MQTT protocol for broadcasting, real-time communication between the database server and the terminal is achieved. The database server publishes the broadcast message to the corresponding topic, and the MQTT Broker is responsible for forwarding these messages to all terminals that have subscribed to the topic, so that the terminals can receive fault information in time and perform corresponding operations. This communication method is efficient and reliable, and can meet the real-time requirements of distribution network fault processing.
[0142] In summary, this method improves the efficiency and accuracy of distribution network fault handling by continuously updating the real-time feature library of distribution network faults and using machine learning algorithms to extract and identify fault features, combined with the MQTT protocol to achieve real-time communication. At the same time, this method also has good scalability and flexibility, and can adapt to distribution network systems of different types and sizes. Therefore, this method has broad application prospects and important practical value in the field of distribution network fault handling.
[0143] Furthermore, the expired dictionary is checked to see if there is a target detection key. If so, the expiration time of the key is obtained. The target detection key is used to verify whether the previous fault data is cleared.
[0144] Check whether the current system time is greater than the key expiration time. If so, the key value is considered to have expired. Otherwise, the key value is not expired.
[0145] The deletion strategy for expired keys uses a combination of lazy deletion and periodic deletion.
[0146] Lazy deletion is to check whether the key value is expired when getting the key from the key space. If it is not expired, the key value is returned to continue the operation. Otherwise, it is deleted.
[0147] Periodic deletion involves randomly taking a certain number of key values from a certain number of databases at regular intervals to check whether they are expired, and deleting them if they are expired.
[0148] In summary, the present invention proposes a method for designing a real-time feature library for distribution network faults, establishing a nested key value space for the real-time feature library for distribution network faults, wherein the nested key value space at least includes a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data; the electrical data at the time of faults in the sensor is written into the corresponding key value space in the nested key value space of the real-time feature library for distribution network faults by adopting the Redis protocol, and the electrical data at the time of faults is compared with the preset fault identification feature data; if the electrical data at the time of faults is consistent with any preset fault identification feature data, the electrical data at the time of faults is stored in the nested key value space of the real-time feature library for distribution network faults; if the electrical data at the time of faults is inconsistent with any preset fault identification feature data, the electrical data at the time of faults is manually labeled, and the corresponding preset fault identification feature data is updated to the nested key value space of the real-time feature library for distribution network faults, and the establishment of the real-time feature library for distribution network faults is completed. The present invention provides an innovative solution, realizes intelligent and real-time fault feature management, and thus improves the efficiency of distribution network fault response. The future development direction of this invention includes further utilizing the characteristics of Redis, combining artificial intelligence and machine learning technologies, to achieve more accurate fault prediction and optimize distribution network management goals.
[0149] In a preferred embodiment, a distribution network fault real-time feature library design system includes:
[0150] A space establishment module is used to establish a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data;
[0151] A comparison module is used to write the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library by using the Redis protocol, and compare the fault electrical data with the preset fault identification feature data;
[0152] A first judgment module is used to judge if the electrical data at the time of the fault is consistent with any preset fault identification feature data, and then store the electrical data at the time of the fault into the nested key value space of the distribution network fault real-time feature library;
[0153] The second judgment module is used to determine if the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, then manually mark the electrical data at the time of the fault, update the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, and complete the establishment of the distribution network fault real-time feature library.
[0154] The above-mentioned unit modules may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to the above-mentioned modules.
[0155] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for designing a real-time feature library of distribution network faults is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0156] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0157] Establishing a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data;
[0158] The electrical data at the time of the fault in the sensor is written into the corresponding key value space in the nested key value space of the real-time feature library of the distribution network fault by using the Redis protocol, and the electrical data at the time of the fault is compared with the preset fault identification feature data;
[0159] If the electrical data at the time of the fault is consistent with any preset fault identification feature data, the electrical data at the time of the fault is stored in the nested key value space of the distribution network fault real-time feature library;
[0160] If the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, the electrical data at the time of the fault is manually labeled, and the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library to complete the establishment of the distribution network fault real-time feature library.
[0161] Example 2
[0162] Reference Figure 1-6 , which is an embodiment of the present invention, provides a method and system for designing a real-time feature library for distribution network faults. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through comparative experiments.
[0163] In the embodiment of the present application, a real-time feature library is designed, the core component of which is a Redis database (D a ), used to store distribution network fault characteristic data.
[0164] Da also has a real-time data storage and update mechanism to ensure efficient data writing, reading and real-time updating.
[0165] In addition, the present invention also includes a modular intelligent power distribution terminal M i , can collect distribution network fault characteristic data in real time and send these data to D a .
[0166] The solution also includes a real-time notification system that provides real-time information about fault characteristics to other departments to enable rapid response to distribution network faults.
[0167] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0168] D a The design steps are as follows:
[0169] (1) Establishing nested key value spaces of string and hash table types for several Redis databases to store temporary electrical data and characteristic data for fault identification;
[0170] (2) When a fault occurs, the modular intelligent power distribution terminal uses the Redis protocol to write the electrical data in the sensor into the corresponding key value space of the database;
[0171] (3) Using electrical data in the server to compare the fault characteristics in the database to determine the fault that occurred;
[0172] (4) After the judgment is completed, the MQTT protocol is used to broadcast to the relevant terminals so that they can perform corresponding actions;
[0173] (5) After troubleshooting, manually mark the specific information of the fault to ensure that standard fault data is obtained;
[0174] (6) After the marking is completed, the data of several Redis databases are integrated into the permanent database within a certain period of time, and the temporary keys are deleted to ensure that the storage of the Redis database in the key value space is more flexible;
[0175] (7) Use data from a permanent database for machine learning to extract fault features and update identification methods;
[0176] (8) Regularly update the Redis database based on the permanent database.
[0177] D a For keyspace examples, see Figure 2 , the design steps are as follows:
[0178] The first-level key-value space is of string type, and contains the following keys: historical records, fault characteristics, and electrical data, etc.
[0179] The second-level key-value space "historical data" is a list type. Each historical data can be a string in JSON format, including a timestamp and other related information, for example:
[0180] {
[0181] “time”: “2023-10-20 15:30:00”;
[0182] "EventType": "Overload";
[0183] "Description": "Equipment overload, current overload.";
[0184] "Site": "xx substation";
[0185] "Degree of harm": "Medium".
[0186] }
[0187] Another example of a structure for storing historical fault feature data and supporting time series data storage is as follows:
[0188] {
[0189] Key: History data key, for example "Fault History".
[0190] Value: Use the "LPUSH" command to add new history data to the front of the list.
[0191] }
[0192] The second-level key value space "fault characteristics" is a string type, and the keys included are: overload, short circuit, ground fault, voltage fluctuation, frequency change, harmonics, voltage imbalance, voltage sag or momentary interruption, current imbalance, resonance, etc.
[0193] The second-level key value space "Electrical Data" is of string type, and contains the following keys: voltage, current, frequency, etc.
[0194] The third-layer key value space is a hash table type, and the hash table fields include: event type, possible cause, and feature data, etc. The specific structure is as follows:
[0195] Key: A unique identifier for each fault
[0196] Fields and values: Stores basic information about the fault, such as:
[0197] "Event Type": fault type, stored as a string value.
[0198] "Possible Reasons": Possible reasons, stored as a string list.
[0199] "Feature data": eigenvalues used for comparison, storing a feature matrix
[0200] The above structure allows the basic information and historical data of faults to be stored separately, and supports time series data storage.
[0201] At the same time, basic information can be retrieved based on the unique identifier of the fault type, and historical fault feature data can be retrieved in chronological order using an ordered set.
[0202] This structure allows fault signature data to be efficiently organized and queried.
[0203] M i The steps to write the electrical data in the sensor into the corresponding key value space of the database using the Redis protocol are as follows:
[0204] (1) Establishing a connection: A connection is established between the terminal sensor and the Redis database via TCP. The sensor acts as a client and initiates a connection request to the Redis server.
[0205] (2) Sending commands: The sensor sends text commands that comply with the Redis protocol to the Redis server. These commands can include operations such as writing, reading, and updating data;
[0206] (3) Command processing: After receiving the command sent by the sensor, the Redis server parses the command and performs the corresponding operation;
[0207] (4) Return response: After the Redis server executes the command, it will send a corresponding response to the sensor. The format of the response complies with the Redis protocol;
[0208] (5) Data reading: When reading data, you can send a corresponding read command;
[0209] (6) Processing the read command: After receiving the read command, the Redis server performs the corresponding operation and returns the result to the sensor;
[0210] (7) Close the connection: After the communication is completed, the sensor needs to close the connection with the Redis server to release resources.
[0211] In the Redis server, the integrated learning algorithm Bagging (Bootstrap Aggregating) is used, integrating decision tree, random forest, K nearest neighbor and other models. The server uses electrical data to compare the fault characteristics in the database to judge the fault, and cross-validates the prediction results. Finally, the voting method is used to determine the prediction results. The main steps of Bagging are as follows:
[0212] (1) Bootstrap sampling: Use a sampling method with replacement to randomly select several samples from the original training set to form a new data subset;
[0213] (2) Base model training: Use each Bootstrap subset to train a basic learner (base model), including but not limited to decision tree, random forest, and K nearest neighbor;
[0214] (3) Integrated model construction: The prediction results of all base models are integrated by voting.
[0215] The steps to use the MQTT protocol to broadcast to relevant terminals in the Redis server are as follows:
[0216] (1) Build an MQTT Broker: On the Redis server side, use Mosquitto to build an MQTT Broker (proxy server). The MQTT Broker is responsible for receiving and forwarding messages;
[0217] (2) Redis server connects to MQTT Broker: Connect the database server to the established MQTT Broker through TCP / IP;
[0218] (3) Define Topic: Define the topic for broadcasting through the server. The topic is the identifier for publishing and subscribing messages. The terminal needs to subscribe to the corresponding topic to receive broadcast messages.
[0219] (4) Generation of broadcast messages: The database server generates messages to be broadcast, such as real-time data, system notifications, and updates;
[0220] (5) MQTT protocol publishing: The database server uses the MQTT protocol to publish broadcast messages to the corresponding topics. When publishing a message, it will send the message to the MQTT Broker;
[0221] (6) MQTT Broker forwarding: After receiving the message published by the server, the MQTT Broker will forward the message to all terminals that have subscribed to the corresponding topic;
[0222] (7) Terminal subscription: After connecting to the MQTT Broker, the terminal needs to subscribe to the broadcast topic defined by the server;
[0223] (8) Terminal receiving messages: When a terminal subscribes to a corresponding topic, it can receive broadcast messages published by the database server. After receiving the message, the terminal can perform corresponding operations, such as alarming, starting related protection actions, etc.
[0224] After the fault handling is completed, the specific information of the fault is manually labeled. The main content is to check the "event type" in the hash table field in each key space in the "fault characteristics" and supplement the "possible cause".
[0225] At the same time, in order to maintain the high performance operation of the Redis database, the present invention saves the expiration time of all keys in the database into an expiration dictionary named "expires", whose structure is:
[0226] {
[0227] Key: The key is designed as a pointer to the key object in the key space. In this design, the keys of the key space and the expired dictionary point to the same object, which does not cause memory waste.
[0228] Value: Save the millisecond precision timestamp as a long integer, which is the expiration time of this key
[0229] }.
[0230] There are two steps to determine whether a key in the database has expired:
[0231] (1) Check whether the specified key exists in the expired dictionary. If so, get the expiration time of the key.
[0232] (2) Check whether the current system time is greater than the key expiration time. If so, the key has expired. Otherwise, the key value has not expired.
[0233] The deletion strategy for expired keys uses a combination of lazy deletion and periodic deletion.
[0234] Among them, lazy deletion is to check whether the key value is expired when getting the key from the key space. If it is not expired, the key value is returned to continue the operation. Otherwise, it is deleted.
[0235] At the same time, a certain number of key values are randomly taken from a certain number of databases at regular intervals to check whether they are expired. If they are expired, they are deleted. This is periodic deletion.
[0236] For the process of deleting expired keys, please refer to Figure 3 .
[0237] Within the specified time, the Redis database will transfer the fault data back to the permanent database for data persistence. The present invention adopts RDB and AOF hybrid persistence.
[0238] Among them, RDB mirroring is used for full persistence, and AOF is used for incremental persistence.
[0239] D a RDB will be used for snapshot storage first, and then AOF will be used to persist and record all write operations.
[0240] When the rewrite policy is met or the rewrite is manually triggered, the latest data is stored as a new RDB record.
[0241] At this time, when the service is restarted, data will be restored from both RDB and AOF, which not only ensures data integrity but also improves data recovery performance.
[0242] D a Redis's built-in cache read and write strategy is used. For the principle of cache read and write strategy, please refer to Figure 4 .
[0243] Among them, the write strategy is to update the new data into D a Then delete the cache.
[0244] The read strategy is to return the data after reading it from the cache. If the cache does not hit, it will directly read it from D a After reading the data, return and then put the data into the cache.
[0245] The present invention adopts a bypass cache mode and applies a timeout elimination strategy.
[0246] When the cached data expires, D a It will be automatically deleted. This strategy can update the cache according to the data validity period, and the update logic will be triggered when the cache is accessed next time.
[0247] If expired, aUpdate new data in the process, otherwise retrieve data normally.
[0248] The strategy adopted by the present invention can take into account the real-time nature of the cache and the large number of accesses by setting appropriate expiration events. a The pressure of time.
[0249] The present invention adds Bloom filtering to prevent the occurrence of cache penetration. It uses a huge binary array and hashing to determine whether the requested data exists. If the Bloom filter determines that it exists, it will be released and the request will access D a , otherwise reject.
[0250] The present invention avoids the cache avalanche problem by adding random values to the TTLs of different keys.
[0251] The present invention uses a lock to solve the problem of cache breakdown, and adopts a tryLock method and a double check to solve the problem of query performance degradation caused by the lock.
[0252] The present invention considers the need to process large-scale data or high concurrent access, and uses the cluster mode of Redis to complete D a Distributed deployment achieves high availability and high performance through sharding and multi-node collaboration.
[0253] In order to solve the problem of data fragmentation in distributed systems, the present invention adopts the consistent Hash algorithm built into Redis.
[0254] The algorithm maps data to a fixed interval, and each node and the hash value of each data are mapped to this interval, and the data is assigned to the node closest to it.
[0255] If a node goes down, the data on that node will be assigned to the next node.
[0256] This distributed solution perfectly matches the modular intelligent power distribution terminal M i Functions such as uploading data, sharing data, collaborative work and distributed computing.
[0257] In the present invention, i It has real-time fault characteristic data collection, including monitoring changes in distribution network parameters such as current, voltage, and frequency to obtain fault characteristic data.
[0258] At the same time, in M i The edge performs real-time data processing, including preprocessing steps such as data cleaning, data normalization, and anomaly detection, to ensure data accuracy and consistency and reduce D a pressure.
[0259] In addition, M iRealize real-time data update and notification mechanism to ensure D a The data in the system is kept updated in real time, and real-time data notifications are provided to other departments through publish and subscribe commands to support rapid response.
[0260] For a data flow diagram, see Figure 5 .
[0261] The present invention uses the data in the permanent database to train the Bagging model and regularly returns the feature matrix to the Redis database for identifying fault features.
[0262] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
[0263] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt 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.) that contain computer-usable program code. The scheme in the embodiments of the present application can be implemented in various computer languages, for example, object-oriented programming language Java and literal scripting language JavaScript, etc.
[0264] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 generate 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.
[0265] 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.
[0266] 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 The steps for the functions specified in one or more boxes.
[0267] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0268] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for designing a real-time feature library for distribution network faults. It is characterized in that include: Establishing a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data; The electrical data at the time of the fault in the sensor is written into the corresponding key value space in the nested key value space of the real-time feature library of the distribution network fault by using the Redis protocol, and the electrical data at the time of the fault is compared with the preset fault identification feature data; If the electrical data at the time of the fault is consistent with any preset fault identification feature data, the electrical data at the time of the fault is stored in the nested key value space of the distribution network fault real-time feature library; If the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, the electrical data at the time of the fault is manually labeled, and the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library to complete the establishment of the distribution network fault real-time feature library.
2. The method for designing a real-time feature library for distribution network faults according to claim 1, It is characterized in that Also includes: After the manual labeling of the electrical data at the time of the fault is completed, the corresponding new preset fault identification feature data is updated to the nested key value space of the distribution network fault real-time feature library, and at the same time, the data of several Redis databases within a preset fixed time are integrated into the permanent database, and the temporary key is deleted, thereby completing the establishment of the distribution network fault real-time feature library, and the temporary key includes the key established when the fault occurs; After updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the fault features of the updated nested key value space data of the distribution network fault real-time feature library are extracted in combination with the machine learning algorithm, and the fault identification feature data is updated and stored in the nested key value space.
3. The method for designing a real-time feature library for distribution network faults according to claim 2, It is characterized in that The nested key value space of establishing the real-time feature library of distribution network faults also includes a first layer key value space, a second layer key value space and a third layer key value space; The first-layer key value space is of string type, and the first-layer key value space at least includes keys of historical data, electrical data, and fault characteristics; The second-layer key value space corresponds to the historical data key of the first-layer key value space, is used to store historical data of JSON type, and the key value space type is a list type; The second-layer key value space also corresponds to the fault feature key of the first-layer key value space, and at least includes the keys of overload, short circuit, ground fault, voltage fluctuation, frequency change, harmonics, voltage imbalance, voltage sag or instantaneous interruption, current imbalance, and resonance, and the key value space type is a string type; The second-layer key value space also corresponds to the electrical data key of the first-layer key value space and contains at least the keys of voltage, current and frequency, and the key value space type is a string type; The third-layer key value space is of hash table type, and the hash table fields include at least event type, possible cause and characteristic data.
4. The method for designing a real-time feature library for distribution network faults according to claim 3, It is characterized in that The method of writing the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library by adopting the Redis protocol includes: The sensor and the Redis database are connected via TCP. The sensor initiates a connection request to the Redis server. The sensor sends a text command that complies with the Redis protocol to the Redis server, and the command includes at least data writing, reading, and updating operations; The sensor receives a response from the Redis server after parsing the text command sent by the sensor, and the format of the response complies with the Redis protocol; When reading data, the sensor sends the corresponding read command, and the sensor receives the response from the Redis server according to the read command sent by the sensor; After the communication is completed, the sensor closes the connection to the Redis server.
5. The method for designing a real-time feature library for distribution network faults according to claim 4, It is characterized in that The fault features of the nested key-value space data of the distribution network fault real-time feature library extracted by combining the machine learning algorithm include: After updating the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, the electrical data is cleaned, standardized and feature extracted to form a preliminary fault feature library; The fault feature library is sampled using the Bootstrap method, and a sample subset is randomly selected from the fault feature library in a method with replacement to generate a plurality of sub-data sets for training; For each Bootstrap subset, combined with machine learning algorithms, targeted training and optimization are performed for electrical equipment fault types; The prediction results of each base model on the newly acquired real-time electrical data are collected, and a voting mechanism is designed to obtain the final fault judgment conclusion by integrating the prediction outputs of each model; Implement a cross-validation process to evaluate and optimize model performance. When new real-time data appears, dynamically adjust the base model weights or selectively update model parameters based on the actual prediction effect of the integrated model to ensure that the fault feature library reflects the latest fault mode in real time.
6. The method for designing a real-time feature library for distribution network faults according to claim 5, It is characterized in that The comparing the electrical data at the time of the fault with the preset fault identification characteristic data includes: broadcasting the comparison result by adopting the MQTT protocol; On the database server side, use Mosquitto to build an MQTT Broker, which is responsible for receiving and forwarding messages, and the database server is used to generate real-time data, system notifications, and update broadcast messages; The database server is connected to the MQTT Broker. The database server is connected to the built MQTT Broker via TCP / IP. The database server defines a topic for broadcasting, where the topic is an identifier for publishing and subscribing to a message, and the terminal receives the broadcast message after subscribing to the corresponding topic; The database server uses the MQTT protocol to publish broadcast messages to the corresponding topics and sends the messages to the MQTT Broker at the same time; After receiving the message published by the database server, the MQTT Broker forwards the message to all terminals that have subscribed to the corresponding topic; After connecting to the MQTT Broker, the terminal needs to subscribe to the broadcast topic defined by the database server; When the terminal subscribes to the corresponding topic, it is eligible to receive the broadcast message published by the database server. After receiving the message, the terminal performs the corresponding operation.
7. The method for designing a real-time feature library for distribution network faults according to claim 6, It is characterized in that Also includes: Check whether the expired dictionary contains a target detection key. If so, obtain the key expiration time. The target detection key is used to verify whether the previous fault data is cleared. Check whether the current system time is greater than the key expiration time. If so, the key value is considered to have expired. Otherwise, the key value is not expired. The deletion strategy for expired keys uses a combination of lazy deletion and periodic deletion. The lazy deletion is to first check whether the key value is expired when obtaining the key from the key space. If it is not expired, the key value is returned to continue the operation, otherwise, it is deleted; The periodic deletion includes randomly taking a certain number of key values from a certain number of databases at regular intervals to check whether they are expired, and deleting them if they are expired.
8. A real-time feature library design system for distribution network faults. It is characterized in that include: A space establishment module, used to establish a nested key value space of a real-time feature library of distribution network faults, wherein the nested key value space includes at least a space for storing historical data, a space for storing electrical data at the time of faults, and a space for storing fault identification feature data; A comparison module is used to write the fault electrical data in the sensor into the corresponding key value space in the nested key value space of the distribution network fault real-time feature library by using the Redis protocol, and compare the fault electrical data with the preset fault identification feature data; A first judgment module is used to judge if the electrical data at the time of the fault is consistent with any preset fault identification feature data, and then store the electrical data at the time of the fault into the nested key value space of the distribution network fault real-time feature library; The second judgment module is used to determine if the electrical data at the time of the fault is inconsistent with any preset fault identification feature data, then manually mark the electrical data at the time of the fault, update the corresponding new preset fault identification feature data to the nested key value space of the distribution network fault real-time feature library, and complete the establishment of the distribution network fault real-time feature library.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is 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, It is 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.
