Power monitoring system data anomaly detection method based on sequence coding

By transforming the data of the power monitoring system into a fixed -length character sequence and quantitative processing, combined with the perceptual model and classification model, the traditional method is solved in the problem of low efficiency and poor effect in the data monitoring system data abnormal detection. More efficient and accurate abnormal detection.

CN119337262APending Publication Date: 2025-01-21STATE GRID INFORMATION & TELECOMM BRANCH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411222198.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

When traditional deep learning methods process data of power monitoring system, they have low processing efficiency, poor versatility, and poor abnormality detection effect.

Method used

A data anomaly detection method for power monitoring systems based on sequence coding is designed. By converting the data into a fixed-length character sequence, tensorization processing is performed, and the perceptron model and classification model are used to detect abnormal states.

Benefits of technology

This method occupies less resources, has higher performance, can detect power system anomalies more accurately, and improves processing efficiency and model generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119337262A_ABST
    Figure CN119337262A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power monitoring system data anomaly detection method based on sequence coding. The method comprises the following steps: converting data into a character sequence with a fixed length; carrying out tensorization on the character sequence to obtain detection data; and setting a detection model, inputting the detection data into the detection model, and outputting a data abnormal state by the detection model. The method disclosed by the invention has relatively high accuracy on anomaly detection of the power system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a data anomaly detection method for an electric power monitoring system based on sequence coding, and belongs to the technical field of artificial intelligence. Background Art

[0002] The data from the power monitoring system has the characteristics of a large number of features and irregular shapes. When processing such data, traditional deep learning methods have low processing efficiency and poor versatility. They require a large amount of data processing and feature extraction, and the anomaly detection effect is not good.

[0003] Therefore, it is necessary to further study the existing data anomaly detection methods of power monitoring systems to solve the above problems. Summary of the invention

[0004] In order to overcome the above problems, the inventors conducted in-depth research and designed a method for detecting abnormality of table data in a power monitoring system based on sequence coding, which includes the following steps:

[0005] S1, convert the data into a fixed-length character sequence;

[0006] S2, tensorizing the character sequence to obtain detection data;

[0007] S3. Set up a detection model, input the detection data into the detection model, and let the detection model output the data abnormal status.

[0008] In a preferred embodiment, in S1, each field in each cell is converted into characters of a fixed length, and the characters converted from the fields in each cell are sequentially connected to form a character sequence.

[0009] In a preferred embodiment, the converted fixed-length character representation is:

[0010] S j =encode9f j ,L,P)

[0011] Among them, S j represents the character after the j-th field is converted, encode(·) represents the encoding process, L represents the fixed length, and P represents the placeholder for padding.

[0012] In a preferred embodiment, when f j The character length of f is less than L. j Add placeholders until the total length reaches L; when f j If the character length is greater than or equal to L, then f is intercepted j The first L characters of .

[0013] In a preferred embodiment, when there is no data in a cell or the cell is marked as missing data, the data in the cell is represented as a sequence of length L consisting of placeholders.

[0014] In a preferred embodiment, before S1, there is S0 to replace the inseparable name with a preset code.

[0015] In a preferred embodiment, in S2, the character sequence X is encoded using one-hot encoding. i Any converted character S j Convert it into a V-dimensional vector, where V represents the size of the vocabulary, and obtain the detection data.

[0016] In a preferred embodiment, in S3, the detection model includes a perceptron model and a classification model, the detection data is input into the perceptron model, the output result of the perceptron model is used as the input of the classification model, and the classification model outputs the data abnormality state;

[0017] The perceptron model includes a plurality of residual blocks, and the plurality of residual blocks are connected in sequence.

[0018] The residual block includes a first component and a second component, and a residual connection is performed between the first component and the second component. The first component includes a first linear layer, a first normalization layer, an activation function layer and a dropout layer connected in sequence, and the second component includes a second linear layer and a second normalization layer.

[0019] The present invention also provides an electronic device, comprising:

[0020] at least one processor; and

[0021] A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the methods described above.

[0022] The present invention also provides a computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute any method described in any one of the above.

[0023] The beneficial effects of the present invention include:

[0024] (1) Fewer resources and higher performance: Compared with the commonly used large-scale language models, the method in the present invention occupies less computing and training resources;

[0025] (2) It has high accuracy in detecting power system anomalies. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flow chart of a method for detecting data anomalies in a power monitoring system based on sequence coding according to a preferred embodiment of the present invention is shown. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below through the accompanying drawings and embodiments. Through these descriptions, the characteristics and advantages of the present invention will become more clear and distinct.

