Automatic recovery method, device and equipment for abnormal communication of power distribution network terminal
By processing the message data of the distribution network terminal through an intelligent network model, anomalies are automatically identified and recovery instructions are generated, which solves the problem of timely recovery of communication anomalies of the distribution network terminal and improves the stability and reliability of the distribution network.
Patent Information
- Application Number
- CN202511830395.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-05
- Publication Date
- 2026-02-10
AI Technical Summary
In existing technologies, when the communication of distribution network terminals is abnormal, manual inspection and manual restart are required, which cannot restore communication in a timely manner, resulting in data packet loss and affecting the operation of the distribution network.
By acquiring message data between the distribution network terminal and the master station, the system performs in-depth processing using an intelligent network model, identifies abnormal probability data, and generates communication recovery commands based on a preset action library to automatically restore communication.
It enables automatic, rapid, and accurate recovery when communication at the distribution network terminal is abnormal, improving the operational stability and reliability of the distribution network and reducing the risk of power outages and maintenance costs.
Smart Images

Figure CN121509201A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power distribution network terminal technology, and in particular to an automatic recovery method, device and equipment for communication anomalies in power distribution network terminals. Background Technology
[0002] When communication between the distribution network terminal and the distribution network master station is abnormal, it will affect the stability and security of the power supply.
[0003] In existing technologies, communication anomalies in distribution network terminals are typically detected through periodic manual inspections, and then restored by manual restarts. This method cannot respond promptly to anomalies in distribution network terminals, which can lead to data packet loss and affect the operational status of the distribution network terminals.
[0004] Therefore, there is an urgent need for a solution that can automatically recover when communication anomalies occur at the distribution network terminal. Summary of the Invention
[0005] This application provides an automatic recovery method, apparatus, and device for communication anomalies in distribution network terminals, which can achieve the effect of automatic recovery when communication anomalies occur in distribution network terminals.
[0006] In a first aspect, embodiments of this application provide an automatic recovery method for communication anomalies in distribution network terminals, including:
[0007] In one possible implementation, message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period is obtained;
[0008] The message data is processed based on the intelligent network model to obtain anomaly probability data; whereby the anomaly probability data represents the probability value of the message data being at least one type of anomaly.
[0009] Based on the anomaly probability data and the preset action library, determine the communication restoration operation; generate the restoration command for the communication restoration operation, and execute the restoration command to restore normal communication between the communication unit of the distribution network terminal and the distribution network master station;
[0010] Among them, the preset action library represents the communication recovery operation under the abnormal result corresponding to the abnormal probability data; the communication recovery operation represents the recovery operation that can be adopted for the communication unit of the distribution network terminal to restore the normal communication between the communication unit of the distribution network terminal and the distribution network master station.
[0011] In one possible implementation, message data is processed based on an intelligent network model to obtain anomaly probability data, including:
[0012] Based on the convolutional neural network in the intelligent network model, the message data is dimensionality reduced to obtain message spatial features; where message spatial features characterize the spatial structural features of message data.
[0013] Based on the Long Short-Term Memory network in the intelligent network model, the spatial features of the message are processed to obtain anomaly probability data.
[0014] In one possible implementation, the communication recovery operation is determined based on anomaly probability data and a preset action library, including:
[0015] The abnormal probability data is fuzzified to obtain the health score of the communication unit; the health score represents the health level of the communication unit.
[0016] Based on anomaly probability data, health score, and preset action library, determine the operation to restore communication.
[0017] In one possible implementation, the anomaly probability data is obfuscated to obtain a health score for the communication unit, including:
[0018] The abnormal probability data is fuzzified according to the trapezoidal membership degree to obtain an abnormal fuzzy set; wherein, the abnormal fuzzy set includes at least one fuzzy dataset; the fuzzy dataset represents the probability value of the abnormal probability data belonging to the fuzziness degree; the fuzziness degree represents the different degrees of probability of the abnormal result corresponding to the abnormal probability data occurring;
[0019] A logical algorithm is used to combine the fuzzy datasets in the abnormal fuzzy set to obtain the health set; whereby the health set represents the set of health levels of the abnormal probability data.
[0020] The health score is determined based on the abnormal fuzzy set, the health score set, and the preset weights.
[0021] In one possible implementation, the communication recovery operation is determined based on anomaly probability data, health score, and a preset action library, including:
[0022] The abnormal probability data, health score, and preset action library are processed using the deep Q-model to obtain an operation score set. The operation score set includes at least one operation action and its score. The operation action score represents the reliability of communication unit communication recovery by executing the operation action.
[0023] Select operation actions with scores greater than or equal to a preset threshold from the operation score set, and determine the operation action as a communication recovery operation.
[0024] In one possible implementation, before generating the recovery instruction for resuming communication operations, the method further includes:
[0025] A security score is determined based on the security factor in the communication recovery operation; the security score characterizes the degree of security of the communication recovery operation.
[0026] If the security score is less than a preset threshold, an anomaly alert will be sent to the user.
[0027] In one possible implementation, before processing the message data based on the intelligent network model to obtain the anomaly probability data, the method further includes:
[0028] Perform one or more of the following data preprocessing on the message data: message data decoding, message data cleaning, message data normalization, and message data reassembly.
[0029] Secondly, embodiments of this application provide an automatic recovery device for communication anomalies in distribution network terminals, comprising:
[0030] The acquisition module is used to acquire message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period;
[0031] The processing module is used to process message data based on the intelligent network model to obtain anomaly probability data; wherein, the anomaly probability data represents the probability value of the message data being at least one type of anomaly.
[0032] The execution module is used to determine the communication recovery operation based on the anomaly probability data and the preset action library; and to generate the recovery command for the communication recovery operation and execute the recovery command so that the communication unit of the distribution network terminal and the distribution network master station can resume normal communication.
[0033] Among them, the preset action library represents the communication recovery operation under the abnormal result corresponding to the abnormal probability data; the communication recovery operation represents the recovery operation that can be adopted for the communication unit of the distribution network terminal to restore the normal communication between the communication unit of the distribution network terminal and the distribution network master station.
[0034] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;
[0035] The memory stores the instructions that the computer executes;
[0036] The processor executes computer execution instructions stored in memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.
[0038] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.
[0039] This application provides an automatic recovery method, apparatus, and device for communication anomalies in distribution network terminals. The method acquires message data between the communication unit of a distribution network terminal and the distribution network master station within a preset time period. Next, based on an intelligent network model, the message data undergoes deep processing. Leveraging its powerful data analysis and pattern recognition capabilities, the intelligent network model accurately analyzes potential anomaly features in the message data and generates anomaly probability data. This data characterizes the probability that the message data represents at least one type of anomaly, providing a scientific basis for precise anomaly type identification. Subsequently, based on the anomaly probability data and a preset action library, the system intelligently determines the communication recovery operation and generates corresponding recovery instructions. The richness and specificity of the preset action library ensure the diversity and effectiveness of the recovery operations. Finally, the recovery instructions are executed, enabling rapid restoration of communication between the communication unit of the distribution network terminal and the distribution network master station. This achieves automatic, rapid, and accurate communication recovery when distribution network terminal communication anomalies occur, significantly improving the stability and reliability of distribution network operation and effectively reducing the risk of power outages and maintenance costs caused by communication anomalies. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0041] Figure 1 A flowchart illustrating an automatic recovery method for communication anomalies in a power distribution network terminal, provided in this application embodiment. Figure 1 ;
[0042] Figure 2 A flowchart illustrating an automatic recovery method for communication anomalies in a power distribution network terminal, provided in this application embodiment. Figure 2 ;
[0043] Figure 3 A flowchart illustrating step S203 in an automatic recovery method for communication anomalies in a power distribution network terminal provided in an embodiment of this application;
[0044] Figure 4 A schematic diagram of an automatic recovery device for communication anomalies in a power distribution network terminal provided in this application embodiment;
[0045] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0046] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0047] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0048] Distribution automation systems are a crucial component of smart grids. Distribution terminals, as front-end devices for distribution network monitoring and control, require stable data communication with the master station via 4G / 5G communication units. However, in actual operation, the communication units of distribution terminals frequently experience anomalies such as module locking, network interruptions, data packet loss, and communication delays. This prevents the distribution terminals from uploading telemetry and teleindication data in a timely manner, impacting the monitoring and fault handling of the distribution network.
[0049] In existing technologies, communication anomalies in power distribution terminals mainly rely on manual inspections and remote restarts for handling. This approach suffers from problems such as long response times, low processing efficiency, and inability to accurately pinpoint the cause of the anomaly. Although some power distribution terminals have basic communication status monitoring functions, they can only detect obvious anomalies such as communication interruptions. They lack effective means to identify hidden problems such as communication quality degradation and intermittent faults, and their recovery strategies are limited, typically only performing simple module restart operations.
[0050] Therefore, the automatic recovery method for communication anomalies in power distribution network terminals provided in this application embodiment can solve the above-mentioned problems.
[0051] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0052] Figure 1 A flowchart illustrating an automatic recovery method for communication anomalies in a power distribution network terminal, provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the method includes:
[0053] S101. Obtain message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period.
[0054] For example, a distribution network terminal communication unit is a communication device installed on various terminal devices in the distribution network. It is responsible for encoding power data collected by the terminal devices, such as voltage, current, and power information, according to a specific communication protocol, and sending it to the distribution network master station via the communication network. Simultaneously, it can also receive control commands sent by the master station, enabling remote control of the terminal devices. The distribution network master station is the core of the entire distribution network operation and management. It is responsible for receiving data from various terminal communication units, performing centralized processing, analysis, and storage, and issuing corresponding control commands to the terminal devices based on the analysis results to ensure the safe and stable operation of the distribution network. Message data serves as the carrier for information exchange between the communication units and the master station, containing various power data, control commands, and communication protocol-related information.
[0055] At the start of the preset time period, the data acquisition device is activated to begin capturing message data in real time. The acquisition device stores the captured data on local storage media, such as a hard drive or memory card. After the preset time period ends, the captured message data is read from the acquisition device and decoded using appropriate decoding tools or software, converting it into text or structured data formats. The fifth step involves data storage and management, storing the decoded data in a database or file system for subsequent querying and analysis. Simultaneously, the stored data is backed up to prevent data loss.
[0056] In one possible implementation, based on the RS232 serial communication interface between the power distribution terminal and the communication unit, high-impedance parallel monitoring technology is used to losslessly acquire uplink and downlink communication messages to obtain digitized message data.
[0057] A high-impedance sampling circuit is designed based on the transmit and receive signal lines of an RS232 serial port. The sampling circuit employs a high-input-impedance operational amplifier, with a high-resistance sampling resistor connected in parallel on the signal lines to form a voltage divider sampling network. Since the sampling resistor is much larger than the output impedance of the serial port driver, the impact of the sampling circuit on the original signal is negligible. The sampling circuit uses a differential input structure, simultaneously sampling the voltage of the signal line and ground line. Differential operations are used to eliminate common-mode interference, converting the serial port signal into a single-ended signal that matches the input range of the subsequent analog-to-digital converter.
[0058] The single-ended signal is conditioned using an active bandpass filter. The filter employs a Butterworth structure, and its passband covers the signal frequency band corresponding to commonly used serial port baud rates, effectively suppressing high-frequency noise and low-frequency drift to meet the requirements of subsequent digital processing.
[0059] A high-speed analog-to-digital converter (ADC) chip is used to perform analog-to-digital conversion on the processed single-ended signal. Multiple points are sampled per bit cycle to accurately capture signal edges. The digital sampling sequence output by the converter is input to a programmable logic device for digital signal processing, and the digital signal is recovered through edge detection. The threshold is adaptively adjusted according to the signal amplitude and noise level.
[0060] Bit synchronization processing is performed on the digital signal to recover the bit sequence of the serial port data. The bit synchronization algorithm detects the falling edge of the start bit to determine the start time of byte transmission, and then samples data bits at the midpoint of each bit cycle according to the baud rate to avoid instability in the edge transition region. Frame synchronization processing is based on the frame structure characteristics of the communication protocol. The frame synchronization algorithm searches for the start character in the bit sequence to determine the start position of the frame, determines the end position of the frame based on the length field, and extracts the complete message frame. If a valid start character is not detected for several consecutive bytes or the message frame verification fails, the search state is restarted.
[0061] Based on a complete message frame, a millisecond-level timestamp and sequence number are added to form a message data stream with timing information. This message data stream is stored in a circular buffer, which can hold thousands of messages. When the buffer is full, the oldest message is overwritten. The buffer is managed using two pointers, and write and read operations are protected by a mutex lock to ensure thread safety.
[0062] S102. Process the message data based on the intelligent network model to obtain anomaly probability data; wherein, the anomaly probability data represents the probability value of the message data being at least one type of anomaly.
[0063] For example, intelligent network models typically refer to neural network models built based on deep learning algorithms, such as convolutional neural networks, recurrent neural networks and their variants, long short-term memory networks, and gated recurrent units. These models possess powerful feature extraction and pattern recognition capabilities, enabling them to automatically learn complex patterns and features in data. Message data is the information carrier transmitted between the distribution network terminal communication unit and the master station, containing various power data, control commands, and communication protocol-related information. Anomaly probability data refers to the probability value of message data belonging to at least one type of anomaly after processing by the intelligent network model, such as the probability of message data being a communication interruption anomaly or a data error anomaly.
[0064] The message data is cleaned to remove duplicate, erroneous, and invalid data; normalization is performed to scale the data to an appropriate range; and data augmentation techniques can be used to increase data diversity when the data volume is insufficient.
[0065] Based on the characteristics of the message data and the requirements for anomaly detection, select an appropriate intelligent network model. For example, if the message data has obvious temporal characteristics, a recurrent neural network or its variant can be selected; if the data has spatial structure characteristics, such as message data in image form (in certain special encoding cases), a convolutional neural network can be selected. After building the model, set the model parameters, such as the number of neurons, the number of layers, and the learning rate.
[0066] The preprocessed data is divided into training, validation, and test sets. The model is trained using the training set, with backpropagation continuously adjusting its parameters to reduce the loss function value on the training set. During training, the model's performance is evaluated using the validation set, and its parameters and structure are adjusted based on the validation results to prevent overfitting. The trained model is then evaluated using the test set, calculating metrics such as accuracy, recall, and F1 score to assess its performance. If the model's performance is unsatisfactory, optimization can be performed, such as adjusting the model structure, increasing training data, and tuning hyperparameters.
[0067] New message data is input into the trained model, which processes it and outputs anomaly probability data, representing the probability value that the message data belongs to at least one type of anomaly.
[0068] S103. Based on the abnormal probability data and the preset action library, determine the communication restoration operation; generate the restoration command for the communication restoration operation, and execute the restoration command so that normal communication is restored between the communication unit of the distribution network terminal and the distribution network master station.
[0069] Among them, the preset action library represents the communication recovery operation under the abnormal result corresponding to the abnormal probability data; the communication recovery operation represents the recovery operation that can be adopted for the communication unit of the distribution network terminal to restore the normal communication between the communication unit of the distribution network terminal and the distribution network master station.
[0070] For example, various methods can be used to determine anomalous outcomes when analyzing anomaly probability data. One common method is to set thresholds; for instance, a probability threshold can be set for each anomaly type. When the probability of an anomaly exceeds this threshold, it is identified as an anomalous outcome. Another method is to select the anomaly type with the highest probability as the anomalous outcome. Suppose there are three anomaly types A, B, and C, with corresponding anomaly probabilities of 0.6, 0.3, and 0.1, respectively. Then, anomaly type A can be identified as the anomalous outcome.
[0071] Based on the probability of anomaly data, it is matched against content in a preset action library. This preset action library typically exists as a database or rule engine, storing the correspondence between various anomaly results and communication recovery operations. By querying the database or applying the rule engine, a communication recovery operation matching the current anomaly result can be quickly found. For example, if the anomaly result is a communication line failure, the communication recovery operation found in the preset action library might be to check the communication line connection status, reconnect if the line is broken, and switch to a backup line (if a backup line exists).
[0072] Based on the matched communication recovery operation, a corresponding recovery command is generated according to the instruction format and communication protocol supported by the communication unit. The recovery command must contain explicit operation instructions and necessary parameter information. For example, if the communication recovery operation involves reconfiguring communication protocol parameters, the recovery command must include the new parameter values and the configured instruction code. The generated recovery command is then sent to the communication unit of the distribution network terminal. Upon receiving the command, the communication unit parses and executes it. During execution, the communication unit performs the corresponding operations according to the command requirements and feeds back the execution result to the master station or monitoring system. If execution is successful, communication between the communication unit and the master station will return to normal; if execution fails, the system will record the failure information and can re-execute according to preset strategies or take other remedial measures.
[0073] This application provides an automatic recovery method for communication anomalies in distribution network terminals. The method acquires message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period. Next, based on an intelligent network model, the message data undergoes deep processing. Leveraging its powerful data analysis and pattern recognition capabilities, the intelligent network model accurately analyzes potential anomaly features in the message data and generates anomaly probability data. This data characterizes the probability that the message data represents at least one type of anomaly, providing a scientific basis for precise anomaly type identification. Subsequently, based on the anomaly probability data and a preset action library, the system intelligently determines the communication recovery operation and generates corresponding recovery instructions. The richness and specificity of the preset action library ensure the diversity and effectiveness of the recovery operations. Finally, the recovery instructions are executed, enabling rapid restoration of communication between the communication unit of the distribution network terminal and the distribution network master station. This method achieves automatic, rapid, and accurate communication recovery when distribution network terminal communication anomalies occur, significantly improving the stability and reliability of distribution network operation and effectively reducing the risk of power outages and maintenance costs caused by communication anomalies.
[0074] Figure 2 A flowchart illustrating an automatic recovery method for communication anomalies in a power distribution network terminal, provided in this application embodiment. Figure 2 ,like Figure 2As shown, in this embodiment... Figure 1 Based on the embodiments, a method for automatic recovery of communication anomalies in distribution network terminals is described in detail. The method includes:
[0075] S201. Obtain message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period.
[0076] For example, this step can refer to step S101 above, and will not be repeated here.
[0077] As an example, message data may undergo one or more of the following preprocessing steps: message data decoding, message data cleaning, message data normalization, and message data reassembly.
[0078] For example, message data decoding processing. First, determine the encoding method used for the message data. This can be done by consulting the communication protocol documentation or analyzing the characteristics of the message data. Then, select the appropriate decoding algorithm and tools based on the determined encoding method. For example, if the message data uses XOR encoding, write a corresponding XOR decoding program to decode the data. During the decoding process, pay attention to handling possible decoding errors, such as the decoded data not conforming to the expected format or failing verification. For these errors, you can either re-decode or record the error information for subsequent analysis.
[0079] Message data cleaning and processing. Establish data cleaning rules, which can be determined based on the specific content of the message data and business requirements. For example, set non-null constraints for key fields; if a field value is found to be empty, fill it according to certain rules, such as using default values or calculating based on the values of other related fields. For outliers in the data, filter them by setting reasonable threshold ranges; correct or mark values exceeding the threshold range as anomalous data. During the cleaning process, record the cleaning operations and results for subsequent auditing and traceability.
[0080] Message data normalization processing. Choose an appropriate normalization method; common methods include min-max normalization and Z-score normalization. Min-max normalization maps the data to the range [0,1], and the calculation formula is... Where x is the original data, It is the minimum value of the data. It is the maximum value of the data. This is the normalized data. Choose an appropriate normalization method based on the characteristics of the data and the analysis requirements, and then normalize the data.
[0081] Message data reassembly processing. The rules for data reassembly are determined based on the specific application scenario and requirements. For example, if message data needs to be stored in a relational database, it needs to be split into multiple fields conforming to the database table structure. If data transmission is required, the message data needs to be split and combined according to network bandwidth and transmission protocol requirements. During the reassembly process, it is crucial to ensure data integrity and accuracy, avoiding data loss or errors due to the reassembly operation.
[0082] S202. Based on the convolutional neural network in the intelligent network model, the message data is dimensionality reduced to obtain message spatial features; wherein, the message spatial features characterize the spatial structure features of the message data; based on the long short-term memory network in the intelligent network model, the message spatial features are processed to obtain anomaly probability data.
[0083] For example, the message spatial feature extraction module based on the convolutional neural network in the intelligent network model performs dimensionality reduction on the message data; the convolutional neural network is used to extract the spatial features of the message data layer by layer; the convolutional neural network contains three convolutional layers and two pooling layers, each convolutional layer uses multiple convolutional kernels to slide on the message matrix to generate multiple feature maps and capture different local feature patterns of the message data; the ReLU activation function is applied to the output of the convolutional layer to enhance the nonlinear expression capability; the pooling layer achieves dimensionality reduction of the feature map through max pooling, retaining the most obvious feature information; after three convolutional layers and two pooling layers, the multidimensional feature map is flattened into a one-dimensional feature vector, which is mapped to a lower-dimensional space through a fully connected layer to obtain compact message spatial features.
[0084] Based on the Long Short-Term Memory (LSTM) network in the intelligent network model, the message spatial features are processed. A two-layer LSM network is used to extract the temporal dependency features of the message sequence. The LSM network processes the sequence information through a gating mechanism of forget gate, input gate, and output gate to selectively forget historical information, write new information, and output the hidden state. The output of the hidden state after the first layer is used as the input of the second layer to extract temporal features at a higher level of abstraction. After processing the entire sequence, the hidden state at the last moment of the second layer is extracted as the temporal feature representation of the message spatial features, resulting in a temporal feature vector.
[0085] Based on temporal feature vectors, anomaly type identification and probability calculation are performed using a classification network. The temporal feature vectors are input into a fully connected layer for linear transformation, yielding raw scores for eight anomaly categories: normal state, module lockout anomaly, network connection interruption anomaly, data packet loss anomaly, protocol parsing error anomaly, communication delay anomaly, signal interference anomaly, and unknown anomaly. Softmax normalization is then applied to convert the scores into anomaly probability data, with the probability value for each category ranging from zero to one, and the sum of the probabilities for all categories equaling one.
[0086] In one possible implementation, the anomaly probability data is a one-dimensional array containing eight elements, denoted as [P0, P1, P2, P3, P4, P5, P6, P7], where P0 represents the probability of a normal state, and P1 to P7 represent the probabilities of module lockout anomalies, network connection interruption anomalies, data packet loss anomalies, protocol parsing error anomalies, communication delay anomalies, signal interference anomalies, and unknown anomalies, respectively. For example, anomaly probability data of [0.85, 0.05, 0.03, 0.02, 0.01, 0.02, 0.01, 0.01] indicates that the current message has an 85% probability of being in a normal state, a 5% probability of having a module lockout anomaly, and lower probabilities for the other anomaly types.
[0087] The system identifies the category with the highest probability value. If this category is normal and the probability value exceeds a preset threshold, the current communication status is determined to be normal. Otherwise, it is determined to be abnormal, with the abnormal category being the one with the highest probability value. Once an abnormal category is identified, subsequent steps are executed to restore normal communication between the distribution network terminal and the master station.
[0088] S203. The abnormal probability data is fuzzed to obtain the health score of the communication unit; the health score represents the health level of the communication unit; based on the abnormal probability data, the health score, and the preset action library, the operation to restore communication is determined.
[0089] For example, first determine the number and names of the fuzzy sets; for instance, they can be divided into three fuzzy sets: low, medium, and high. Then, design membership functions. Common membership functions include triangular membership functions and trapezoidal membership functions. Taking the triangular membership function as an example, for a low fuzzy set, its center value can be set to 0.2, and its left and right boundary values to 0 and 0.4; for a medium fuzzy set, the center value is 0.6, and its left and right boundary values are 0.4 and 0.8; for a high fuzzy set, the center value is 0.9, and its left and right boundary values are 0.8 and 1.
[0090] Based on these membership functions, the membership degree of each outlier probability data point to each fuzzy set is calculated. For example, for an outlier probability data point of 0.5, its membership degrees to the low, medium, and high fuzzy sets are calculated to be 0, 0.5, and 0, respectively.
[0091] Calculate the health score of the communication unit. According to a preset weighting rule, assign a corresponding weight to each fuzzy set. For example, the weight of the low fuzzy set is 0.6, the weight of the medium fuzzy set is 0.3, and the weight of the high fuzzy set is 0.1. Then, based on the membership degree of each anomaly probability data in each fuzzy set, perform a weighted sum to calculate the health score. The calculation formula is: Health Score = Membership Degree (Low) × Weight (Low) + Membership Degree (Medium) × Weight (Medium) + Membership Degree (High) × Weight (High). For the example of anomaly probability data of 0.5, its health score is 0 × 0.6 + 0.5 × 0.3 + 0 × 0.1 = 0.15.
[0092] Determine the communication recovery operation. Based on the calculated anomaly probability data and health score, search for a matching communication recovery operation in the preset action library. The preset action library can be presented in tabular form, listing different anomaly probability ranges and health score ranges, along with the corresponding communication recovery operations. For example, when the anomaly probability is between 0 and 0.3 and the health score is between 0.6 and 1, the operation is normal monitoring; when the anomaly probability is between 0.3 and 0.7 and the health score is between 0.3 and 0.6, the operation is checking communication parameters; when the anomaly probability is between 0.7 and 1 and the health score is between 0 and 0.3, the operation is restarting the communication unit and switching to a backup channel. Based on the specific anomaly probability and health score value, find the corresponding operation in the table and execute it.
[0093] Figure 3 This is a flowchart illustrating step S203 of an automatic recovery method for communication anomalies in a distribution network terminal provided in an embodiment of this application. Figure 3 As shown, step S203 includes:
[0094] S2031. The abnormal probability data is fuzzified according to the trapezoidal membership degree to obtain an abnormal fuzzy set; wherein, the abnormal fuzzy set includes at least one fuzzy dataset; the fuzzy dataset represents the probability value of the abnormal probability data belonging to the fuzziness level; the fuzziness level represents the different degrees of probability of the abnormal result corresponding to the abnormal probability data occurring; the fuzzy dataset in the abnormal fuzzy set is combined using a logical algorithm to obtain a health set; wherein, the health set represents the health level set of the abnormal probability data; the health score is determined according to the abnormal fuzzy set, the health set, and the preset weight.
[0095] For example, based on the anomaly probability data [P0, P1, P2, P3, P4, P5, P6, P7], the four anomaly probabilities that have the most significant impact on the communication status are selected from eight anomaly types as input variables for the fuzzy logic system. The four selected anomaly probabilities are: P1 (module lock probability), P2 (network interruption probability), P3 (data packet loss probability), and P5 (communication delay probability). These four anomalies are chosen because they have the most direct and severe impact on the communication function of the power distribution terminal, while anomalies such as protocol parsing errors and signal interference have relatively smaller impacts or occur less frequently. Regardless of whether the current message is abnormal, the system extracts these four probability values as input. Each probability value is a decimal between 0 and 1. For example, P1 = 0.05 indicates a 5% probability of a module lock anomaly.
[0096] For each input variable, three fuzzy sets are defined: low, medium, and high, representing different levels of probability of the anomaly occurring; that is, three levels of fuzziness: low, medium, and high. The probability value of each input variable is simultaneously mapped to these three levels of fuzziness. The membership degree of this probability value to each set is calculated using a membership function. A trapezoidal membership function is used to describe the membership degree of the input variable to each fuzzy set, as the trapezoidal function is simple to calculate and has clear boundaries.
[0097] Taking the module locking probability P1 as an example, we design the membership functions of three fuzzy sets:
[0098] Low fuzzy set: The membership degree is 1 when the probability is less than 0.1, linearly decreasing between 0.1 and 0.3, and 0 when the probability is greater than or equal to 0.3; Medium fuzzy set: The membership degree is 0 when the probability is less than 0.2, linearly increasing to 1 between 0.2 and 0.4, remaining at 1 between 0.4 and 0.6, and linearly decreasing to 0 between 0.6 and 0.8; High fuzzy set: The membership degree is 0 when the probability is less than 0.7, linearly increasing between 0.7 and 0.9, and 1 when the probability is greater than or equal to 0.9.
[0099] Example of membership function calculation: Suppose that at a certain moment, the module locking probability P1 = 0.25. Then, the membership degrees of this probability value to the three fuzzy sets are as follows: Low set membership degree = 0.25 (calculated by linear interpolation: (0.3-0.25) / (0.3-0.1) = 0.25), Medium set membership degree = 0.25 (calculated by linear interpolation: (0.25-0.2) / (0.4-0.2) = 0.25), High set membership degree = 0 (because 0.25 is less than 0.7). This means that P1 = 0.25 belongs to the low set to some extent and to the medium set to some extent, but does not belong to the high set.
[0100] The membership functions of the other three input variables (P2 network interruption probability, P3 data packet loss probability, and P5 communication delay probability) adopt a similar trapezoidal structure, and the boundary parameters of the trapezoidal function are adjusted according to the degree of influence of each anomaly type on the communication status.
[0101] The output variable is the health status of the communication, and five fuzzy datasets are defined: excellent, good, average, poor, and severe, which correspond to different levels of health status.
[0102] The fuzzy dataset is constructed based on the following: combining three fuzzy sets (low, medium, and high) for each of the four input variables (module lock probability, network interruption probability, data packet loss probability, and communication delay probability), theoretically generating 3^4 = 81 combinations. In actual construction, based on practical experience in power distribution terminal communication management, unreasonable or rarely occurring combinations are eliminated, ultimately resulting in 45 valid rules.
[0103] Examples of fuzzy rules for fuzzy datasets: Rule 1: IF Module lock probability is low AND network outage probability is low AND data loss probability is low AND communication delay probability is low THEN Health is excellent; Rule 2: IF Module lock probability is low AND network outage probability is low AND data loss probability is medium AND communication delay probability is low THEN Health is good; Rule 3: IF Module lock probability is medium OR network outage probability is medium THEN Health is fair; Rule 4: IF Module lock probability is high OR network outage probability is high THEN Health is poor; Rule 5: IF Module lock probability is high AND network outage probability is high THEN Health is severe;
[0104] Each rule is assigned a weight, representing its importance. Weights are determined based on expert experience and historical data statistics; important rules (such as those involving serious anomalies) are given higher weights, and less important rules are given lower weights. All rule weights are normalized to ensure the sum of the weights is 1.
[0105] After determining the membership degrees of the four input variables to their respective fuzzy datasets, the system will traverse all 45 rules in the rule base, calculate the activation strength of each rule based on its antecedents and the membership degrees of the input variables, and then infer the final health score based on the combined activation strengths of all rules.
[0106] Based on a pre-built fixed fuzzy rule base, fuzzy inference is performed on the four abnormal probability values of the current input, the fuzzy set of output variables is calculated, and then the definite health value is obtained through defuzzification.
[0107] The fuzzy reasoning process includes the following steps:
[0108] Calculate the activation strength of each rule. The antecedent of a rule contains multiple conditions, combined using logical operations (AND, OR). The AND operation uses the minimum value operator, and the OR operation uses the maximum value operator. For example, the activation strength of rule 1 is the minimum membership of the four input variables to the low set; the activation strength of rule 3 is the maximum membership of the two input variables to the middle set.
[0109] Example of activation intensity calculation: Suppose that at a certain moment, the membership degrees of the four input variables are: P1 membership degree to the low set = 0.8, P2 membership degree to the low set = 0.6, P3 membership degree to the low set = 0.9, and P5 membership degree to the low set = 0.7. Then, the activation intensity of Rule 1 (IF all four probabilities are low THEN health is excellent) = min(0.8, 0.6, 0.9, 0.7) = 0.6. This means that the current state satisfies the condition of Rule 1 to a degree of 0.6.
[0110] Based on the activation strength and conclusion of the rules, calculate the membership degree of each fuzzy set of the output variable.
[0111] The Mamdani inference method is used: For each output fuzzy set (Excellent, Good, Average, Poor, Serious), all rules whose conclusions belong to this set are identified. The activation intensity of each rule is multiplied by its weight, and the maximum value among all products is selected as the membership degree of the output fuzzy set. For example, if the conclusions of rules 1, 6, and 10 are all "Health level is Excellent", their activation intensities are 0.6, 0.4, and 0.5 respectively, and their weights are 0.8, 0.6, and 0.7 respectively, then the membership degree of the "Excellent" set = max(0.6×0.8, 0.4×0.6, 0.5×0.7) = max(0.48, 0.24, 0.35) = 0.48;
[0112] Defuzzification is performed to convert the fuzzy sets into definite health scores. The centroid method is used: the health score range of 0 to 1 is evenly divided into 100 discrete points. For each discrete point, its maximum membership degree to all output fuzzy sets is calculated. Then, a weighted average of the membership degrees of all discrete points and their corresponding health scores is calculated to obtain the defuzzified health score. The final output health score is a definite value between 0 and 1; for example, 0.85 indicates a communication status health of 85%.
[0113] In one possible implementation, sample data from actual operation is collected, with each sample containing input variables (anomaly probability data) and true health status labels. An optimization objective function is constructed, including an evaluation accuracy term (mean squared error) and a regularization term (to prevent overfitting). The membership function's parameters include the coordinates of the four vertices of a trapezoidal function, totaling 48 parameters (4 input variables × 3 fuzzy sets × 4 parameters).
[0114] The gradient descent algorithm is used to optimize the parameters: the partial derivative of the objective function with respect to each parameter is calculated, and the parameter values are updated based on the gradient information. The learning rate is set to 0.01, and the iteration is terminated after 1000 iterations or when the change in the objective function is less than 0.000001. Parameter optimization is performed once a week, or when the cumulative number of new samples exceeds 500.
[0115] An adaptive threshold adjustment mechanism is adopted to dynamically adjust the health status judgment threshold according to changes in the communication environment. By statistically analyzing the distribution characteristics of historical health status data, the mean and standard deviation are calculated, and then the threshold is set according to the statistical characteristics, so that anomaly detection is more in line with the actual situation of the current communication environment.
[0116] S2032. Process the abnormal probability data, health score, and preset action library according to the deep Q model to obtain an operation score set; wherein, the operation score set includes at least one operation action and an operation action score; the operation action score represents the reliability of the communication unit to restore communication by performing the operation action; filter out operation actions with operation action scores greater than or equal to a preset threshold from the operation score set, and determine the operation action as a communication restoration operation.
[0117] For example, the deep Q-model employs a fully connected neural network structure, comprising an input layer (a 16-dimensional state vector), three hidden layers (128-256-128 neurons, ReLU activation function), and an output layer (10 neurons corresponding to 10 actions). The Q-value represents the expected long-term cumulative reward for performing a specific action in a given state, with a discount factor set to 0.95. The action score is the Q-value.
[0118] The training of the deep Q-model employs an experience replay and target network mechanism. The experience replay pool stores 10,000 historical state transition samples. Each iteration of the training process involves: randomly sampling 32 samples from the experience pool, calculating the target Q-value, calculating the mean squared error loss, and updating the network parameters using the Adam optimizer (learning rate 0.0001). The target network is copied and updated from the current network every 100 iterations to stabilize the training process.
[0119] Training data was derived from offline simulations and online runs. The training process employed an exploratory-utilization balancing strategy, with the exploration rate gradually decreasing from 1.0 to 0.1. Training consisted of 2000 epochs, each epoch simulating a complete process from an anomaly occurrence to full recovery.
[0120] Based on health scores and anomaly probability data, these are input into a deep Q-model. The Q-value of each action is calculated through forward propagation, and the action with the highest Q-value is selected as the operation action. To maintain exploration capability, the exploration rate is set to 0.05 during online runtime, meaning the optimal action is selected 95% of the time, and an action is randomly selected in 5% of the time. After selecting an action, the action number and related parameters are passed to the recovery operation execution module in step five. Simultaneously, information such as the current state, the selected action, and the execution time are recorded for subsequent effect evaluation and model updates.
[0121] The communication recovery operations include, but are not limited to, the following: Operation 0: No operation, continue to observe the communication status; Operation 1: Software reset, restart the 4G communication module's software system via AT commands; Operation 2: Hardware reset, perform a hardware restart of the 4G communication module by controlling the reset pin; Operation 3: Network reconnection, disconnect the current network connection and re-initiate the registration and attachment process; Operation 4: Parameter optimization, adjust the communication module's operating parameters (such as transmit power, data rate, etc.); Operation 5: Data retransmission, retransmit the most recently failed data packets; Operation 6: Base station switching, force the communication module to switch to a base station with a stronger signal; Operation 7: Load reduction, temporarily reduce the data upload frequency to alleviate communication pressure; Operation 8: Cache clearing, clear the communication module's data cache and error records; Operation 9: Request manual intervention, send alarm information to maintenance personnel and wait for manual processing. Each action corresponds to a specific control command or command sequence, which is executed by the control module.
[0122] S204. Determine the security score based on the security coefficient in the communication recovery operation; the security score represents the security level of the communication recovery operation; if the security score is less than the preset threshold, issue an abnormal alarm to the user.
[0123] For example, a security pre-assessment is performed before execution of the communication recovery operation. Historical cases similar to the communication recovery operation are retrieved from a pre-defined action library, and the similarity is calculated using the Euclidean distance method. The top 20 historical cases with the smallest distance are selected, and the success rate, average health improvement, and maximum health decrease among failed cases are statistically analyzed.
[0124] The success rate is multiplied by a weighting factor of 0.5, the average health improvement is normalized and multiplied by a weighting factor of 0.3, and the maximum health decrease in failed cases is normalized and multiplied by a weighting factor of -0.2. These three components are added together to obtain a safety score (ranging from 0 to 1). If the safety score is less than 0.6, the action is considered high-risk, rejected, and an anomaly alert is issued to the user. Then, the action with the second-highest Q-value and a satisfactory safety score is selected, or a conservative action is chosen. If the safety score is satisfactory, the next step is to save a state snapshot.
[0125] In one possible implementation, a state snapshot is taken before performing the communication recovery operation. The state snapshot includes: configuration parameters (APN, baud rate, network mode, etc.), connection status (network registration status, signal strength, IP address, etc.), cached data, operating parameters (module temperature, voltage, runtime, etc.), and timestamp;
[0126] State snapshots are stored in a structured format in non-volatile memory, occupying approximately 10KB of storage space, while a copy is maintained in memory to speed up rollback. Snapshot saving employs atomic operations to ensure the saving process is not interrupted.
[0127] Based on the saved state snapshot, the communication recovery operation begins. The communication recovery operation is broken down into multiple sub-steps, and the communication state is monitored immediately after each sub-step is executed.
[0128] Taking action 2 (hardware reset) as an example, it can be broken down into: notifying the main control unit to pause data transmission → pulling the reset pin low for 200ms to trigger a hardware reset → waiting for the module to restart (timeout of 30 seconds) → reconfiguring the module parameters → verifying the network connection status → sending a test message to verify the data transmission function.
[0129] After each sub-step is executed, the current health score and anomaly probability data are immediately collected to determine if any anomalies have occurred: if the health score drops by more than 0.15, or a new serious anomaly is detected (anomaly probability greater than 0.8), or the sub-step execution times out, a rollback is triggered. If all sub-steps complete successfully and no rollback conditions are triggered, the recovery operation is successful.
[0130] In one possible implementation, once the communication recovery operation is successfully completed, a comprehensive effect verification is performed. The effect verification includes the following four aspects:
[0131] Health Improvement Verification: Compare the health scores before and after the recovery procedure and calculate the amount of health improvement. If the health score after recovery is ≥0.7 and the improvement amount is ≥0.2, the health improvement index is 1; if the health score is between 0.5 and 0.7 or the improvement amount is between 0.1 and 0.2, the index is 0.5; otherwise, the index is 0.
[0132] Anomaly Elimination Verification: Re-inspect the current communication status and obtain the latest anomaly probability data [P0, P1, P2, P3, P4, P5, P6, P7], and compare it with the anomaly probability data before the communication recovery operation. The verification criteria are as follows: if the probability of the anomaly type with the highest probability before the recovery operation (such as the P1 module lock anomaly) drops below 0.1 after recovery, and the probability of normal state P0 rises above 0.8, then the anomaly is determined to be eliminated, and the anomaly elimination index is 1; if the anomaly probability decreases but is still higher than 0.3, the index is 0.5; if the anomaly probability does not decrease significantly or a new anomaly type appears with an increased probability, the index is 0.
[0133] Communication Function Verification: Perform actual communication tests, including sending test messages to the master station, receiving test commands from the master station, and verifying data integrity and response time. If the test message is successfully sent and confirmed by the master station, the data is correct, and the response time is within the normal range (less than 2 seconds), the function verification metric is 1; if some tests pass but there are delays or occasional failures, the metric is 0.5; if the test fails, the metric is 0.
[0134] Stability Verification: Continuous monitoring for 5 minutes, collecting health score and anomaly probability data every 30 seconds. If the health score remains stable within 5 minutes (fluctuation range less than 0.1) and no new anomalies appear (all anomaly probabilities less than 0.2), the stability index is 1; if the health score fluctuates slightly or occasional minor anomalies occur, the index is 0.5; if the health score continues to decline or anomalies occur repeatedly, the index is 0.
[0135] Based on the above verification results, the recovery effect score is calculated as follows: Health Improvement Index × 0.4 + Abnormality Elimination Index × 0.3 + Functional Verification Index × 0.2 + Stability Index × 0.1, with a value range of 0 to 1.
[0136] If the recovery score is ≥0.7, the recovery is considered successful, a successful case is recorded, and a positive reward is given. If the score is between 0.4 and 0.7, the recovery is considered partially successful. If the score is <0.4, the recovery is considered unsuccessful, a rollback operation is performed, and a negative reward is given.
[0137] In one possible implementation, the rollback process is as follows: read the state snapshot and verify its integrity → stop the current recovery operation → restore configuration parameters → restore network connection state → restore cached data → verify the rollback effect.
[0138] Rollback success determination: If the health status is restored to the level before the operation (absolute difference ≤ 0.05), the rollback is determined to be successful, the failure information is recorded, and a negative reward is fed back to the reinforcement learning model.
[0139] Rollback failure determination: If the health status fails to recover or further declines, the rollback is determined to have failed, triggering the emergency protection mechanism: stop all automatic recovery operations, lock the communication module status, send a high-priority alarm to the operation and maintenance personnel, and wait for manual intervention.
[0140] This application provides an automatic recovery method for communication anomalies in distribution network terminals. The method acquires message data between the distribution network terminal communication unit and the master station within a preset time period. Then, it uses a convolutional neural network in an intelligent network model to perform dimensionality reduction on this data, accurately extracting message spatial features that deeply characterize the spatial structure of the message data. Next, it further analyzes the message spatial features using a long short-term memory network to obtain anomaly probability data, providing a quantitative basis for anomaly identification. To more comprehensively assess the communication unit status, the method also performs fuzzification processing on the anomaly probability data to obtain a health score for the communication unit. Based on this, combined with a preset action library, and integrating the anomaly probability data and health score, it intelligently determines the communication recovery operation. Simultaneously, it assesses the safety of the recovery operation based on its safety coefficient. If the safety score is lower than a preset threshold, an anomaly alarm is promptly issued to the user. This method achieves automatic, accurate, and safe recovery of communication anomalies in distribution network terminals, significantly improving the reliability and stability of distribution network communication and effectively reducing the operation and maintenance costs and risks caused by communication failures.
[0141] The automatic recovery method for communication anomalies of distribution network terminals provided in this application embodiment further includes: storing the data in the automatic recovery method for communication anomalies of distribution network terminals.
[0142] The stored data is divided into three levels: hot data, warm data, and cold data.
[0143] Hot data is defined as all data generated within the last 24 hours, including message data, anomaly probability data, health scores, and recovery communication operation records. Hot data is stored in a high-speed cache using memory-mapped file technology, mapping a portion of the SD card to the memory address space for fast read and write operations. The hot data area has a capacity of 128MB and uses a circular overwrite mechanism, overwriting the oldest data when the capacity is full.
[0144] Hot data is stored in its raw format without compression to ensure fast access. Data is organized chronologically, with each hour's data stored in a separate file named hot_YYYYMMDD_HH.dat.
[0145] Warm data is defined as data from 24 hours to 7 days ago. Warm data is migrated from the hot data area and stored in the main storage area of the SD card. Warm data is compressed using the LZ4 compression algorithm, which features fast compression speed (400MB / s compression, 2GB / s decompression) and a moderate compression ratio (approximately 2.5:1), making it suitable for frequently accessed data.
[0146] The migration process for warm data is as follows: A data migration task is executed every 24 hours, automatically completed by a background thread. The migration process includes: reading the hot data file, performing LZ4 compression, writing to the warm data area, creating an index, and deleting the hot data file. The migration process uses an incremental approach, migrating only newly generated data to avoid redundant processing.
[0147] The warm data area is set to 2GB, which can store approximately 7 days of compressed data. The warm data file is named warm_YYYYMMDD.dat.lz4.
[0148] Cold data definition: Historical data older than 7 days. Cold data is migrated from the warm data area and stored in the archive area of the SD card. Cold data is deeply compressed using the LZMA compression algorithm, which has an extremely high compression ratio (approximately 7:1), but the compression and decompression speeds are relatively slow, making it suitable for long-term storage of data with low access frequency.
[0149] The cold data migration process is performed every 7 days, compressing data older than 7 days in the warm data area using LZMA and migrating it to the cold data area. The cold data area has a capacity of 6GB, capable of storing approximately 30 days of deeply compressed data. Cold data files are named in the format cold_YYYYMMDD.dat.lzma.
[0150] When the cold data area approaches its capacity limit, the oldest cold data file is automatically deleted, ensuring that data from the most recent 30 days is always retained. For data files containing significant abnormal events, a protection flag is set to extend the retention period or save them permanently.
[0151] In one possible implementation, a multi-dimensional intelligent index structure is constructed based on the stored data obtained in the preceding steps to support fast retrieval and querying;
[0152] An index comprises three dimensions: time index, type index, and keyword index.
[0153] The time index uses a B+ tree structure with timestamps as keys. The B+ tree has an order of 128, meaning each node contains a maximum of 127 keys and 128 pointers to child nodes. Leaf nodes store the physical address of the data block (filename and offset), while non-leaf nodes store the index key and pointers to child nodes.
[0154] B+ tree insertion operation: When new data is written to the storage area, the timestamp of the data is extracted, and the insertion position is found in the B+ tree. If the leaf node is not full, the data is inserted directly; if the leaf node is full, the node is split, half of the key-value pairs are moved to the new node, and the index of the parent node is updated.
[0155] B+ tree query operations: Given a start and end time range, starting from the root node, the search proceeds level by level downwards based on key-value comparisons until a leaf node containing the start time is found. Then, the leaf nodes are traversed sequentially, collecting the addresses of all data blocks with timestamps within the range, until the end time has passed. B+ trees offer high efficiency for time range queries; the query time is primarily determined by the tree height and the number of results.
[0156] The type index uses a bitmap index, creating a bitmap for each data type. Data types include: normal messages, module lock exceptions, network interruption exceptions, data packet loss exceptions, protocol error exceptions, communication delay exceptions, recovery operation records, etc., totaling 10 types.
[0157] Bitmap construction: The storage area is divided into fixed-size data blocks (1MB each), and each data block is assigned a unique block number. For each data type, a bitmap is created, with the bitmap length equal to the total number of data blocks. If a data block contains data of that type, the corresponding bit is set to 1; otherwise, it is set to 0.
[0158] Bitmap query operations: Given a data type, the corresponding bitmap is read directly, and bitwise operations are used to quickly find all data blocks containing that data type. Multi-type combination queries are implemented through logical operations on the bitmap. For example, to query data blocks containing module lock exceptions but not network interruption exceptions, logical operations are first performed on the module lock exception bitmap and the network interruption exception bitmap: the network interruption exception bitmap is inverted, and then a bitwise AND operation is performed with the module lock exception bitmap to obtain the bitmap of the data block that meets the condition.
[0159] The advantage of bitmap indexes is their fast query speed. By leveraging the efficiency of bitwise operations, they can quickly filter large-scale data. For 10,000 data blocks, a query requires only about 156 bitwise operations (based on a 64-bit machine word length).
[0160] The keyword index uses a hash table structure to extract key fields from the message content to build the index. Key fields include: device address, function code, data point identifier, and exception type code.
[0161] Hash table construction: A hash value is calculated for each key, using the MurmurHash3 algorithm, which has good distribution characteristics and a low collision rate. The size of the hash table is set to a prime number (e.g., 10007), and chaining is used to handle collisions. Each slot in the hash table stores a linked list, and each linked list node contains the key, the data block address, and a pointer to the next node.
[0162] Hash table query operations: Given a key, calculate the hash value, locate the corresponding slot, traverse the linked list to find a matching key, and return the data block address. The average time complexity of the query is constant, meaning the query time does not increase with the amount of data.
[0163] Based on the index structure established in the preceding steps, incremental compression technology is used for similar consecutive messages. For consecutive communication messages, if the content similarity is high, only the first complete message (base message) and the differences between subsequent messages and the base message (incremental data) are stored.
[0164] Similarity is calculated using the edit distance method (Levenshtein distance), which employs a dynamic programming algorithm to determine the minimum number of edit operations required to convert one message into another. Similarity = 1 - edit distance / message length.
[0165] If the similarity is greater than 0.8, incremental storage is used. Incremental data uses differential encoding to record the location and content of differences. A baseline message is set every 10 messages to ensure that excessive backtracking is not required during decompression. Incremental compression can further save 30% to 50% of storage space.
[0166] This application also provides a data export interface. The data export interface uses both USB and serial ports.
[0167] Export process: User sets export conditions (time range, data type, keywords, etc.) → System uses index to quickly locate target data blocks → Reads and decompresses data blocks sequentially → Format conversion generates standard format files (CSV, JSON, XML, etc.) → Streaming processing technology is used to avoid memory overflow → Export report is generated.
[0168] The exported data can be analyzed offline using dedicated data analysis software, providing functions such as communication quality statistical analysis, abnormal event analysis, communication trend analysis, and message comparison analysis.
[0169] In one possible implementation, an application example is given below to better illustrate the practical application effect of the present invention;
[0170] A feeder terminal at a certain substation experienced a communication anomaly at 9:30 AM on November 8th of a certain year. This terminal is responsible for monitoring a 10kV distribution line and needs to upload telemetry data to the master station every minute, and immediately upload telemetry data whenever the line status changes.
[0171] Anomaly occurred as follows: At 9:30:00, the communication status self-management module detected an increase in message transmission delay, with the average delay rising from the normal 0.5 seconds to 3 seconds; at 9:30:30, three consecutive message transmission failures were detected, with a packet loss rate of 30%; at 9:31:00, the communication module became completely unresponsive, and its health status dropped sharply from 0.85 to 0.25, which was determined to be a serious anomaly.
[0172] The abnormal process data is shown in Table 1:
[0173] Table 1: Key data regarding the anomaly occurrence process
[0174]
[0175] The recovery process is shown in Table 2:
[0176] Table 2: Recovery Operation Execution Record
[0177]
[0178] This application example demonstrates that the self-management module for the communication status of the power distribution terminal can promptly detect communication anomalies, accurately identify the anomaly type, automatically select appropriate recovery strategies, and quickly restore communication functions. The entire process requires no manual intervention, thus improving the reliability and intelligence level of the power distribution automation system.
[0179] Figure 4 This application provides a schematic diagram of the structure of an automatic recovery device for communication anomalies in a power distribution network terminal, as shown in the embodiments of this application. Figure 4 As shown, the automatic recovery device 40 for communication anomalies in a power distribution network terminal provided in this embodiment includes:
[0180] The acquisition module 401 is used to acquire message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period;
[0181] The processing module 402 is used to process the message data based on the intelligent network model to obtain anomaly probability data; wherein, the anomaly probability data represents the probability value of the message data being at least one type of anomaly.
[0182] The execution module 403 is used to determine the communication recovery operation based on the anomaly probability data and the preset action library; and to generate a recovery instruction for the communication recovery operation and execute the recovery instruction so that normal communication is restored between the communication unit of the distribution network terminal and the distribution network master station.
[0183] Among them, the preset action library represents the communication recovery operation under the abnormal result corresponding to the abnormal probability data; the communication recovery operation represents the recovery operation that can be adopted for the communication unit of the distribution network terminal to restore the normal communication between the communication unit of the distribution network terminal and the distribution network master station.
[0184] In one possible implementation, the processing module 402 includes:
[0185] Based on the convolutional neural network in the intelligent network model, the message data is dimensionality reduced to obtain message spatial features; where message spatial features characterize the spatial structural features of message data.
[0186] Based on the Long Short-Term Memory network in the intelligent network model, the spatial features of the message are processed to obtain anomaly probability data.
[0187] In one possible implementation, the execution module 403 includes:
[0188] The fuzzy processing module 4031 is used to fuzzify the anomaly probability data to obtain the health score of the communication unit; wherein, the health score represents the health level of the communication unit.
[0189] The determination module 4032 is used to determine the communication recovery operation based on the anomaly probability data, health score, and preset action library.
[0190] In one possible implementation, the fuzzing module 4031 includes:
[0191] The abnormal probability data is fuzzified according to the trapezoidal membership degree to obtain an abnormal fuzzy set; wherein, the abnormal fuzzy set includes at least one fuzzy dataset; the fuzzy dataset represents the probability value of the abnormal probability data belonging to the fuzziness degree; the fuzziness degree represents the different degrees of probability of the abnormal result corresponding to the abnormal probability data occurring;
[0192] A logical algorithm is used to combine the fuzzy datasets in the abnormal fuzzy set to obtain the health set; whereby the health set represents the set of health levels of the abnormal probability data.
[0193] The health score is determined based on the abnormal fuzzy set, the health score set, and the preset weights.
[0194] In one possible implementation, the determining module 4032 includes:
[0195] The abnormal probability data, health score, and preset action library are processed using the deep Q-model to obtain an operation score set. The operation score set includes at least one operation action and its score. The operation action score represents the reliability of communication unit communication recovery by executing the operation action.
[0196] Select operation actions with scores greater than or equal to a preset threshold from the operation score set, and determine the operation action as a communication recovery operation.
[0197] In one possible implementation, prior to execution module 403, device 40 further includes:
[0198] Alarm module 404 is used to determine a security score based on the security factor in the communication recovery operation; the security score characterizes the security level of the communication recovery operation.
[0199] If the security score is less than a preset threshold, an anomaly alert will be sent to the user.
[0200] In one possible implementation, prior to the processing module 402, the device 40 further includes:
[0201] The preprocessing module 405 is used to perform one or more of the following data preprocessing on the message data: message data decoding, message data cleaning, message data normalization, and message data reassembly.
[0202] This embodiment provides an automatic recovery device for abnormal communication of distribution network terminals, which can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0203] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 5 As shown, the electronic device 50 provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the device 50 further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504.
[0204] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to perform the above-described method.
[0205] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0206] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0207] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0208] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0209] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0210] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0211] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0212] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0213] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0214] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0215] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0216] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0217] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0218] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. An automatic recovery method for communication anomalies in distribution network terminals, characterized in that, include: Obtain message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period; The message data is processed based on an intelligent network model to obtain anomaly probability data; wherein, the anomaly probability data represents the probability value of the message data being at least one type of anomaly. Based on the abnormal probability data and the preset action library, a communication recovery operation is determined; and a recovery instruction for the communication recovery operation is generated and executed to restore normal communication between the communication unit of the distribution network terminal and the distribution network master station. The preset action library represents the communication recovery operation under abnormal results corresponding to abnormal probability data; the communication recovery operation represents the recovery operation that can be used for the communication unit of the distribution network terminal to restore normal communication between the communication unit of the distribution network terminal and the distribution network master station.
2. The method according to claim 1, characterized in that, The message data is processed based on an intelligent network model to obtain anomaly probability data, including: The message data is dimensionality reduced using the convolutional neural network in the intelligent network model to obtain message spatial features; wherein, the message spatial features characterize the spatial structure features of the message data. Based on the Long Short-Term Memory network in the intelligent network model, the spatial features of the message are processed to obtain anomaly probability data.
3. The method according to claim 1, characterized in that, Based on the aforementioned anomaly probability data and a preset action library, the communication recovery operation is determined, including: The abnormal probability data is fuzzified to obtain the health score of the communication unit; wherein the health score represents the health level of the communication unit. The communication recovery operation is determined based on the anomaly probability data, the health score, and the preset action library.
4. The method according to claim 3, characterized in that, The abnormal probability data is fuzzed to obtain the health score of the communication unit, including: The abnormal probability data is fuzzified according to the trapezoidal membership degree to obtain an abnormal fuzzy set; wherein, the abnormal fuzzy set includes at least one fuzzy dataset; the fuzzy dataset represents the probability value of the abnormal probability data belonging to the fuzziness level; the fuzziness level represents the different degrees of probability of the abnormal result corresponding to the abnormal probability data occurring; A logical algorithm is used to combine the fuzzy datasets in the abnormal fuzzy set to obtain a health set; wherein, the health set represents the set of health levels of the abnormal probability data; The health score is determined based on the abnormal fuzzy set, the health score set, and the preset weight.
5. The method according to claim 3, characterized in that, Based on the anomaly probability data, the health score, and the preset action library, the communication recovery operation is determined, including: The abnormal probability data, the health score, and the preset action library are processed according to the deep Q model to obtain an operation score set; wherein, the operation score set includes at least one operation action and an operation action score; the operation action score represents the reliability of the communication unit in restoring communication by performing the operation action; The operation actions with scores greater than or equal to a preset threshold are selected from the set of operation scores, and the operation action is determined to be the communication recovery operation.
6. The method according to any one of claims 1-5, characterized in that, Before generating the recovery instruction for the communication recovery operation, the method further includes: A security score is determined based on the security factor in the communication recovery operation; the security score characterizes the degree of security of the communication recovery operation. If the security score is less than a preset threshold, an abnormality alert will be issued to the user.
7. The method according to any one of claims 1-5, characterized in that, Before processing the message data based on the intelligent network model to obtain the anomaly probability data, the method further includes: The message data is subjected to one or more of the following data preprocessing: message data decoding, message data cleaning, message data normalization, and message data reassembly.
8. An automatic recovery device for communication anomalies in distribution network terminals, characterized in that, include: The acquisition module is used to acquire message data between the communication unit of the distribution network terminal and the distribution network master station within a preset time period; The processing module is used to process the message data based on the intelligent network model to obtain anomaly probability data; wherein the anomaly probability data represents the probability value of the message data being at least one type of anomaly. The execution module is used to determine the communication recovery operation based on the abnormality probability data and the preset action library; and to generate the recovery instruction for the communication recovery operation and execute the recovery instruction so that normal communication is restored between the communication unit of the distribution network terminal and the distribution network master station. The preset action library represents the communication recovery operation under abnormal results corresponding to abnormal probability data; the communication recovery operation represents the recovery operation that can be used for the communication unit of the distribution network terminal to restore normal communication between the communication unit of the distribution network terminal and the distribution network master station.
9. An electronic device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.