Training method of threshold prediction model and operation state detection method of power system
By training the threshold prediction model, the target score threshold in power system detection is dynamically adjusted, which solves the misjudgment problem caused by the solidification threshold in traditional methods and improves the accuracy of operating state detection.
Patent Information
- Application Number
- CN202510022502.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-09
AI Technical Summary
The traditional power system operating status detection method relies on the solidification threshold set by operation and maintenance personnel experience, resulting in frequent misjudgment and reducing the accuracy of detection.
The training method of the threshold prediction model is adopted. By obtaining the sample timing data and operating status marks of the power system, the threshold prediction model is trained to dynamically adjust the target score threshold to improve detection accuracy.
It realizes the flexible setting of target scoring thresholds in the power system operating status detection, reducing the error judgment rate and improving the accuracy of detection.
Smart Images

Figure CN119962703A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method for a threshold prediction model and a method for detecting the operating status of an electric power system. Background Art
[0002] Abnormal events may occur during the operation of the power system, such as cable failure, equipment damage, abnormal power quality, etc. These abnormal events will have an adverse impact on the safe and stable operation of the power system. Therefore, it is necessary to detect the operating status of the power system. At present, the traditional anomaly detection method generally introduces a threshold set by the operation and maintenance personnel based on experience, and obtains the detection result by comparing the detection data with this threshold. However, the threshold set in this way is too rigid, which makes it easy to make misjudgments during the operation status detection, reducing the accuracy of the operation status detection. Summary of the invention
[0003] The following is a summary of the subject matter of the detailed description of the present disclosure. This summary is not intended to limit the scope of the claims.
[0004] The embodiments of the present disclosure provide a method for training a threshold prediction model and a method for detecting the operating status of an electric power system, which can flexibly set a target scoring threshold and improve the accuracy of detecting the operating status of the electric power system.
[0005] On the one hand, an embodiment of the present disclosure provides a method for training a threshold prediction model, comprising:
[0006] Acquire sample time series data of the power system at a sample time point, and acquire an operation status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point;
[0007] Inputting the sample time series data into a threshold prediction model to perform threshold prediction, and obtaining a sample score threshold at the sample time point;
[0008] Determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system according to a comparison result of the sample anomaly score and the sample score threshold, and determine a false discovery rate according to the sample operating state and the operating state mark;
[0009] The threshold prediction model is trained with the optimization goal of keeping the false discovery rate less than or equal to a preset threshold.
[0010] On the other hand, an embodiment of the present disclosure provides a method for detecting an operating state of an electric power system, comprising:
[0011] During the operation of the power system, whenever an observation time point is reached, target time series data of the power system at the observation time point is obtained, wherein the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point;
[0012] Inputting the target time series data into a threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point, wherein the threshold prediction model is trained by the above-mentioned training method;
[0013] A target anomaly score of the power system at the observation time point is determined, and a target operating state of the power system is determined according to a comparison result of the target anomaly score and the target score threshold.
[0014] On the other hand, the embodiment of the present disclosure further provides a training device for a threshold prediction model, comprising:
[0015] A first data acquisition module is used to acquire sample time series data of the power system at a sample time point, and acquire an operation status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point;
[0016] A first prediction module, used for inputting the sample time series data into a threshold prediction model to perform threshold prediction, and obtain a sample score threshold at the sample time point;
[0017] A first scoring module is used to determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system according to a comparison result of the sample anomaly score and the sample scoring threshold, and determine a false discovery rate according to the sample operating state and the operating state mark;
[0018] A training module is used to train the threshold prediction model by keeping the false discovery rate less than or equal to a preset threshold as an optimization goal.
[0019] Furthermore, the number of the sample time points is multiple, and the above training module is specifically used for:
[0020] Creating an objective function, wherein the objective function is used to indicate the number of time points at which the sample operation status is abnormal among the plurality of sample time points;
[0021] The threshold prediction model is trained with the optimization goal of maximizing the objective function and keeping the false discovery rate less than or equal to a preset threshold.
[0022] Furthermore, the above training module is specifically used for:
[0023] respectively configuring an indication function for each of the sample time points, wherein the indication function is configured to satisfy a constraint condition when the sample operation state is abnormal operation;
[0024] An objective function is created according to the sum of the indicator functions at a plurality of the sample time points.
[0025] Furthermore, the first data acquisition module is specifically used for:
[0026] Acquire sample time series data of the power system at a plurality of sample time points through a preset sliding window;
[0027] The window size of the sliding window is equal to an operation cycle of the power system.
[0028] Furthermore, the first data acquisition module is specifically used for:
[0029] Acquire sample time series data of the power system at a plurality of sample time points through a preset first sliding window, wherein a window size of the first sliding window is equal to a diurnal operation cycle of the power system;
[0030] The sample time series data of the power system at the plurality of sample time points is acquired through a preset second sliding window, wherein the window size of the second sliding window is equal to a seasonal operation cycle of the power system.
[0031] Furthermore, the first prediction module is specifically used for:
[0032] Inputting the sample time series data obtained through the first sliding window and the sample time series data obtained through the second sliding window into the threshold prediction model;
[0033] The first convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a first convolution feature, and the first convolution unit performs convolution processing on the sample time series data obtained through the second sliding window to obtain a second convolution feature;
[0034] A mean convolution feature is obtained according to the average value of the first convolution feature and the second convolution feature, and a threshold prediction is performed based on the mean convolution feature to obtain a sample score threshold at the sample time point.
[0035] Furthermore, the first prediction module is specifically used for:
[0036] The second convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a third convolution feature, and the third convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the second sliding window to obtain a fourth convolution feature, wherein the convolution kernel sizes of the second convolution unit and the third convolution unit are different;
[0037] Concatenating the third convolution feature with the fourth convolution feature to obtain a concatenated convolution feature;
[0038] A mean convolution feature is obtained according to the average value of the first convolution feature, the second convolution feature and the concatenated convolution feature.
[0039] Furthermore, the sliding window is periodically configured as a training sliding window and a verification sliding window when sliding, and the threshold prediction model is trained in the training sliding window. The training device of the threshold prediction model further includes a verification module, which is specifically used to:
[0040] In the next verification sliding window adjacent to the training sliding window, the sample time series data and the running state mark at the sample time point are obtained, the sample running state is determined based on the sample time series data, and the performance of the threshold prediction model trained in the training sliding window is verified according to the difference between the sample running state and the running state mark;
[0041] When the performance verification result indicates that the performance of the threshold prediction model is abnormal, in the next training sliding window adjacent to the verification sliding window, the structure of the threshold prediction model or the training strategy of the threshold prediction model is adjusted, and then the threshold prediction model is trained again.
[0042] Furthermore, the first data acquisition module is specifically used for:
[0043] Acquire first time series data and second time series data of the power system at a plurality of sample time points through a preset sliding window, wherein the first time series data includes detection data of the power system's own parameters when the power system is running, and the second time series data includes detection data of the power system's environmental parameters when the power system is running;
[0044] The first time series data and the second time series data are combined into sample time series data.
[0045] Furthermore, the first data acquisition module is specifically used for:
[0046] Converting the timestamps in the first time series data and the second time series data according to the sliding window;
[0047] The converted first time series data and the converted second time series data are combined into sample time series data.
[0048] On the other hand, the embodiment of the present disclosure further provides an operating status detection device for an electric power system, comprising:
[0049] A second data acquisition module is used to acquire target time series data of the power system at the observation time point whenever the observation time point is reached during the operation of the power system, wherein the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point;
[0050] A second prediction module is used to input the target time series data into a threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point, wherein the threshold prediction model is trained by the above-mentioned training method;
[0051] The second scoring module is used to determine a target abnormality score of the power system at the observation time point, and determine a target operating state of the power system according to a comparison result between the target abnormality score and the target score threshold.
[0052] On the other hand, an embodiment of the present disclosure also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the above-mentioned threshold prediction model training method, or implements the above-mentioned power system operation status detection method.
[0053] On the other hand, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above-mentioned threshold prediction model training method, or to implement the above-mentioned power system operation status detection method.
[0054] On the other hand, the embodiment of the present disclosure further provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the training method for implementing the above-mentioned threshold prediction model, or implements the above-mentioned operation status detection method of the power system.
[0055] The disclosed embodiments include at least the following beneficial effects: by acquiring sample time series data of the power system at a sample time point, an operating status mark of the power system at the sample time point is acquired; since the sample time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the sample time series data can more accurately detect the operating status of the power system; on this basis, by inputting the sample time series data into a threshold prediction model for threshold prediction, a sample score threshold at the sample time point is obtained; by determining the sample anomaly score of the power system at the sample time point, the sample operating status of the power system is determined according to the comparison result between the sample anomaly score and the sample score threshold; and the sample operating status of the power system is determined according to the sample operating status and the operating status mark. The error detection rate is determined to keep the error detection rate less than or equal to the preset threshold as the optimization target for training the threshold prediction model. When the power system is subsequently tested for the operating status, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as the optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the power system is tested for the operating status, the present disclosure can simultaneously realize the flexible setting of the target scoring threshold and the control of the error detection rate, thereby effectively improving the accuracy of the operating status detection.
[0056] Other features and advantages of the present disclosure will be set forth in the following description, and in part will be apparent from the description, or may be learned by practicing the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0058] Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present disclosure;
[0059] Figure 2 An optional flowchart of a method for training a threshold prediction model provided in an embodiment of the present disclosure;
[0060] Figure 3 An optional flow chart of determining an optimization target provided in an embodiment of the present disclosure;
[0061] Figure 4 A schematic diagram of an optional flow chart for determining a sample scoring threshold provided in an embodiment of the present disclosure;
[0062] Figure 5Another optional flow chart of determining a sample scoring threshold provided in an embodiment of the present disclosure;
[0063] Figure 6 A schematic diagram of an optional flow chart of a method for detecting an operating state of an electric power system provided in an embodiment of the present disclosure;
[0064] Figure 7 An optional structural diagram of a training device for a threshold prediction model provided in an embodiment of the present disclosure;
[0065] Figure 8 An optional structural diagram of an operating status detection device for a power system provided in an embodiment of the present disclosure;
[0066] Fig. 9 A partial structural block diagram of a terminal provided in an embodiment of the present disclosure;
[0067] Fig.10 A partial structural block diagram of a server provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0069] It should be noted that in various specific embodiments of the present disclosure, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. Among them, the target object can be a user. In addition, when the embodiment of the present disclosure needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present disclosure will be obtained.
[0070] In the embodiments of the present disclosure, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0071] At present, traditional anomaly detection methods generally introduce thresholds set by operation and maintenance personnel based on experience, and obtain detection results by comparing the detection data with this threshold. However, the threshold set in this way is too rigid, which makes it easy to misjudge during operation status detection, reducing the accuracy of operation status detection.
[0072] Based on this, the embodiments of the present disclosure provide a training method for a threshold prediction model and a method for detecting the operating status of an electric power system, which can flexibly set the target scoring threshold and improve the accuracy of detecting the operating status of the electric power system.
[0073] Reference Figure 1 , Figure 1 A schematic diagram of an optional implementation environment provided for an embodiment of the present disclosure, the implementation environment includes a terminal 101 and a server 102, wherein the terminal 101 and the server 102 are connected via a communication network.
[0074] Exemplarily, during the training phase, the server 102 may obtain sample time series data of the power system at a sample time point, and obtain an operating status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point; input the sample time series data into a threshold prediction model for threshold prediction to obtain a sample score threshold at the sample time point; determine a sample anomaly score of the power system at the sample time point, determine a sample operating status of the power system based on a comparison result of the sample anomaly score and the sample score threshold, and determine an error discovery rate based on the sample operating status and the operating status mark; so as to keep the error discovery rate less than or equal to a preset value. The threshold prediction model is trained with the threshold as the optimization target; in the inference stage, during the operation of the power system, whenever an observation time point is reached, the server 102 can obtain the target time series data of the power system at the observation time point sent by the terminal 101, wherein the target time series data includes the detection data of the power system at the observation time point and the detection data at the time point before the observation time point; the target time series data is input into the threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point; the target abnormality score of the power system at the observation time point is determined, and the target operation state of the power system is determined according to the comparison result of the target abnormality score and the target score threshold; the server 102 sends the target operation state to the terminal 101.
[0075] The server 102 obtains the sample time series data of the power system at the sample time point and obtains the operating status mark of the power system at the sample time point. Since the sample time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the sample time series data can more accurately detect the operating status of the power system. On this basis, the sample time series data is input into the threshold prediction model for threshold prediction to obtain the sample score threshold at the sample time point. The sample anomaly score of the power system at the sample time point is determined, and the sample operating status of the power system is determined according to the comparison result of the sample anomaly score and the sample score threshold. The error occurrence is determined according to the sample operating status and the operating status mark. The error detection rate is used to keep the error detection rate less than or equal to the preset threshold as the optimization target to train the threshold prediction model. When the power system is subsequently tested for the operating status, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as the optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the power system is tested for the operating status, the flexible setting of the target scoring threshold and the control of the error detection rate can be achieved at the same time, thereby effectively improving the accuracy of the operating status detection.
[0076] Server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In addition, server 102 can also be a node server in a blockchain network.
[0077] The terminal 101 may be a mobile phone, a computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal 101 and the server 102 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present disclosure.
[0078] Reference Figure 2 , Figure 2 An optional flow chart of a threshold prediction model training method provided in an embodiment of the present disclosure. The threshold prediction model training method can be executed by a server, or can also be executed by a terminal, or can also be executed by a server in conjunction with a terminal. The threshold prediction model training method includes but is not limited to the following steps 201 to 204.
[0079] Step 201: Acquire sample time series data of a power system at a sample time point, and acquire an operating status mark of the power system at the sample time point.
[0080] Among them, the sample time series data includes the detection data of the power system at the sample time point and the detection data at the time point before the sample time point. Therefore, the latest time point in the sample time series data is the sample time point. Specifically, the sample time series data is time series data composed of detection data detected in sequence at multiple time points, and the sample time point is the latest time point among the multiple time points.
[0081] Among them, the power system is an electric energy production and consumption system composed of power plants, transmission and transformation lines, power distribution stations and power consumption. The power system can be configured with a detection module to detect the detection data of the power system through the detection module.
[0082] It should be noted that the sample time series data can be an equally spaced time series, for example, multiple detection data in the sample time series data can be obtained by detection once every minute, and the sample time series data can also be an unequally spaced time series, for example, the detection data in the sample time series data are arranged in the order of time points, and the time interval between the time points of the detection data arranged in the front is larger, while the time interval between the time points of the detection data arranged in the back is smaller.
[0083] It can be understood that the sample time series data can reflect the time correlation between the detection data during the operation of the power system. The sample time series data can serve as the context information of the sample time point. The sample time series data can capture the intrinsic patterns and data changes of the data. The introduction of sample time series data can more accurately detect the operating status of the power system. The sample time series data can be determined in the following way: taking a time point of detection data as the sample time point, and then combining the detection data at the sample time point and the detection data at multiple adjacent time points before the sample time point to form the sample time series data.
[0084] Normally, the length of the sample time series data is equal to a preset length threshold. For example, assuming that the length threshold is 10, the detection data at the sample time point and the detection data at the 9 consecutive time points before the sample time point can be used to form the sample time series data, so that the length of the sample time series data is 10, that is, the sample time series data contains 10 detection data. It should be noted that when the number of detection data detected before the sample time point is insufficient, the length of the sample time series data is insufficient, and the sample time series data can be padded to ensure that the length of the sample time series data is fixed.
[0085] It is worth noting that the detection data is data that affects the operation of the power system. The detection data of the power system at a certain point in time can be regarded as a data point. Since the power system can detect multiple detection data at a certain point in time, a data point can include multiple detection data. For example, the detection data of the power system can include data on electrical parameters such as current and voltage. The detection data can also include data on machine operating parameters in industrial production processes. These detection data indicate the power system's own operating status. The detection data of the power system can also include data on environmental parameters such as time, temperature, and humidity. These detection data indicate the external environmental status of the power system.
[0086] Among them, the operating status mark is used to indicate the actual operating status of the power system at the sample time point. For example, the operating status mark may include a normal mark and an abnormal mark. The normal mark is used to indicate that the actual operating status is normal, and the abnormal mark is used to indicate that the actual operating status is abnormal. In the model training process, since the operating status mark is used as the correct reference for the predicted operating status, it is necessary to ensure the accuracy of the operating status mark, so as to improve the prediction accuracy of the threshold prediction model. The operating status mark can be manually marked or automatically marked by a machine. This is because in the power system, when an abnormal event occurs in the distribution network at a certain point in time, the time point at which the abnormal event occurs can be marked as abnormal, that is, the operating status mark at the time point is set to an abnormal mark. The abnormal event may be a cable failure, equipment damage, abnormal power quality, etc. These abnormal events have an adverse effect on the safe and stable operation of the power system, so it is necessary to promptly discover and resolve abnormal events.
[0087] Specifically, the sample timing data and the operating status mark can be obtained from the database of the server. For example, the server can obtain the detection data of the power system at multiple time points. Whenever one of the time points is determined as a sample time point, the server can combine the detection data of the power system at the sample time point and the detection data at the time point before the sample time point into sample timing data, and associate the sample timing data at the sample time point and the operating status mark at the sample time point with each other and store them in the database. When the server receives a training request, the server reads the sample timing data and the operating status mark from the database. The sample timing data and the operating status mark can also be obtained from the power system, which is not limited to the embodiments of the present disclosure.
[0088] It should be noted that in order to effectively calculate the error discovery rate later, it is necessary to obtain a sufficient number of sample time series data, that is, to obtain the sample time series data of the power system at multiple sample time points, and to obtain the operating status mark of each sample time point.
[0089] Step 202: Input the sample time series data into a threshold prediction model to perform threshold prediction, and obtain a sample score threshold at the sample time point.
[0090] Among them, the threshold prediction model is a neural network model used to predict continuous numerical values. For example, the threshold prediction model can adopt a deep neural network model, and the threshold prediction model can also adopt a regression model such as random forest regression and decision tree regression. It can predict the corresponding sample score threshold based on the input sample time series data, such as 0.051, 0.052 or 0.053.
[0091] It should be noted that the scoring threshold is used to determine whether the data has significant differences. For the power system, the detection data of the power system at a certain time point can be regarded as a data point, and the scoring threshold can be used to determine whether the data points of the power system have significant differences, that is, to determine whether the operating status of the power system is abnormal. When it is determined that the data points at any time point have significant differences, it means that the data point is an abnormal point, and it can be determined that the operating status of the power system at this time point is abnormal. When it is determined that the data points at any time point do not have significant differences, it means that the data point is not an abnormal point, and it can be determined that the operating status of the power system at this time point is not abnormal.
[0092] Specifically, since the sample scoring threshold at the sample time point is predicted by the threshold prediction model based on the sample time series data, the sample scoring threshold can match the sample time series data at the sample time point; and since the sample time series data at the sample time point can be the time series data at any time point, inputting the time series data at any time point into the threshold prediction model is equivalent to inputting the context information of the time point into the threshold prediction model, so that the threshold prediction model can predict the scoring threshold at the time point based on the context information at the time point, thereby realizing flexible setting of the scoring threshold.
[0093] It should be noted that after obtaining the sample time series data of the power system at multiple sample time points, it is necessary to determine the sample score threshold of each sample time point through the threshold prediction model.
[0094] Step 203: Determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system based on a comparison result of the sample anomaly score and the sample score threshold, and determine a false discovery rate based on the sample operating state and the operating state mark.
[0095] Among them, the sample anomaly score refers to the p-value of the detection data of the power system at the sample time point, that is, the p-value of the data point of the power system at the sample time point. The p-value is the probability of the sample observation result or more extreme result when the null hypothesis is true. If the p-value is very small, it means that the probability of the occurrence of extreme observation results under the null hypothesis is very small. If it occurs, according to the principle of small probability, there is reason to reject the null hypothesis. The smaller the p-value, the more sufficient the reason for rejecting the null hypothesis. Therefore, when the p-value is used for anomaly point detection, the p-value can be regarded as a measure of the degree of anomaly. At this time, the null hypothesis is "there is no significant difference between the operating state of the power system at this time point and the normal operating state". When the p-value is smaller, the more significant the result is, that is, the data point is more likely to be an anomaly point, and when the p-value is larger, the result is less significant, that is, the data point is less likely to be an anomaly point.
[0096] It should be noted that the p-value can also be called the significance value, and the sample score threshold is the significance level of the p-value, that is, the sample score threshold is the demarcation value of the sample anomaly score, and the sample anomaly score is compared with the sample score threshold. When the sample anomaly score is less than the sample score threshold, it is determined that the data point at the sample time point has a significant difference, and the data point representing the sample time point is an anomaly point. It can be determined that the sample operating state of the power system at the sample time point is an operating abnormality; and when the sample anomaly score is greater than or equal to the sample score threshold, it is determined that the data point at the sample time point does not have a significant difference, and the data point representing the sample time point is not an anomaly point. It can be determined that the sample operating state of the power system at the sample time point is not an operating abnormality.
[0097] Specifically, the sample anomaly score can be determined in a variety of ways, for example, determining the sample empirical distribution of the sample time series data at the sample time point, determining the sample sorting position of the detection data at the sample time point in the sample time series data, and determining the sample anomaly score at the sample time point based on the sample sorting position and the sample empirical distribution. The sample anomaly score can also be determined in other ways, which are not limited in the embodiments of the present disclosure.
[0098] It can be understood that during the model training process, after the sample score threshold at the sample time point is predicted by the threshold prediction model, the sample anomaly score at the sample time point can be compared with the sample score threshold. According to the comparison result, the sample operating state of the power system at the sample time point can be determined, which is equivalent to using the sample score threshold for operating state detection. Since the sample score threshold is predicted, the sample operating state can be used as the predicted operating state. The sample operating state can indicate whether the data point at the sample time point is the predicted result of the abnormal point. Since the operating state mark is used to indicate the actual operating state of the power system at the sample time point, the operating state mark is used as the correct reference for the sample operating state. The operating state mark can specifically indicate whether the data point at the sample time point is the actual result of the abnormal point. Therefore, according to the sample operating state and the operating state mark, the false discovery rate can be accurately determined.
[0099] Among them, the false discovery rate is an important indicator for evaluating the performance of the threshold prediction model. The false discovery rate is related to the practicality and efficiency of the model. The false discovery rate provides a measure of how many of all the anomalies claimed to be discovered are false.
[0100] Specifically, the false discovery rate can be determined in the following manner: during the training process, sample time series data of the power system at multiple sample time points are obtained, as well as the operating status mark of each sample time point. The sample score threshold of each sample time point is determined by the threshold prediction model, and then the sample abnormality score of each sample time point is determined, and then the sample operating status of the power system at each sample time point is determined, that is, the prediction result of whether the data points at multiple sample time points are abnormal points is determined. The operating status mark of the power system at each sample time point can also be obtained, that is, the actual result of whether the data points at each sample time point are abnormal points is obtained, and then the first number of all prediction results determined as abnormal points can be counted through the sample operating status, which is equivalent to determining the number of all abnormalities found.
[0101] Then, since the prediction result determined as an outlier may be wrong, the sample operating status can be matched with the corresponding operating status mark. When the sample operating status is the same as the operating status mark, the prediction result indicated by the sample operating status is correct, and when the sample operating status is different from the operating status mark, the prediction result indicated by the sample operating status is wrong. Therefore, based on the matching result, the second number of wrong results can be determined among all the prediction results determined as outliers, which is equivalent to determining the number of wrong predictions among all anomalies, that is, determining the number of false positives. The first number is specifically the sum of the number of true positives and the number of false positives, and then the ratio of the second number to the first number is determined as the false discovery rate.
[0102] Specifically, the calculation formula of the false discovery rate is as follows:
[0103] FDR=#False Positive / (#False Positive+#True Positive)
[0104] Among them, FDR is the false discovery rate, #False Positive is the number of false positives, and #True Positive is the number of true positives.
[0105] Step 204: Train the threshold prediction model with the optimization goal of keeping the false discovery rate less than or equal to a preset threshold.
[0106] It can be understood that by training the threshold prediction model, the threshold prediction model can learn to understand the time series data at any time point, so as to accurately predict the scoring threshold that matches the time series data at the current time point, thereby realizing adaptive adjustment of the scoring threshold.
[0107] In addition, by determining the sample operating status of the power system, it is possible to determine whether the operating status of the power system is abnormal, which is equivalent to performing anomaly detection on the power system. The false detection rate is specifically the proportion of samples that are not actually abnormal among all samples predicted to be abnormal. Keeping the false detection rate less than or equal to the preset threshold is used as the optimization goal, which is equivalent to taking the preset threshold as the upper limit of the false detection rate, so that the threshold prediction model can control the false detection rate when outputting the scoring threshold, thereby achieving precise control of the false detection rate. The power system can reduce unnecessary inspections or maintenance caused by false alarms, saving manpower and material resources, and accurate anomaly detection can ensure that alarms are issued or actions are taken only when necessary to avoid waste of resources.
[0108] Among them, keeping the false discovery rate less than or equal to the preset threshold is used as the optimization goal. The condition that the false discovery rate is less than or equal to the preset threshold can be used as a soft constraint, and added to the objective function through a penalty term, so that the model naturally tends to maintain a low false discovery rate during the training process.
[0109] Specifically, the preset threshold should not be set to a value that is too large, so as to avoid too many false positives in the results determined by using the scoring threshold for running status detection. The preset threshold should not be set to a value that is too small, so as to avoid too many false negatives in the results determined by using the scoring threshold for running status detection. For example, the preset threshold can be set to 0.05, thereby improving the reliability and practicality of running status detection and reducing false positives and false negatives caused by improper static threshold setting.
[0110] Based on this, by obtaining the sample time series data of the power system at the sample time point, the operating status mark of the power system at the sample time point is obtained. Since the sample time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of sample time series data can more accurately detect the operating status of the power system. On this basis, by inputting the sample time series data into the threshold prediction model for threshold prediction, the sample score threshold at the sample time point is obtained. By determining the sample anomaly score of the power system at the sample time point, the sample operating status of the power system is determined according to the comparison result of the sample anomaly score and the sample score threshold, and the error discovery rate is determined according to the sample operating status and the operating status mark. , the threshold prediction model is trained to keep the false discovery rate less than or equal to the preset threshold as the optimization target. When the power system is subsequently tested for the operating status, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, thereby flexibly setting the target scoring threshold. Moreover, since the false discovery rate is introduced as the optimization target in the training process of the threshold prediction model, the threshold prediction model can control the false discovery rate when outputting the target scoring threshold. It can be seen that when the power system is tested for the operating status, the present disclosure can simultaneously realize the flexible setting of the target scoring threshold and the control of the false discovery rate, thereby effectively improving the accuracy of the operating status detection.
[0111] In a possible implementation, the number of the sample time points is multiple, and the threshold prediction model is trained with the optimization goal of keeping the false discovery rate less than or equal to a preset threshold, which can specifically be to create an objective function; and the threshold prediction model is trained with the optimization goal of maximizing the objective function and keeping the false discovery rate less than or equal to the preset threshold.
[0112] Among them, the objective function is used to indicate the number of time points at which the sample operating status is abnormal operation among the multiple sample time points; during the training process, the sample operating status of the power system at multiple sample time points can be determined, and each time the sample operating status is determined to be abnormal operation, it means that an abnormality is found, and therefore, the number of time points at which the sample operating status is abnormal operation is equivalent to the number of abnormalities found.
[0113] Specifically, by using the optimization target to train the threshold prediction model, the model parameters of the threshold prediction model will be updated, thereby updating the sample scoring threshold output by the threshold prediction model, so that the updated sample scoring threshold can control the false discovery rate to be less than or equal to the preset threshold and maximize the number of anomalies found.
[0114] Based on this, by creating an objective function, since the objective function indicates the number of time points when the sample operating status is an operational abnormality, the objective function can indicate the number of anomalies found. While keeping the false discovery rate less than or equal to the preset threshold as the optimization goal, maximizing the objective function is also used as the optimization goal, which is equivalent to maximizing the number of anomalies found as the optimization goal. While controlling the false discovery rate, anomalies can be discovered as much as possible through the target score threshold output by the threshold prediction model, avoiding incorrectly marking operational anomalies as normal operation, thereby effectively reducing the number of false negatives in the results determined by the operating status detection.
[0115] In a possible implementation, the creating of the objective function may specifically be configuring an indicator function for each of the sample time points respectively; and creating the objective function according to the sum of the indicator functions of multiple sample time points.
[0116] Among them, the indicator function is configured to satisfy the constraint condition when the sample operating status is an abnormal operation. When the constraint condition is satisfied, the indicator function takes a value of 1, and when the constraint condition is not satisfied, the indicator function takes a value of 0, that is, when the sample operating status is an abnormal operation, the indicator function takes a value of 1, and when the sample operating status is not an abnormal operation, the indicator function takes a value of 0, that is, when the sample operating status is normal operation, the indicator function takes a value of 0.
[0117] Specifically, the formula of the indicator function at the i-th sample time point is as follows:
[0118]
[0119] Among them, p i is the sample anomaly score at the i-th sample time point, h(x i ) is the sample scoring threshold at the i-th sample time point, x i is the sample time series data at the i-th sample time point, that is, T i is the context information of the i-th sample time point, when p i <h(x i ), it is determined that the data point at the i-th sample time point has a significant difference, indicating that the data point at the i-th sample time point is an abnormal point. It can be determined that the sample operation state of the power system at the i-th sample time point is abnormal. At this time, the value of the indicator function is 1, and when p i ≥h(x i ), it can be determined that the sample operating state of the power system at the i-th sample time point is normal operation, and the value of the indicator function is 0.
[0120] Specifically, refer to Figure 3 , Figure 3An optional flow chart for determining an optimization target provided in an embodiment of the present disclosure is provided, wherein the indicator functions of multiple sample time points are added to construct an objective function, and then the optimization target is to maximize the objective function and keep the false discovery rate less than or equal to a preset threshold, so that the formula of the optimization target is as follows:
[0121]
[0122] in, is the indicator function of the i-th sample time point, It refers to the sum of the indicator functions of all sample time points, which can be As the objective function, It means maximizing the objective function, DFR is the false discovery rate, q is the preset threshold, and stFDR≤q means that the constraint condition FDR≤q needs to be satisfied to achieve keeping the false discovery rate less than or equal to the preset threshold.
[0123] It can be understood that during the training process, the sample operating states of the power system at multiple sample time points can be determined by configuring an indicator function for each of the sample time points respectively, and configuring the indicator function to satisfy the constraint conditions when the sample operating state is an operating abnormality. Therefore, whenever the sample operating state is determined to be an operating abnormality, it means that an abnormality is found, and the indicator function corresponding to the sample operating state will take a value of 1, and whenever the sample operating state is determined to be operating normally, the indicator function corresponding to the sample operating state will take a value of 0. Therefore, the sum of the indicator functions of the multiple sample time points refers to the number of abnormalities found. The objective function is created based on the sum of the indicator functions of the multiple sample time points, so that the objective function can accurately indicate the number of abnormalities found, that is, accurately indicate the number of time points when the sample operating state is an operating abnormality among the multiple sample time points.
[0124] In a possible implementation manner, the acquiring of sample time series data of the power system at the sample time points may specifically be acquiring the sample time series data of the power system at a plurality of the sample time points through a preset sliding window.
[0125] Among them, the window size of the sliding window is equal to an operation cycle of the power system, that is, the length of the sliding window can cover a complete cycle of the power system operation. Since the detection data of the power system usually has time correlation and periodicity, the operation cycle of the power system can be a cycle in which the detection data of the power system repeats in time. For example, the operation cycle can be a daily cycle, a weekly cycle, a quarterly cycle, an annual cycle, etc.
[0126] Specifically, for multiple time points of detection data detected in sequence in the power system, the sliding window is slid on multiple time points to determine multiple sample time series data in sequence, specifically, the last time point in the sliding window is taken as the sample time point, and the detection data corresponding to all time points in the sliding window are combined into sample time series data of the sample time point, wherein the window size is the time interval between the time point corresponding to the end of the sliding window and the time point corresponding to the beginning of the sliding window, and the time point corresponding to the beginning of the sliding window is before the time point corresponding to the end of the sliding window.
[0127] For example, assuming that the power system performs data detection every hour, multiple detection data detected in sequence can be obtained first, and then the time points of the multiple detection data are placed on the same time axis, and a sliding window with a window size of 24 hours is used to slide on the time axis. For example, the sliding step can be 1 hour, and multiple sample time series data can be obtained after multiple sliding. At this time, the sample time point corresponding to the sample time series data is the time point of the last detection data in the sample time series data. For example, before the first sliding, the end of the sliding window is aligned with the time point of a detection data located on the time axis, and the aligned time point is used as the sample time point. Then, the detection data of the sample time point and the detection data of the time point before the sample time point and within the sliding window are combined into the sample time series data of the sample time point. Subsequently, the sliding window is slid according to the sliding step. Since the sample time point changes after each sliding, sample time series data of multiple sample time points can be obtained.
[0128] It should be noted that the sliding step size can be set according to actual needs, and the embodiments of the present disclosure are not limited thereto; after the sliding window has slid multiple times, the sample time series data of the power system at multiple sample time points can be obtained, and the multiple sample time series data can be used as training data for the threshold prediction model respectively, which can effectively improve the generalization performance, robustness and prediction accuracy of the threshold prediction model.
[0129] It can be understood that the use of a sliding window to retain contextual information means that for each sample time point, in addition to the detection data at the reference sample time point, it will also rely on the detection data of the previous period of time, and the window size of the sliding window is limited to an operating cycle of the power system, so that the retained contextual information will neither miss important information nor increase unnecessary redundancy, providing a reliable data basis for model training. Specifically, the sample time series data obtained through the sliding window contains all key information of periodic changes within the operating cycle. Training the threshold prediction model based on the sample time series data can ensure that the model can cover and learn these periodic changes, that is, the threshold prediction model can learn the periodic characteristics of all detection data within an operating cycle, so that the threshold prediction model can effectively process the time series data with periodic changes, and can effectively adaptively adjust the scoring threshold to maintain high performance, thereby effectively improving the prediction accuracy of the threshold prediction model, and then improving the accuracy of operating status detection.
[0130] In a possible implementation, the sample time series data of the power system at the multiple sample time points are obtained through a preset sliding window. Specifically, the sample time series data of the power system at the multiple sample time points can be obtained through a preset first sliding window; and the sample time series data of the power system at the multiple sample time points can be obtained through a preset second sliding window.
[0131] The window size of the first sliding window is equal to a diurnal operation cycle of the power system, and the window size of the second sliding window is equal to a seasonal operation cycle of the power system.
[0132] Based on this, the detection data of the power system may be affected by different periodic changes at the same time, for example, it may be affected by both diurnal changes and seasonal changes. Therefore, while obtaining sample time series data containing diurnal periodic changes through the first sliding window, sample time series data containing seasonal periodic changes are also obtained through the second sliding window, so that the threshold prediction model can comprehensively consider the two periodic changes and understand the complex periodic characteristics more comprehensively, which is equivalent to capturing global and local characteristics at the same time, avoiding missing details, and improving the model's adaptability to complex periodic changes, which helps to reduce prediction errors, especially for complex time series data.
[0133] Specifically, the sliding step size of the first sliding window and the second sliding window can be the same, and the first sliding window can slide synchronously with the second sliding window, and the end of the first sliding window is aligned with the end of the second sliding window after each sliding, so that the sample time point corresponding to the sample timing data obtained through the first sliding window is the same as the sample time point corresponding to the sample timing data obtained through the second sliding window, that is, the same sample time point can have sample timing data of two lengths at the same time.
[0134] For example, it is assumed that the power system performs data detection every hour, and multiple detection data are detected in sequence, and then the time points of the multiple detection data are placed on the same time axis. Since a day and night is 24 hours, and a quarter can be 91 days, a first sliding window with a window size of 24 hours is used to slide on the time axis, and a second sliding window with a window size of 91 days is used to slide on the time axis. The sliding step size of the first sliding window and the sliding step size of the second sliding window can both be 1 hour. After multiple slidings, multiple sample time series data can be obtained, and the sample time point corresponding to the sample time series data is the time point of the last detection data in the sample time series data.
[0135] It can be understood that each sample time point has sample timing data obtained by the first sliding window and sample timing data obtained by the second sliding window. For example, before the first sliding, the end of the first sliding window and the end of the second sliding window are aligned with the time point of a certain detection data located on the time axis, and the aligned time point is used as the sample time point. Then, the detection data of the sample time point and the detection data of the time point before the sample time point and located in the first sliding window are combined into one kind of sample timing data of the sample time point, and the detection data of the sample time point and the detection data of the time point before the time point and located in the second sliding window are combined into another kind of sample timing data of the sample time point. Subsequently, the first sliding window and the second sliding window are synchronously slid according to the sliding step size. Since the sample time point changes after each sliding, sample timing data of multiple sample time points can be obtained.
[0136] It is worth noting that in addition to the first sliding window and the second sliding window with different window sizes to obtain the sample time series data of the sample time point, more sliding windows with other window sizes can also be used to obtain the sample time series data of the sample time point, and the embodiments of the present disclosure are not limited here.
[0137] In one possible implementation, reference Figure 4 , Figure 4An optional flow chart for determining a sample score threshold provided in an embodiment of the present disclosure, wherein the sample time series data is input into a threshold prediction model for threshold prediction to obtain the sample score threshold at the sample time point. Specifically, the sample time series data obtained through the first sliding window and the sample time series data obtained through the second sliding window may be input into the threshold prediction model; the sample time series data obtained through the first sliding window is convolved by a first convolution unit of the threshold prediction model to obtain a first convolution feature, and the sample time series data obtained through the second sliding window is convolved by the first convolution unit to obtain a second convolution feature; a mean convolution feature is obtained according to the average of the first convolution feature and the second convolution feature, and a threshold prediction is performed based on the mean convolution feature to obtain the sample score threshold at the sample time point.
[0138] It can be understood that by performing convolution processing on the sample time series data obtained through the first sliding window to obtain the first convolution feature through the first convolution unit, and performing convolution processing on the sample time series data obtained through the second sliding window to obtain the second convolution feature through the first convolution unit, the trends, fluctuations and patterns in the two sample time series data can be captured, specifically, the diurnal periodic changes of the former sample time series data can be captured, and the seasonal periodic changes of the latter sample time series data can be captured. Then, the mean convolution feature is obtained according to the average value of the first convolution feature and the second convolution feature, which is equivalent to fusing the first convolution feature and the second convolution feature, and can integrate the two periodic changes, so that the threshold prediction model can accurately capture the complex periodic features through the mean convolution feature, thereby improving the prediction accuracy of the scoring threshold; and the convolution processing can extract key features and reduce redundant information, so that the input dimension of the threshold prediction model is smaller, which can effectively improve the computational efficiency.
[0139] Specifically, in order to ensure that the first convolution feature and the second convolution feature can be effectively averaged, it can be achieved through a variety of processing methods, and two processing methods are described in detail below.
[0140] In a first processing method, before inputting the sample time series data obtained through the first sliding window into the threshold prediction model, the sample time series data obtained through the first sliding window is first converted to obtain first input time series data. For example, the conversion process may be padding the sample time series data, and then the first input time series data is input into the threshold prediction model, and the first input time series data is convolved by the first convolution unit to obtain a first convolution feature. In addition, before inputting the sample time series data obtained through the second sliding window into the threshold prediction model, the sample time series data obtained through the second sliding window is first converted to obtain second input time series data. For example, the conversion process may be padding the sample time series data, and then the second input time series data is input into the threshold prediction model, and the second input time series data is convolved by the first convolution unit to obtain a second convolution feature, wherein the length of the first input time series data is the same as that of the second input time series data, so that the dimension of the first convolution feature is the same as that of the second convolution feature, ensuring that the first convolution feature and the second convolution feature can be effectively averaged.
[0141] In the second processing method, after the first convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a first convolution feature, and the first convolution unit performs convolution processing on the sample time series data obtained through the second sliding window to obtain a second convolution feature, the first convolution feature is dimensionally transformed through the attention mechanism to obtain a first processing feature, and the second convolution feature is dimensionally transformed through the attention mechanism to obtain a second processing feature, so that the dimension of the first processing feature is the same as the dimension of the second processing feature, ensuring that the first convolution feature and the second convolution feature can be effectively mean processed.
[0142] In one possible implementation, reference Figure 5 , Figure 5 Another optional flow chart for determining a sample score threshold provided in an embodiment of the present disclosure, wherein the mean convolution feature is obtained according to the average of the first convolution feature and the second convolution feature. Specifically, the second convolution unit of the threshold prediction model convolves the sample time series data obtained through the first sliding window to obtain a third convolution feature, and the third convolution unit of the threshold prediction model convolves the sample time series data obtained through the second sliding window to obtain a fourth convolution feature; the third convolution feature and the fourth convolution feature are spliced to obtain a spliced convolution feature; and the mean convolution feature is obtained according to the average of the first convolution feature, the second convolution feature and the spliced convolution feature.
[0143] Among them, the convolution kernel size of the second convolution unit is different from that of the third convolution unit, for example, the convolution kernel size of the second convolution unit is smaller than the convolution kernel size of the third convolution unit, or the convolution kernel size of the second convolution unit is larger than the convolution kernel size of the third convolution unit.
[0144] It can be understood that since the window size of the first sliding window is equal to a diurnal operation cycle of the power system, and the window size of the second sliding window is equal to a seasonal operation cycle of the power system, the window size of the first sliding window is smaller than the window size of the second sliding window, so that the length of the sample time series data obtained through the first sliding window is smaller than the length of the sample time series data obtained through the second sliding window. At this time, the convolution kernel size of the second convolution unit can be set smaller than the convolution kernel size of the third convolution unit. This is because the dependencies of shorter sample time series data are usually concentrated in a shorter time range, so the second convolution unit with a smaller convolution kernel can be used to capture these short-term dependencies in detail, that is, to extract local features, such as short-term fluctuations and high-frequency changes, which helps the threshold prediction model learn complex patterns and reduce fitting risks. Since longer sample time series data may have dependencies across longer time intervals, the third convolution unit with a larger convolution kernel can be used to quickly capture these long-term dependencies, that is, to extract global features, which can reduce computational overhead.
[0145] Based on this, after the first convolution feature and the second convolution feature are extracted by the first convolution unit, the third convolution feature of the sample time series data obtained through the first sliding window is extracted by the second convolution unit, which can capture the diurnal periodic changes of the former sample time series data from different angles, and the fourth convolution feature of the sample time series data obtained through the second sliding window is extracted by the third convolution unit, which can capture the seasonal periodic changes of the latter sample time series data from different angles, and then the third convolution feature and the fourth convolution feature are spliced into a spliced convolution feature, and then the mean convolution feature is obtained according to the average of the first convolution feature, the second convolution feature and the spliced convolution feature, which is equivalent to fusing the first convolution feature, the second convolution feature, the third convolution feature and the fourth convolution feature, which can integrate the two periodic changes from different angles, further enhance the feature representation capability, and enable the threshold prediction model to more accurately capture complex periodic features through the mean convolution feature, thereby further improving the prediction accuracy of the scoring threshold.
[0146] It should be noted that the first convolution unit, the second convolution unit and the third convolution unit can be used simultaneously for convolution processing only in the training phase, while in the inference phase, only the first convolution unit is used to perform convolution processing on the target time series data, and the second convolution unit and the third convolution unit are no longer used.
[0147] Specifically, referring to the above-mentioned processing method for ensuring that the first convolution feature and the second convolution feature can be effectively processed by the mean, a similar processing method can also be used to ensure that the first convolution feature, the second convolution feature and the concatenated convolution feature can be effectively processed by the mean.
[0148] In a possible implementation, the sliding window is periodically configured as a training sliding window and a verification sliding window when sliding, the threshold prediction model is trained within the training sliding window, and the training method further includes:
[0149] In the next verification sliding window adjacent to the training sliding window, the sample time series data and the running state mark at the sample time point are obtained, the sample running state is determined based on the sample time series data, and the performance of the threshold prediction model trained in the training sliding window is verified according to the difference between the sample running state and the running state mark;
[0150] When the performance verification result indicates that the performance of the threshold prediction model is abnormal, in the next training sliding window adjacent to the verification sliding window, the structure of the threshold prediction model or the training strategy of the threshold prediction model is adjusted, and then the threshold prediction model is trained again.
[0151] The window sizes of the training sliding window and the verification sliding window are the same, ensuring that the length of the sample time series data input during the training process is the same as that of the sample time series data input during the verification process, thereby improving the reliability and accuracy of the performance verification results.
[0152] It should be noted that since the false discovery rate is introduced as an optimization target in the training process of the threshold prediction model, a reliable false discovery rate needs to be calculated for each training round. For any training round, the threshold prediction model needs to process the sample time series data of multiple sample time points, predict the sample score thresholds of multiple sample time points, and then determine whether the data point at the sample time point is an abnormal point. It can determine the number of all abnormalities found, that is, determine the number of positive results, and determine the number of false predictions among the abnormalities found, that is, determine the number of false positives, and then determine the false discovery rate by the ratio between the number of false positives and the number of positive results. It can be seen that a sufficient number of positive results are required to accurately calculate the false discovery rate, otherwise the estimation result will be unstable, which requires a sufficient number of sample time series data in a training round. Therefore, when configuring the training sliding window, multiple consecutive sliding windows will be configured as training sliding windows, and when verifying the sliding window, one or more consecutive sliding windows can be configured as verification sliding windows.
[0153] Based on this, since the sliding window is periodically configured as a training sliding window and a verification sliding window when sliding, the threshold prediction model can be periodically trained and verified, which is equivalent to cross-validation through the sliding window. It can not only maintain the time sequence and effectively avoid the use of future data in the training process, reducing the risk of information leakage, but also, based on the feedback from cross-validation, when the performance verification result indicates that the performance of the threshold prediction model is abnormal, the structure of the threshold prediction model can be adjusted in time or the training strategy of the threshold prediction model can be adjusted, and training can be performed again, so that the threshold prediction model can be more flexibly adapted to changes in time series data.
[0154] In a possible implementation, the sample time series data of the power system at the multiple sample time points are obtained through a preset sliding window. Specifically, the first time series data and the second time series data of the power system at the multiple sample time points are obtained through a preset sliding window; and the first time series data and the second time series data are combined into sample time series data.
[0155] Among them, the first time series data includes detection data of the power system's own parameters when the power system is running, and the second time series data includes detection data of environmental parameters when the power system is running. For example, the first time series data may include detection data of electrical parameters such as current and voltage, and the first time series data may also include detection data of machine operation parameters in the industrial production process, and the second time series data may include detection data of environmental parameters such as time, temperature, and humidity.
[0156] Specifically, the power system can be configured with a variety of detection modules, which can accurately detect corresponding detection data. For example, the detection modules configured in the power system may include current sensors, voltage sensors, temperature sensors, humidity sensors, etc. The current sensor is used to detect current, the voltage sensor is used to detect voltage, the temperature sensor is used to detect air temperature, and the humidity sensor is used to detect humidity. The power system can also be configured with other types of detection modules, which are not limited in the embodiments of the present disclosure.
[0157] Based on this, for each sample time point, it is necessary to obtain the first time series data and the second time series data, and then combine the first time series data and the second time series data into the sample time series data of the sample time point. Specifically, since the first time series data includes the detection data of the power system's own parameters when it is running, the first time series data can reflect the inherent mode of the electrical system, and since the second time series data includes the detection data of the environmental parameters when the power system is running, the second time series data can reflect the environmental changes of the electrical system, so that the threshold prediction model can understand the operating status of the power system more comprehensively, can effectively process periodically changing time series data, and can flexibly adapt to various types of detection data, can effectively adaptively adjust the scoring threshold, maintain high performance, thereby effectively improving the prediction accuracy of the threshold prediction model, and then improving the accuracy of operating status detection.
[0158] In a possible implementation, the combining of the first time series data and the second time series data into sample time series data may specifically be converting the timestamps in the first time series data and the second time series data according to the sliding window; and combining the converted first time series data and the converted second time series data into sample time series data.
[0159] Based on this, the timestamps in the first time series data and the second time series data are converted according to the sliding window so that the converted timestamps can match the sliding window. When the multiple sample time series data obtained through the sliding window are input into the threshold prediction model, the threshold prediction model can more easily understand the time characteristics, thereby improving the analysis effect and model performance.
[0160] It should be noted that, in addition to converting the timestamps in the first time series data and the second time series data according to the sliding window, the timestamps may also be directly converted into numerical values of preset time units to improve processing efficiency.
[0161] In one possible implementation, the timestamps in the first time series data and the second time series data are converted according to the sliding window. Specifically, the timestamps in the first time series data and the second time series data are converted according to the sliding step of the sliding window, so that the converted timestamps can match the sliding step of the sliding window, thereby converting the timestamp into a numerical value with the sliding step of the sliding window as a unit, that is, converting the timestamp into a numerical value with the time granularity of the sliding window as a unit, further improving the threshold prediction model's ability to understand the converted timestamp.
[0162] Specifically, the timestamp can be converted by a conversion algorithm, and the formula of the conversion algorithm is as follows:
[0163]
[0164] Among them, T1 ′ is the timestamp after conversion, T1 is the timestamp before conversion, T reg is the reference timestamp, ΔL is the sliding step, T1-T reg and ΔL are both in seconds, and T1 is in the time granularity of the sliding window.
[0165] For example, assuming that the sliding step of the sliding window is one hour, that is, the time granularity of the sliding window is one hour, the timestamp can be converted into a value in hours. In this case, ΔL is 3600, which means that there are 3600 seconds in one hour. Assuming that the reference timestamp T reg is 00:00, and the timestamp T1 before conversion is 14:30, then the timestamp T1 after conversion is ′ 14.5 hours.
[0166] For example, assuming that the sliding step of the sliding window is one day, that is, the time granularity of the sliding window is one day, the timestamp can be converted into a value in days. In this case, ΔL is 86400, which means that there are 86400 seconds in one day. Assuming that the reference timestamp T reg The timestamp before conversion is 00:00 on January 1, year A, and the timestamp T1 before conversion is 6:00 on January 2, year A. Then the timestamp after conversion is T1 ′ 1.25 days.
[0167] In one possible implementation, the timestamps in the first time series data and the second time series data are converted according to the sliding window. Specifically, the timestamps in the first time series data and the second time series data are converted according to the window size of the sliding window, so that the converted timestamps can match the window size of the sliding window, further improving the threshold prediction model's ability to understand the converted timestamps.
[0168] Reference Figure 6 , Figure 6 An optional flow chart of a method for detecting the operating status of an electric power system provided in an embodiment of the present disclosure. The method for detecting the operating status of an electric power system can be executed by a server, or by a terminal, or by a server in cooperation with a terminal. The method for detecting the operating status of an electric power system includes but is not limited to the following steps 601 to 603.
[0169] Step 601: During the operation of the power system, whenever an observation time point is reached, target time series data of the power system at the observation time point is obtained;
[0170] Step 602: Input the target time series data into a threshold prediction model to perform threshold prediction, and obtain the target score threshold at the observation time point;
[0171] Step 603: Determine a target anomaly score of the power system at the observation time point, and determine a target operating state of the power system according to a comparison result between the target anomaly score and the target score threshold.
[0172] Wherein, the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point, wherein the threshold prediction model is trained by the above-mentioned training method.
[0173] Specifically, when the power system is in operation, it can obtain the target time series data of the current observation time point in real time, which is equivalent to obtaining the context information of the current observation time point, and then predict the target score threshold of the current observation time point through the threshold prediction model, and perform operation status detection based on this. It can accurately determine whether the operation status at the current observation time point is an operation abnormality. For example, when the target abnormality score is less than the target score threshold, it is determined that the operation status at the current observation time point is an operation abnormality, and the data point at the current observation time point can be marked as abnormal, which is convenient for subsequent abnormality statistics.
[0174] Specifically, the target anomaly score can be determined in a variety of ways, for example, determining the target empirical distribution of the target time series data at the observation time point, determining the target ranking position of the detection data at the observation time point in the target time series data, and determining the target anomaly score at the observation time point based on the target ranking position and the target empirical distribution. The target anomaly score can also be determined in other ways, which are not limited in the embodiments of the present disclosure.
[0175] Based on this, the target time series data of the power system at the observation time point is obtained. Since the target time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the target time series data can more accurately detect the operating status of the power system. On this basis, when the operating status of the power system is detected, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as an optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the operating status of the power system is detected, the present disclosure can simultaneously realize the flexible setting of the target scoring threshold and the control of the error detection rate, thereby effectively improving the accuracy of the operating status detection.
[0176] In a possible implementation, the operation status detection method of the power system also includes: when the target operation status of the power system is abnormal operation, triggering a preset response program. Based on this, when an abnormal event occurs or is about to occur in the power system, it can usually be determined that the target operation status of the power system is abnormal operation. Therefore, abnormal events of the power system can be detected or predicted in time, and when the target operation status is determined to be abnormal operation, the preset response program can be automatically triggered. For example, the response program may include: generating alarm information to notify maintenance personnel in time, or adjusting production line parameters, etc., to restore the operation status of the power system to normal in time, effectively improving the safety and stability of the power system.
[0177] The complete process of running status detection is described in detail below. The complete process includes the training phase and the inference phase.
[0178] The training phase is described in detail below.
[0179] First, the sample time series data of the power system at multiple sample time points are obtained through a preset first sliding window, wherein the window size of the first sliding window is equal to a diurnal operation cycle of the power system; and the sample time series data of the power system at multiple sample time points are obtained through a preset second sliding window, wherein the window size of the second sliding window is equal to a seasonal operation cycle of the power system.
[0180] Specifically, the sample time series data is obtained by combining the converted first time series data and the converted second time series data, wherein the first time series data includes detection data of the power system's own parameters during operation, and the second time series data includes detection data of the power system's environmental parameters during operation, and the timestamps in the first time series data and the second time series data are converted based on a sliding window.
[0181] Then, the operating status mark of the power system at the sample time point is obtained, wherein the sample time series data includes the detection data of the power system at the sample time point and the detection data at a time point before the sample time point.
[0182] Then, the sample time series data obtained through the first sliding window and the sample time series data obtained through the second sliding window are input into the threshold prediction model; the sample time series data obtained through the first sliding window is convolved by the first convolution unit of the threshold prediction model to obtain a first convolution feature, and the sample time series data obtained through the second sliding window is convolved by the first convolution unit to obtain a second convolution feature.
[0183] Then, the second convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a third convolution feature, and the third convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the second sliding window to obtain a fourth convolution feature, wherein the convolution kernel sizes of the second convolution unit and the third convolution unit are different.
[0184] Then, the third convolution feature and the fourth convolution feature are spliced to obtain a spliced convolution feature; a mean convolution feature is obtained according to the average of the first convolution feature, the second convolution feature and the spliced convolution feature, and a threshold prediction is performed based on the mean convolution feature to obtain a sample score threshold at the sample time point.
[0185] Then, a sample anomaly score of the power system at the sample time point is determined, a sample operating state of the power system is determined based on a comparison result of the sample anomaly score and the sample score threshold, and an error discovery rate is determined based on the sample operating state and the operating state mark.
[0186] Then, an indicator function is configured for each of the sample time points respectively, wherein the indicator function is configured to satisfy a constraint condition when the sample operating status is an abnormal operation; an objective function is created according to the sum of the indicator functions of multiple sample time points, wherein the objective function is used to indicate the number of time points in the multiple sample time points where the sample operating status is an abnormal operation; and the threshold prediction model is trained with the optimization goal of maximizing the objective function and keeping the false discovery rate less than or equal to a preset threshold.
[0187] The inference phase is described in detail below.
[0188] First, during the operation of the power system, whenever an observation time point is reached, the target time series data of the power system at the observation time point is obtained, wherein the target time series data includes the detection data of the power system at the observation time point and the detection data at a time point before the observation time point;
[0189] Then, the target time series data is input into the trained threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point;
[0190] Then, a target abnormality score of the power system at the observation time point is determined, and a target operating state of the power system is determined according to a comparison result between the target abnormality score and the target score threshold.
[0191] Based on this, the target time series data of the power system at the observation time point is obtained. Since the target time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the target time series data can more accurately detect the operating status of the power system. On this basis, when the operating status of the power system is detected, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as an optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the operating status of the power system is detected, the present disclosure can simultaneously realize the flexible setting of the target scoring threshold and the control of the error detection rate, thereby effectively improving the accuracy of the operating status detection.
[0192] It is to be understood that, although the steps in the above-mentioned various flow charts are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned flow charts can include a plurality of steps or a plurality of stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of the steps or stages in other steps or other steps.
[0193] Reference Figure 7 , Figure 7 An optional structural diagram of a training device for a threshold prediction model provided in an embodiment of the present disclosure, the training device 700 for a threshold prediction model includes:
[0194] A first data acquisition module 701 is used to acquire sample time series data of the power system at a sample time point, and acquire an operation status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point;
[0195] The first prediction module 702 is used to input the sample time series data into the threshold prediction model to perform threshold prediction, and obtain the sample score threshold at the sample time point;
[0196] A first scoring module 703 is used to determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system according to a comparison result of the sample anomaly score and the sample scoring threshold, and determine a false discovery rate according to the sample operating state and the operating state mark;
[0197] The training module 704 is used to train the threshold prediction model by taking keeping the false discovery rate less than or equal to a preset threshold as an optimization goal.
[0198] Furthermore, the number of the sample time points is multiple, and the training module 704 is specifically used for:
[0199] Creating an objective function, wherein the objective function is used to indicate the number of time points at which the sample operation status is abnormal among the plurality of sample time points;
[0200] The threshold prediction model is trained with the optimization goal of maximizing the objective function and keeping the false discovery rate less than or equal to a preset threshold.
[0201] Furthermore, the training module 704 is specifically used for:
[0202] respectively configuring an indication function for each of the sample time points, wherein the indication function is configured to satisfy a constraint condition when the sample operation state is abnormal operation;
[0203] An objective function is created according to the sum of the indicator functions at a plurality of the sample time points.
[0204] Furthermore, the first data acquisition module 701 is specifically used for:
[0205] Acquire sample time series data of the power system at a plurality of sample time points through a preset sliding window;
[0206] The window size of the sliding window is equal to an operation cycle of the power system.
[0207] Furthermore, the first data acquisition module 701 is specifically used for:
[0208] Acquire sample time series data of the power system at a plurality of sample time points through a preset first sliding window, wherein a window size of the first sliding window is equal to a diurnal operation cycle of the power system;
[0209] The sample time series data of the power system at the plurality of sample time points is acquired through a preset second sliding window, wherein the window size of the second sliding window is equal to a seasonal operation cycle of the power system.
[0210] Furthermore, the first prediction module 702 is specifically used for:
[0211] Inputting the sample time series data obtained through the first sliding window and the sample time series data obtained through the second sliding window into the threshold prediction model;
[0212] The first convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a first convolution feature, and the first convolution unit performs convolution processing on the sample time series data obtained through the second sliding window to obtain a second convolution feature;
[0213] A mean convolution feature is obtained according to the average value of the first convolution feature and the second convolution feature, and a threshold prediction is performed based on the mean convolution feature to obtain a sample score threshold at the sample time point.
[0214] Furthermore, the first prediction module 702 is specifically used for:
[0215] The second convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a third convolution feature, and the third convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the second sliding window to obtain a fourth convolution feature, wherein the convolution kernel sizes of the second convolution unit and the third convolution unit are different;
[0216] Concatenating the third convolution feature with the fourth convolution feature to obtain a concatenated convolution feature;
[0217] A mean convolution feature is obtained according to the average value of the first convolution feature, the second convolution feature and the concatenated convolution feature.
[0218] Further, the sliding window is periodically configured as a training sliding window and a verification sliding window when sliding, and the threshold prediction model is trained in the training sliding window. The training device of the threshold prediction model further includes a verification module (not shown in the figure), and the verification module is specifically used to:
[0219] In the next verification sliding window adjacent to the training sliding window, the sample time series data and the running state mark at the sample time point are obtained, the sample running state is determined based on the sample time series data, and the performance of the threshold prediction model trained in the training sliding window is verified according to the difference between the sample running state and the running state mark;
[0220] When the performance verification result indicates that the performance of the threshold prediction model is abnormal, in the next training sliding window adjacent to the verification sliding window, the structure of the threshold prediction model or the training strategy of the threshold prediction model is adjusted, and then the threshold prediction model is trained again.
[0221] Furthermore, the first data acquisition module 701 is specifically used for:
[0222] Acquire first time series data and second time series data of the power system at a plurality of sample time points through a preset sliding window, wherein the first time series data includes detection data of the power system's own parameters when the power system is running, and the second time series data includes detection data of the power system's environmental parameters when the power system is running;
[0223] The first time series data and the second time series data are combined into sample time series data.
[0224] Furthermore, the first data acquisition module 701 is specifically used for:
[0225] Converting the timestamps in the first time series data and the second time series data according to the sliding window;
[0226] The converted first time series data and the converted second time series data are combined into sample time series data.
[0227] The training device 700 of the threshold prediction model and the training method of the threshold prediction model are based on the same inventive concept. The sample time series data of the power system at the sample time point is obtained to obtain the operating status mark of the power system at the sample time point. Since the sample time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the sample time series data can more accurately detect the operating status of the power system. On this basis, the sample time series data is input into the threshold prediction model for threshold prediction to obtain the sample score threshold at the sample time point. By determining the sample anomaly score of the power system at the sample time point, the sample operating status of the power system is determined according to the comparison result between the sample anomaly score and the sample score threshold. The error detection rate is determined by the state and operating state marking, so as to keep the error detection rate less than or equal to the preset threshold as the optimization target training threshold prediction model. When the operating state of the power system is subsequently detected, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as the optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the operating state of the power system is detected, the present invention can simultaneously realize the flexible setting of the target scoring threshold and the control of the error detection rate, thereby effectively improving the accuracy of the operating state detection.
[0228] Reference Figure 8 , Figure 8 An optional structural diagram of an operating state detection device for an electric power system provided in an embodiment of the present disclosure, the operating state detection device 800 of the electric power system includes:
[0229] The second data acquisition module 801 is used to acquire target time series data of the power system at the observation time point whenever the observation time point is reached during the operation of the power system, wherein the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point;
[0230] The second prediction module 802 is used to input the target time series data into a threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point, wherein the threshold prediction model is trained by the above-mentioned training method;
[0231] The second scoring module 803 is used to determine a target abnormality score of the power system at the observation time point, and determine a target operating state of the power system according to a comparison result between the target abnormality score and the target score threshold.
[0232] The above-mentioned power system operation status detection device 800 and the power system operation status detection method are based on the same inventive concept, and obtain the target time series data of the power system at the observation time point. Since the target time series data can reflect the time correlation between the detection data during the operation of the power system, the introduction of the target time series data can more accurately detect the operation status of the power system. On this basis, when the power system is detected in the operation status, the trained threshold prediction model can be used to dynamically adjust the target scoring threshold according to the input target time series data, so as to flexibly set the target scoring threshold. Moreover, since the error detection rate is introduced as the optimization target in the training process of the threshold prediction model, the threshold prediction model can control the error detection rate when outputting the target scoring threshold. It can be seen that when the power system is detected in the operation status, the present disclosure can simultaneously realize the flexible setting of the target scoring threshold and the control of the error detection rate, thereby effectively improving the accuracy of the operation status detection.
[0233] The electronic device for executing the training method of the threshold prediction model or the operating state detection method of the power system provided in the embodiment of the present disclosure may be a terminal. Fig. 9 , Fig. 9 This is a partial structural block diagram of a terminal provided in an embodiment of the present disclosure, and the terminal includes: a camera assembly 910, a first memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, a first processor 980, and a first power supply 990. Those skilled in the art can understand that Fig. 9 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0234] The camera assembly 910 can be used to capture images or videos. Optionally, the camera assembly 910 includes a front camera and a rear camera. Typically, the front camera is disposed on the front panel of the terminal, and the rear camera is disposed on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize the panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions.
[0235] The first memory 920 may be used to store software programs and modules. The first processor 980 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the first memory 920 .
[0236] The input unit 930 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932 .
[0237] The display unit 940 may be used to display input information or provided information and various menus of the terminal. The display unit 940 may include a display panel 941 .
[0238] The audio circuit 960 , the speaker 961 , and the microphone 962 may provide an audio interface.
[0239] The first power source 990 may be alternating current, direct current, a disposable battery, or a rechargeable battery.
[0240] The number of sensors 950 may be one or more, and the one or more sensors 950 include but are not limited to: acceleration sensors, gyroscope sensors, pressure sensors, optical sensors, etc. Among them:
[0241] The acceleration sensor can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor can be used to detect the components of gravity acceleration on the three coordinate axes. The first processor 980 can control the display unit 940 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor. The acceleration sensor can also be used for collecting motion data of games or users.
[0242] The gyroscope sensor can detect the body direction and rotation angle of the terminal, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the terminal. The first processor 980 can implement the following functions based on the data collected by the gyroscope sensor: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0243] The pressure sensor can be set in the side frame of the terminal and / or the lower layer of the display unit 940. When the pressure sensor is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the first processor 980 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor. When the pressure sensor is set in the lower layer of the display unit 940, the first processor 980 controls the operability controls on the UI interface according to the user's pressure operation on the display unit 940. The operability control includes at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0244] The optical sensor is used to collect the ambient light intensity. In one embodiment, the first processor 980 can control the display brightness of the display unit 940 according to the ambient light intensity collected by the optical sensor. Specifically, when the ambient light intensity is high, the display brightness of the display unit 940 is increased; when the ambient light intensity is low, the display brightness of the display unit 940 is decreased. In another embodiment, the first processor 980 can also dynamically adjust the shooting parameters of the camera assembly 910 according to the ambient light intensity collected by the optical sensor.
[0245] In this embodiment, the first processor 980 included in the terminal can execute the training method of the threshold prediction model or the operating status detection method of the power system in the previous embodiment.
[0246] The electronic device for executing the training method of the threshold prediction model or the operating state detection method of the power system provided in the embodiment of the present disclosure may also be a server. Fig.10 , Fig.10 Partial structural block diagram of a server provided in an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more second processors 1010 and a second memory 1030, and one or more storage media 1040 (e.g., one or more mass storage devices) storing application programs 1043 or data 1042. Among them, the second memory 1030 and the storage medium 1040 may be short-term storage or persistent storage. The program stored in the storage medium 1040 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the second processor 1010 may be configured to communicate with the storage medium 1040 to execute a series of instruction operations in the storage medium 1040 on the server.
[0247] The server may also include one or more second power supplies 1020, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1060, and / or one or more operating systems 1041, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0248] The second processor 1010 in the server can be used to execute a training method for a threshold prediction model or a method for detecting an operating state of a power system.
[0249] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store a computer program, and the computer program is used to execute the training method of the threshold prediction model or the operating status detection method of the power system of the aforementioned embodiments.
[0250] The embodiment of the present disclosure also provides a computer program product, which includes a computer program, and the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the training method of the threshold prediction model or the operating state detection method of the power system.
[0251] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0252] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0253] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0254] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0255] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0256] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0257] If the integrated unit is implemented in the form of 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 the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0258] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0259] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions under the shared conditions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A training method for a threshold prediction model, characterized in that: include: Acquire sample time series data of the power system at a sample time point, and acquire an operation status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point; Inputting the sample time series data into a threshold prediction model to perform threshold prediction, and obtaining a sample score threshold at the sample time point; Determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system according to a comparison result of the sample anomaly score and the sample score threshold, and determine a false discovery rate according to the sample operating state and the operating state mark; The threshold prediction model is trained with the optimization goal of keeping the false discovery rate less than or equal to a preset threshold.
2. The training method of the threshold prediction model according to claim 1, characterized in that: The number of the sample time points is multiple, and the training of the threshold prediction model with keeping the false discovery rate less than or equal to a preset threshold as an optimization goal includes: Creating an objective function, wherein the objective function is used to indicate the number of time points at which the sample operation status is abnormal among the plurality of sample time points; The threshold prediction model is trained with the optimization goal of maximizing the objective function and keeping the false discovery rate less than or equal to a preset threshold.
3. The training method of the threshold prediction model according to claim 2, characterized in that: The creating of the objective function comprises: respectively configuring an indication function for each of the sample time points, wherein the indication function is configured to satisfy a constraint condition when the sample operation state is abnormal operation; An objective function is created according to the sum of the indicator functions at a plurality of the sample time points.
4. The training method of the threshold prediction model according to claim 1, characterized in that: The obtaining of sample time series data of the power system at a sample time point includes: Acquire sample time series data of the power system at a plurality of sample time points through a preset sliding window; The window size of the sliding window is equal to an operation cycle of the power system.
5. The training method of the threshold prediction model according to claim 4, characterized in that: The obtaining of sample time series data of the power system at a plurality of sample time points through a preset sliding window includes: Acquire sample time series data of the power system at a plurality of sample time points through a preset first sliding window, wherein a window size of the first sliding window is equal to a diurnal operation cycle of the power system; The sample time series data of the power system at the plurality of sample time points is acquired through a preset second sliding window, wherein the window size of the second sliding window is equal to a seasonal operation cycle of the power system.
6. The training method of the threshold prediction model according to claim 5, characterized in that: The step of inputting the sample time series data into a threshold prediction model for threshold prediction to obtain the sample score threshold at the sample time point includes: Inputting the sample time series data obtained through the first sliding window and the sample time series data obtained through the second sliding window into the threshold prediction model; The first convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a first convolution feature, and the first convolution unit performs convolution processing on the sample time series data obtained through the second sliding window to obtain a second convolution feature; A mean convolution feature is obtained according to the average value of the first convolution feature and the second convolution feature, and a threshold prediction is performed based on the mean convolution feature to obtain a sample score threshold at the sample time point.
7. The training method of the threshold prediction model according to claim 6, characterized in that: The step of obtaining a mean convolution feature according to the average value of the first convolution feature and the second convolution feature includes: The second convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the first sliding window to obtain a third convolution feature, and the third convolution unit of the threshold prediction model performs convolution processing on the sample time series data obtained through the second sliding window to obtain a fourth convolution feature, wherein the convolution kernel sizes of the second convolution unit and the third convolution unit are different; Concatenating the third convolution feature with the fourth convolution feature to obtain a concatenated convolution feature; A mean convolution feature is obtained according to the average value of the first convolution feature, the second convolution feature and the concatenated convolution feature.
8. The training method of the threshold prediction model according to claim 4, characterized in that: The sliding window is periodically configured as a training sliding window and a verification sliding window when sliding, the threshold prediction model is trained within the training sliding window, and the training method further includes: In the next verification sliding window adjacent to the training sliding window, the sample time series data and the running state mark at the sample time point are obtained, the sample running state is determined based on the sample time series data, and the performance of the threshold prediction model trained in the training sliding window is verified according to the difference between the sample running state and the running state mark; When the performance verification result indicates that the performance of the threshold prediction model is abnormal, in the next training sliding window adjacent to the verification sliding window, the structure of the threshold prediction model or the training strategy of the threshold prediction model is adjusted, and then the threshold prediction model is trained again.
9. The training method of the threshold prediction model according to claim 4, characterized in that: The obtaining of sample time series data of the power system at a plurality of sample time points through a preset sliding window includes: Acquire first time series data and second time series data of the power system at a plurality of sample time points through a preset sliding window, wherein the first time series data includes detection data of the power system's own parameters when the power system is running, and the second time series data includes detection data of the power system's environmental parameters when the power system is running; The first time series data and the second time series data are combined into sample time series data.
10. The training method of the threshold prediction model according to claim 9, characterized in that: The combining the first time series data and the second time series data into sample time series data includes: Converting the timestamps in the first time series data and the second time series data according to the sliding window; The converted first time series data and the converted second time series data are combined into sample time series data.
11. A method for detecting the operating status of an electric power system, characterized in that: include: During the operation of the power system, whenever an observation time point is reached, target time series data of the power system at the observation time point is obtained, wherein the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point; Inputting the target time series data into a threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point, wherein the threshold prediction model is trained by the training method according to any one of claims 1 to 10; A target anomaly score of the power system at the observation time point is determined, and a target operating state of the power system is determined according to a comparison result of the target anomaly score and the target score threshold.
12. A training device for a threshold prediction model, characterized in that: include: A first data acquisition module is used to acquire sample time series data of the power system at a sample time point, and acquire an operation status mark of the power system at the sample time point, wherein the sample time series data includes detection data of the power system at the sample time point and detection data at a time point before the sample time point; A first prediction module, used for inputting the sample time series data into a threshold prediction model to perform threshold prediction, and obtain a sample score threshold at the sample time point; A first scoring module is used to determine a sample anomaly score of the power system at the sample time point, determine a sample operating state of the power system according to a comparison result of the sample anomaly score and the sample scoring threshold, and determine a false discovery rate according to the sample operating state and the operating state mark; A training module is used to train the threshold prediction model by keeping the false discovery rate less than or equal to a preset threshold as an optimization goal.
13. A device for detecting the operating status of an electric power system, characterized in that: include: A second data acquisition module is used to acquire target time series data of the power system at the observation time point whenever the observation time point is reached during the operation of the power system, wherein the target time series data includes detection data of the power system at the observation time point and detection data at a time point before the observation time point; A second prediction module is used to input the target time series data into a threshold prediction model for threshold prediction to obtain the target score threshold at the observation time point, wherein the threshold prediction model is trained by the training method according to any one of claims 1 to 10; The second scoring module is used to determine a target abnormality score of the power system at the observation time point, and determine a target operating state of the power system according to a comparison result between the target abnormality score and the target score threshold.
14. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, it implements the training method described in any one of claims 1 to 10, or implements the operating status detection method described in claim 11.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the training method described in any one of claims 1 to 10, or implements the operating status detection method described in claim 11.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the training method described in any one of claims 1 to 10, or implements the operating status detection method described in claim 11.