[0028] The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise noted.

[0029] The present invention provides a method for detecting abnormal data in a power monitoring system based on sequence coding, such as Figure 1 As shown, the following steps are included:

[0030] S1, convert the data into a fixed-length character sequence;

[0031] S2, tensorizing the character sequence to obtain detection data;

[0032] S3. Set up a detection model, input the detection data into the detection model, and let the detection model output the data abnormal status.

[0033] The data of the power monitoring system is generally stored in a table. When processing the table data, each cell has its unique identity information, such as sample number, timestamp or other unique attributes. These identity information are crucial to distinguishing different samples and understanding the context of the data. How to efficiently encode these data without losing the identity information is a challenge. In the present invention, the loss of input identity information is avoided by changing the characters with fixed length. This method can not only maintain the integrity of the input data, but also simplify the function of detection model learning. In this way, the detection model can be directly applied to context-free input (consisting of only one hot vector) without relying on pre-embedded information.

[0034] In S1, for the power monitoring system data, each record therein is converted into a character of fixed length, and then combined into a character sequence.

[0035] According to the present invention, the power monitoring system data D can be expressed as D = {d1, d2, ..., d i ,…,d N}, where d irepresents the data in the i-th cell in the power monitoring system data, and N represents the total number of cells in the power monitoring system data.

[0036] Furthermore, each cell contains multiple field data, represented by d i ={f1,f2,…,f M}, where f j represents the value of the jth field, and M represents the total number of fields.

[0037] According to the present invention, the converted fixed-length character representation is:

[0038] S j =encode(f j ,L,P)

[0039] Among them, S j represents the character after the j-th field is converted, encode(·) represents the encoding process, L represents the fixed length, and P represents the placeholder for padding.

[0040] In the encoding process, when f j The character length of f is less than L. j Add placeholders until the total length reaches L; when f j If the character length is greater than or equal to L, then f is intercepted j The first L characters of .

[0041] Preferably, when there is no data in a cell or it is marked as missing data (for example, marked as "none", "missing", "null", etc.), that is, when the data is missing, the data in the cell is represented as a sequence of length L consisting of placeholders.

[0042] Furthermore, the characters converted from the fields in each cell are sequentially connected to form a character sequence, which is expressed as:

[0043] X i =S1⊕S2⊕…⊕S N

[0044] Among them, X i Represents the character sequence formed by the transformation of the i-th cell, N represents the total number of fields in the cell, and ⊕ represents the concatenation operation.

[0045] Through the above transformation, the fields in each cell are converted into a sequence S of length L. j, which not only preserves the identity and structure of each field within a cell, but also allows the model to learn and recognize complex patterns in the data, including those that may be ignored by traditional processing methods due to missing data or inconsistent formats; in addition, this approach reduces the complexity of the preprocessing steps, enabling the model to learn directly from the raw data, improving processing efficiency and the generalization ability of the model.

[0046] Preferably, the placeholder is selected as ¤ (currency symbol, Unicode code: 00A4). This character appears very rarely in ordinary text because it is mainly used to represent a general currency symbol rather than a specific currency unit. In most cases, people will use specific currency symbols, such as $, €, ¥, etc., instead of using this universal currency symbol. This symbol is used to occupy the blank position of the fixed-length character, so that each field has a fixed-length input.

[0047] Preferably, a separator is used to separate fixed-length characters, which can improve the readability of the character encoding and provide an obvious separator for the sequence encoding. Preferably, the separator is | (broken vertical bar, Unicode code: 00A6). The broken vertical bar character rarely appears in ordinary text because it has no clear semantic meaning. It is mainly used in specific text formats or programming languages. This symbol will not be used in power systems.

[0048] Preferably, before S1, there is S0 to replace the inseparable name with a preset code.

[0049] The inseparable name refers to a proper noun in the power monitoring system, such as transformer, fuse, etc.

[0050] Replacing inseparable names with preset codes can improve the model's recognition accuracy for special nouns, while reducing the number of fields in a cell and improving detection efficiency.

[0051] In S2, the character sequence X is encoded using one-hot encoding. i Any converted character S j Transformed into a V-dimensional vector, where V represents the size of the vocabulary, and the detection data T is obtained. Since the converted character S j The length of is a fixed length L, and the total number of fields in the cell is N, then the dimension of the detection data T is N×L×V.

[0052] Preferably, when there is no data in the cell or it is marked as missing data, the tensor is set to an all-zero matrix. This not only maintains the fixed-length encoding of the input, but also allows the model to maintain a consistent processing method when receiving incomplete data.

[0053] Using this mapping method, the detection model can learn data patterns and relationships directly from the detection data T. By learning how to map these high-dimensional encoded inputs to the desired outputs, the detection model can automatically perform the tasks of feature extraction and key information identification without manually specifying rules or performing explicit feature engineering. For anomaly detection of power operation and maintenance data, the detection model can learn to identify subtle differences between normal and abnormal data, and even distinguish between normal and abnormal data without explicit labels indicating the type of anomaly.

[0054] In traditional machine learning, every time you add or subtract input features from a dataset, you need to consider multiple choices about how to represent the input, such as whether to use normalization for continuous variables, whether to use embedding for high-dimensional categorical variables, and whether to perform specific types of data cleaning. In the present invention, we rely on input representation of fixed-length character sequences so that adding or subtracting input data does not change the training method, model, or preprocessing steps.

[0055] In S3, the detection model includes a perceptron model and a classification model, the detection data is input into the perceptron model, the output result of the perceptron model is used as the input of the classification model, and the classification model outputs the data abnormal state.

[0056] Both the perceptron model and the classification model are commonly used neural network models, and those skilled in the art can select them according to actual needs. For example, the classification model uses a binary classification head of a fully connected layer.

[0057] Preferably, the perceptron model is different from a traditional multi-layer perceptron, and improves the performance of a traditional multi-layer perceptron (MLP) in processing complex and high-dimensional data by introducing residual connections.

[0058] Specifically, the perceptron model includes a plurality of residual blocks, and the plurality of residual blocks are connected in sequence.

[0059] The residual block includes a first component and a second component, and a residual connection is performed between the first component and the second component. The first component includes a first linear layer, a first normalization layer, an activation function layer and a dropout layer connected in sequence, and the second component includes a second linear layer and a second normalization layer.

[0060] Among them, the first linear layer and the second linear layer perform the following linear transformation:

[0061]

[0062] ω is the weight matrix, b is the bias vector, and x is the input of the linear layer. is the output of the linear layer.

[0063] The first normalization layer and the second normalization layer respectively normalize the outputs of the first linear layer and the second linear layer so that the mean of the outputs is 0 and the standard deviation is 1. This normalization helps to speed up the training, improve the stability of the model, and reduce the sensitivity of the model to poor initial weights.

[0064] Preferably, the activation function layer adopts the ReLU activation function to ensure that the gradient vanishing problem is solved while maintaining nonlinearity and providing the sparse activation properties of the model.

[0065] The dropout layer randomly discards the output of some neurons during the training process to prevent the model from overfitting.

[0066] The perceptron model provided in the present invention improves the performance of traditional multi-layer perceptrons in processing complex and high-dimensional data by introducing residual connections, solves the gradient vanishing problem in the deep network training process, and improves the generalization ability of the model. By implementing batch normalization and a direct path after the activation function in each residual block, the learning efficiency and accuracy are significantly improved without adding additional computational burden.

[0067] According to the present invention, during the training process, a labeled data set is used, in which the label of normal samples is 0 and the label of abnormal samples is 1. The detection model continuously adjusts its parameters by minimizing the classification loss function in order to find the optimal decision boundary in the feature space. This supervised learning method can effectively capture the inherent pattern of the data and has a strong recognition ability for abnormal samples.

[0068] In the inference stage, the sample to be tested is input into the trained detection model after S1 and S2, and a probability value is output, indicating the confidence that the sample belongs to the abnormal category. By setting a threshold, the sample is judged whether it is abnormal based on the confidence level. This decision-making method based on probability output is more flexible, and the threshold can be adjusted according to actual needs to control the sensitivity and specificity of the detection model.

[0069] Various embodiments of the method described above in the present invention can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0070] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0071] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0072] To provide interaction with a user, the methods and apparatus described herein may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0073] The methods and apparatus described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0074] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0075] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in the present disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document is not limited here.

[0076] Example

[0077] Example 1

[0078] Using a power system table data, 80% of it is used as a training set and 20% as a validation set, a simulation experiment is conducted, including the following steps:

[0079] S1, convert the data into a fixed-length character sequence;

[0080] S2, tensorizing the character sequence to obtain detection data;

[0081] S3. Set up a detection model, input the detection data into the detection model, and let the detection model output the data abnormal status.

[0082] In S1, each field in each cell is converted into characters of a fixed length, and the characters converted from the fields in each cell are connected in sequence to form a character sequence.

[0083] The converted fixed-length character representation is:

[0084] s j =encode(f j ,L,P)

[0085] Among them, S j represents the character after the j-th field is converted, encode(·) represents the encoding process, L represents the fixed length, and P represents the placeholder for padding.

[0086] When f j The character length of f is less than L. j Add placeholders until the total length reaches L; when f j If the character length is greater than or equal to L, then f is intercepted j The first L characters of .

[0087] When there is no data in a cell or it is marked as missing data, the data in the cell is represented as a sequence of length L consisting of placeholders.

[0088] In S2, the character sequence X is encoded using one-hot encoding. i Any converted character S j Convert it into a V-dimensional vector, where V represents the size of the vocabulary, and obtain the detection data.

[0089] In S3, the detection model includes a perceptron model and a classification model, the detection data is input into the perceptron model, the output result of the perceptron model is used as the input of the classification model, and the classification model outputs the data abnormality state;

[0090] The perceptron model includes a plurality of residual blocks, and the plurality of residual blocks are connected in sequence.

[0091] The residual block includes a first component and a second component, and a residual connection is performed between the first component and the second component. The first component includes a first linear layer, a first normalization layer, an activation function layer and a dropout layer connected in sequence, and the second component includes a second linear layer and a second normalization layer.

[0092] Comparative Example 1

[0093] The same power system data as in Example 1 was used to conduct anomaly detection experiments, and a fully connected neural network multilayer perceptron model and a transformer model were used to directly perform anomaly detection on the power system table.

[0094] The test results of Example 1 and Comparative Example 1 are compared, as shown in Table 1.

[0095] Table 1

[0096]

[0097] As can be seen from Table 1, although the method in Example 1 consumes more time than the fully connected neural network multi-layer perceptron model in Comparative Example 1, its accuracy is greatly improved.

[0098] The present invention has been described above in conjunction with preferred embodiments, but these embodiments are only exemplary and serve only as an illustration. On this basis, the present invention may be subjected to a variety of substitutions and improvements, all of which fall within the scope of protection of the present invention.

Claims

1. A method for detecting data anomalies in a power monitoring system based on sequence coding, characterized in that: The following steps are involved: S1, convert the data into a fixed-length character sequence; S2, tensorizing the character sequence to obtain detection data; S3. Set up a detection model, input the detection data into the detection model, and let the detection model output the data abnormal status.

2. The method for detecting anomaly in data of a power monitoring system based on sequence coding according to claim 1, characterized in that: In S1, each field in each cell is converted into characters of a fixed length, and the characters converted from the fields in each cell are connected in sequence to form a character sequence.

3. The method for detecting data anomaly in a power monitoring system based on sequence coding according to claim 2, characterized in that: The converted fixed-length character representation is: S j =encode(f j ,L,P) Among them, S j represents the character after the j-th field is converted, encode(·) represents the encoding process, L represents the fixed length, and P represents the placeholder for padding.

4. The method for detecting data anomaly in a power monitoring system based on sequence coding according to claim 3 is characterized in that: When f j The character length of f is less than L. j Add placeholders until the total length reaches L; when f j If the character length is greater than or equal to L, then f is intercepted j The first L characters of .

5. The method for detecting data anomaly in a power monitoring system based on sequence coding according to claim 1, characterized in that: When there is no data in a cell or it is marked as missing data, the data in the cell is represented as a sequence of length L consisting of placeholders.

6. The method for detecting data anomalies in a power monitoring system based on sequence coding according to claim 1, characterized in that: Before S1, there was S0, which replaced the inseparable names with preset codes.

7. The method for detecting data anomalies in a power monitoring system based on sequence coding according to claim 1, characterized in that: In S2, the character sequence X is encoded using one-hot encoding. i Any converted character S j Convert it into a V-dimensional vector, where V represents the size of the vocabulary, and obtain the detection data.

8. The method for detecting data anomalies in a power monitoring system based on sequence coding according to claim 1, characterized in that: In S3, the detection model includes a perceptron model and a classification model, the detection data is input into the perceptron model, the output result of the perceptron model is used as the input of the classification model, and the classification model outputs the data abnormality state; The perceptron model includes a plurality of residual blocks, and the plurality of residual blocks are connected in sequence. The residual block includes a first component and a second component, and a residual connection is performed between the first component and the second component. The first component includes a first linear layer, a first normalization layer, an activation function layer and a dropout layer connected in sequence, and the second component includes a second linear layer and a second normalization layer.

9. An electronic device, comprising: at least one processor; as well as A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can execute the method of any one of claims 1-8.

10. A computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.