An electrical appliance operation anomaly unsupervised detection method and system for a virtual power plant
An SVDD single-classification model was constructed using an unsupervised detection method. By utilizing the Gaussian radial basis function kernel function and the SMO algorithm, the problem of multiple equipment types and difficulty in labeling abnormal data in virtual power plants was solved. This enabled efficient anomaly detection and early warning, and improved the operational stability and response reliability of virtual power plants.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID SHANGHAI MUNICIPAL ELECTRIC POWER CO
- Filing Date
- 2026-05-25
- Publication Date
- 2026-07-24
AI Technical Summary
Existing technologies rely heavily on scarce labeled anomaly data, requiring the separate collection of data and training of dedicated models for each type of device and anomaly. This results in high training costs, poor generalization ability, and difficulty in meeting the anomaly detection needs of tens of thousands of terminal devices in a virtual power plant.
An unsupervised detection method is adopted. The operating power and timestamp sequence of electrical appliances in a virtual power plant are collected, preprocessed and spliced to form a feature vector. A support vector data description (SVDD) single classification model is constructed, and the Gaussian radial basis kernel function is used to map to the feature space. The sequence minimum optimization algorithm (SMO) is combined to solve the Lagrange dual problem to identify and remove abnormal equipment.
It enables equipment anomaly detection without relying on scarce abnormal samples, reduces data acquisition and model training costs, improves the confidence of the dispatchable capacity and response reliability of virtual power plants, adapts to the real-time monitoring needs of large-scale terminal equipment, and enhances operational stability.
Smart Images

Figure CN122286597B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of equipment operation status monitoring, and in particular to an unsupervised detection method and system for electrical operation anomalies in a virtual power plant. Background Technology
[0002] With the deepening of the construction of new power systems, Virtual Power Plants (VPPs), as a core technology for integrating distributed energy resources and realizing source-load interaction, have become a key support for improving the flexibility of power systems and strengthening demand-side response capabilities. Existing VPPs aggregate massive amounts of operational data from terminal appliances through Advanced Metering Infrastructure (AMI) systems, enabling refined management and optimized control of equipment within the aggregated resource pool. Real-time monitoring and anomaly detection of appliance operating status are crucial for ensuring reliable resource scheduling, reducing equipment failure losses, and improving the overall operational stability of VPPs. The core objective of appliance anomaly detection is to automatically identify non-ideal operating states of equipment (such as equipment damage, aging, and abnormal power consumption) through algorithms. For VPPs, timely and accurate anomaly detection can effectively avoid issuing invalid scheduling commands to faulty equipment, improving the confidence and reliability of dispatchable capacity, and forming the foundation for achieving large-scale collaborative operation of terminal equipment. However, in practical applications, the performance of supervised learning algorithms heavily relies on a large amount of labeled anomaly data. Virtual power plants aggregate a wide variety of terminal appliances with complex operating conditions, and the causes of anomalies are random and diverse. Furthermore, the proportion of anomaly states throughout the entire equipment lifecycle is extremely low (some devices may only experience one irreversible anomaly). This makes the collection and labeling of anomaly data extremely scarce, severely limiting the applicability of supervised learning algorithms. Simultaneously, the operating patterns and anomaly modes of different types of appliances vary significantly. Existing supervised learning models require separate data collection and training for each type of device and anomaly. For large-scale deployment scenarios involving tens of thousands of terminal devices within a virtual power plant, this approach not only incurs extremely high training costs but also results in poor model generalization capabilities, making it difficult to adapt to changes in equipment iteration or operating conditions. Summary of the Invention
[0003] This application provides an unsupervised detection method and system for electrical operation anomalies in virtual power plants, which solves the technical problems of existing technologies that rely heavily on scarce labeled anomaly data and require separate data collection and training of dedicated models for each type of equipment and anomaly, resulting in high training costs and poor generalization ability.
[0004] To achieve the above objectives, this application adopts the following technical solution: Firstly, an unsupervised detection method for abnormal operation of electrical appliances in a virtual power plant includes: collecting and preprocessing the operating power sequence and corresponding timestamp sequence of target electrical appliances in the virtual power plant; concatenating the preprocessed power sequence and timestamp sequence along the feature dimension to form a feature vector set; using the feature vector set as a normal sample set, constructing a single-classification model based on the support vector data description method; mapping the samples to the feature space using a Gaussian radial basis kernel function; and training a parameterized hypersphere model describing the distribution of normal data; solving the Lagrange dual problem of the single-classification model using a sequence minimum optimization algorithm to obtain the hypersphere's center vector, radius parameter, and Lagrange multiplier subset; collecting the operating data of target electrical appliances in real time and performing the same preprocessing to generate real-time feature vectors; and calculating the judgment distance between the real-time feature vectors and the hypersphere's center in the feature space based on the Lagrange multiplier subset and kernel function; identifying target electrical appliances with a judgment distance greater than the radius parameter as abnormal states; removing abnormal state devices from the virtual power plant's resource scheduling pool; and sending health warning information to users.
[0005] In conjunction with the first aspect mentioned above, one possible implementation involves treating the feature vector set as the normal sample set. The process of constructing a single-classification model based on the support vector data description method specifically includes: designating the feature vector set as the normal sample point set, and designating the feature vectors within the feature vector set as normal sample points. An optimization objective function is defined by finding the smallest hypersphere that encloses all normal sample points in the feature space. The smallest hypersphere is described by its center vector and radius parameters. Relaxation variables are introduced into the optimization objective function, and a penalty factor controls the degree of boundary relaxation. The relaxation variables allow some normal sample points to lie outside the hypersphere boundary, while the penalty factor controls the penalty weight applied to samples outside the boundary.
[0006] In conjunction with the first aspect mentioned above, in one possible implementation, the process of mapping samples to the feature space using a Gaussian radial basis function (RBF) kernel to obtain a parameterized hypersphere model describing the normal data distribution specifically includes: projecting feature vectors from the original feature space to the feature space using a Gaussian RBF kernel, where the expression for the Gaussian RBF kernel is: ;in, Let Gaussian radial basis kernel function be used. For any two eigenvectors and Gaussian radial basis kernel function values between and For any two eigenvectors, It is a natural exponential function. For vectors and The Euclidean distance between them Let be the bandwidth parameter of the Gaussian radial basis function kernel. Construct the Lagrangian dual problem of SVDD in the feature space, with the objective function being: ; in, and Let be the Lagrange multiplier, used to represent the weight of each sample's contribution to the hypersphere boundary. For feature vectors The value of its own Gaussian radial basis function. The constraints are: ,in, The penalty factor controls the degree of penalty applied to samples outside the boundary. The optimal Lagrange multiplier is obtained by solving the Lagrange dual problem, thus defining the boundary of the parameterized hypersphere model.
[0007] In conjunction with the first aspect mentioned above, one possible implementation involves using a sequential minimum optimization algorithm to solve the Lagrange dual problem of a single-classification model, obtaining the hypersphere's center vector, radius parameter, and Lagrange multiplier subset. Specifically, this includes: iteratively solving the Lagrange dual problem using the sequential minimum optimization algorithm, selecting the top N Lagrange multipliers ranked by severity of KKT violation as optimization variables in each iteration, and fixing the other multipliers. The degree of KKT violation is determined by calculating the difference between the distance of a normal sample to the hypersphere's center and its radius in the kernel mapping space. The optimization variables are updated based on the KKT conditions, and the hypersphere radius is updated synchronously. The iteration continues until all multipliers satisfy the KKT conditions or are below a preset tolerance threshold, outputting the hypersphere's center vector, radius parameter, and Lagrange multiplier subset.
[0008] In conjunction with the first aspect mentioned above, in one possible implementation, the process of calculating the determination distance between the real-time feature vector and the center of the hypersphere in the feature space specifically includes: [The text abruptly ends here, so the translation also ends here.] Input the decision distance calculation formula to obtain the decision distance between the real-time feature vector and the center of the hypersphere in the feature space. The decision distance calculation formula is as follows: ;in, This refers to the real-time feature vector generated after preprocessing the real-time collected operating data of the target electrical appliances. Real-time feature vector Determine the distance. Let Gaussian radial basis kernel function be used. Real-time feature vector Compared with its own Gaussian radial basis kernel function value, Real-time feature vector With feature vectors Gaussian radial basis kernel function values between and For Lagrange multipliers, This represents the total number of samples in the training set.
[0009] In conjunction with the first aspect mentioned above, in one possible implementation, the process of identifying a target electrical appliance whose distance is greater than the radius parameter as being in an abnormal state specifically includes: pre-setting an adaptive tolerance factor based on the dispersion of the support vector weight distribution in the Lagrange multiplier set; calculating the sum of the radius parameter and the adaptive tolerance factor, which is denoted as the abnormal determination threshold; determining that the target electrical appliance is in an abnormal state if the distance is greater than the abnormal determination threshold, and generating an abnormal label vector; generating a device scheduling blocking command based on the abnormal label vector, removing the corresponding device from the resource scheduling pool of the virtual power plant in real time, and triggering the early warning module to send early warning information to the user.
[0010] In conjunction with the first aspect mentioned above, in one possible implementation, the process of identifying and removing target appliances in an abnormal state from the resource scheduling pool of the virtual power plant based on distance judgment, and sending health warning information to the user, specifically includes: collecting the active power sequence of the appliance at a preset sampling frequency using a smart meter or smart socket deployed on the target appliance. and the corresponding timestamp sequence ,in Let j be the power value at the j-th sampling point. Let M be the timestamp of the j-th sampling point, and M be the total number of sampling points. The power sequence is globally normalized to obtain a normalized power sequence. ,in This is the minimum value in the historical power data. This is the maximum value in the historical power data. Let M be the normalized power value at the j-th sampling point, and M be the total number of sampling points. A sliding window is used to process the normalized power sequence. Slice the data with the timestamp sequence T and extract the power slice corresponding to the i-th sliding window. and timestamp slices Where L is the window length and i is the sliding window index. The timestamp slice is processed by... Local standardization is performed to obtain a normalized timestamp slice sequence, where Let i be the start timestamps of the i sliding windows. Values on a time scale. Let be the value of the j-th timestamp within the i-th sliding window in the original timestamp sequence T, where the j-th timestamp is located within the i-th sliding window. This is the normalized time value of the j-th timestamp in the i-th sliding window after standardization.
[0011] In conjunction with the first aspect mentioned above, in one possible implementation, the process of collecting the operating power sequence and timestamp sequence of the target electrical appliance and preprocessing them to form a feature vector set specifically includes: dividing the power slice corresponding to each window... The timestamp slice is considered as two feature sub-vectors, and concatenated along the second dimension to generate the i-th feature vector. , where L is the length of the sliding window; The normalized power slice corresponding to the i-th sliding window contains L consecutive power values; The normalized timestamp slice corresponding to the i-th sliding window contains L consecutive time values. All the aforementioned feature vectors are then summarized to obtain the feature vector set. , This represents the total number of samples in the training set.
[0012] Secondly, a system for unsupervised detection of electrical appliance operation anomalies in a virtual power plant is provided, comprising: a data acquisition and preprocessing module, used to acquire and preprocess the operating power sequence and corresponding timestamp sequence of the target electrical appliance in the virtual power plant, and concatenate the preprocessed power sequence and timestamp sequence along the feature dimension to form a feature vector set; an SVDD model processing module, used to treat the feature vector set as a normal sample set, construct a single-classification model based on the support vector data description method, map the samples to the feature space through a Gaussian radial basis kernel function, and train to obtain a parameterized hypersphere model describing the distribution of normal data; a sequence minimum optimization algorithm is used to solve the Lagrange dual problem of the single-classification model to obtain the hypersphere center vector, radius parameter, and Lagrange multiplier subset; real-time acquisition of the target electrical appliance's operating data is subjected to the same preprocessing to generate real-time feature vectors, and the determination distance between the real-time feature vectors and the hypersphere center in the feature space is calculated based on the Lagrange multiplier subset and the kernel function. The judgment and early warning module is used to identify target electrical appliances whose distance is greater than the radius parameter as being in an abnormal state, remove the abnormal state devices from the resource scheduling pool of the virtual power plant, and send health warning information to the user.
[0013] In conjunction with the second aspect mentioned above, in one possible implementation, the process of constructing a single-classification model in the SVDD model processing module specifically includes: a sample point acquisition unit, used to denote the feature vector set as the normal sample point set and the feature vectors in the feature vector set as normal sample points; an optimization objective function construction unit, used to define the optimization objective function by finding the smallest hypersphere that encloses all normal sample points in the feature space, where the smallest hypersphere is described by the center vector and radius parameters; and a single-classification model generation unit, used to introduce relaxation variables into the optimization objective function and control the degree of boundary relaxation through a penalty factor, where the relaxation variables allow some normal sample points to lie outside the hypersphere boundary, and the penalty factor is used to control the penalty weight of the model for samples outside the boundary.
[0014] This application provides an unsupervised detection method and system for electrical equipment operation anomalies in virtual power plants. By collecting and preprocessing power and timestamp sequences, the system enriches feature dimensions and comprehensively characterizes the operating status of equipment, thus solving the problem of single-feature detection in traditional methods. Simultaneously, an unsupervised single-classification model is constructed based on SVDD, and a Gaussian radial basis function kernel function is used to achieve high-dimensional mapping of complex data. This eliminates the need to rely on scarce anomaly samples, overcoming the pain points of diverse equipment types and difficult anomaly data labeling in virtual power plants, reducing data acquisition and model training costs. Furthermore, combining this with the structure of the SMO algorithm for solving the dual problem allows for rapid acquisition of key parameters of the hypersphere, ensuring model training efficiency and accuracy. In the real-time detection stage, the preprocessing process is reused to generate feature vectors, and the judgment distance is accurately calculated using the kernel function and model parameters, enabling rapid identification of anomalies. Finally, abnormal equipment is removed promptly and an alert is issued, avoiding the issuance of invalid scheduling commands, improving the confidence and reliability of the virtual power plant's dispatchable capacity, adapting to the real-time monitoring needs of large-scale terminal equipment, and enhancing operational stability.
[0015] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0016] Figure 1 A flowchart illustrating an unsupervised detection method for electrical operation anomalies in a virtual power plant, provided as an embodiment of this application; Figure 2 This is a flowchart illustrating the steps of constructing a single-classification model based on the support vector data description method in an unsupervised detection method for electrical operation anomalies in a virtual power plant, which uses the feature vector set as the normal sample set in an embodiment of this application. Figure 3 This is a flowchart illustrating the steps of an unsupervised detection method for electrical operation anomalies in a virtual power plant, provided in an embodiment of this application, to map samples to a feature space using a Gaussian radial basis kernel function and train a parameterized hypersphere model describing the normal data distribution. Figure 4 The flowchart of an unsupervised detection method for electrical operation anomalies in a virtual power plant provided in this application embodiment uses a sequence minimum optimization algorithm to solve the Lagrange dual problem of a single classification model, and obtains the hypersphere center vector, radius parameters, and Lagrange subset multiplication steps. Figure 5 This application provides a system architecture diagram for an unsupervised detection system of electrical operation anomalies in a virtual power plant. Detailed Implementation
[0017] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. The "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Furthermore, "at least one" means one or more, and "multiple" means two or more. The terms "first," "second," etc., do not limit the quantity or order of execution, and "first," "second," etc., do not necessarily imply differences.
[0018] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0019] like Figure 1 As shown in the embodiment of this application, an unsupervised detection method for electrical operation anomalies in a virtual power plant includes: Step 101: Collect the operating power sequence and corresponding timestamp sequence of the target electrical appliances in the virtual power plant, preprocess them, and concatenate the preprocessed power sequence and timestamp sequence in the feature dimension to form a feature vector set.
[0020] Using smart sockets (integrated with advanced measurement functions) deployed on commercial air conditioners, the active power sequence P and its corresponding timestamp sequence T are continuously collected at a fixed sampling frequency of once per second for a period of time to construct a training dataset. Assuming a total of M = 10000 sampling points are collected, the original data is represented as follows: and ,in Let j be the power value at the j-th sampling point. Let j be the timestamp of the j-th sampling point.
[0021] Determine its minimum power value based on the air conditioner's historical operating data. =50W (standby power), maximum power value =3500W (full load power). This allows you to specify each power value. Substitution Normalization is performed, where, The original power value at the j-th sampling point. and These are the minimum and maximum values from historical power data. This is the normalized power value.
[0022] The normalized power values are then mapped to the [0,1] interval to obtain the normalized power sequence. At this point, the timestamp sequence T can be left unprocessed in this step and reserved for subsequent local standardization.
[0023] Using a sliding window for normalized power sequences and timestamp sequence Slicing is performed, and local temporal features are extracted. The window length is set to L=28 (i.e., each window contains 28 seconds of data), and the sliding step size is 1 (i.e., sliding one sampling point at a time). For the i-th window (i=1,2,…,9973), the corresponding power slice is extracted. and timestamp slices .
[0024] For each timestamp slice Perform local standardization. Let the time scale constant τ = 600 (representing 10 minutes, used to normalize time differences to a reasonable range). For the j-th timestamp (j = 1, 2, ..., 28) within the i-th window, through... Calculations yield normalized timestamp slices. .in This is the start timestamp of the window. This represents the original value of the j-th timestamp within the i-th sliding window. The preset time scale constant, This is the normalized time value of the j-th timestamp in the i-th sliding window after standardization.
[0025] Slice the power corresponding to each window and timestamp slices Treating them as two feature vectors, concatenating them along the second dimension generates the i-th feature vector. , where each feature vector The dimension is 2L=56, where the first 28 dimensions are normalized power features and the last 28 dimensions are normalized timestamp features.
[0026] The feature vectors generated by all windows are aggregated to form the feature vector set used for training. As the normal sample set for subsequent single-class classification (SVDD) models, it is used to train a data distribution model describing the normal operating status of air conditioners.
[0027] Step 102: Using the feature vector set as the normal sample set, construct a single classification model based on the support vector data description method. Map the samples to the feature space through the Gaussian radial basis kernel function and train to obtain a parameterized hypersphere model that describes the distribution of normal data.
[0028] Among them, the Gaussian radial basis kernel function is a kernel function based on the Euclidean distance between samples, and its kernel width parameter controls the density of sample distribution in high-dimensional space.
[0029] In some implementations, the feature vector set after sliding window slicing and concatenation is used as input, ensuring that each vector contains a power sequence segment and a corresponding timestamp segment. A pre-defined Gaussian radial basis function is then used to perform a nonlinear mapping on each feature vector, projecting it into a high-dimensional feature space to form a high-dimensional set of sample points. An optimization objective function can then be constructed in this high-dimensional space, aiming to find a minimal hypersphere that can encompass all normal sample points. Simultaneously, relaxation variables are introduced to allow some samples to lie outside the boundary, and a penalty factor controls the degree of boundary relaxation.
[0030] The original problem is then transformed into a dual optimization problem using the Lagrange multiplier method, and the support vectors located on the hypersphere boundary are identified using the KKT conditions. A sequential minimum optimization algorithm is then used for iterative solution. In each iteration, the two multipliers that most severely violate the KKT conditions are selected for updating, and the hypersphere center and radius parameters are adjusted simultaneously until all multipliers satisfy the convergence condition. The final center vector, radius, and support vector weights are then output, completing the construction of the single-classification model.
[0031] It should be noted that the kernel width parameter of the Gaussian radial basis function needs to be optimized using grid search combined with cross-validation to adapt to the operating characteristics of different electrical equipment. The penalty factor should be adjusted according to the anomaly tolerance requirements in the actual scenario; a larger value makes the model more sensitive to anomalies but may reduce its robustness to noise. The number of support vectors directly affects model complexity and inference speed, and should be monitored during training to avoid overfitting. The iterative convergence threshold of the sequence minimum optimization algorithm should be set reasonably based on computational resources and real-time requirements to ensure model training efficiency and stability.
[0032] Step 103: Use the sequence minimum optimization algorithm to solve the Lagrange dual problem of the single classification model to obtain the hypersphere center vector, radius parameter and support vector weights.
[0033] Among them, the Sequence Minimum Optimization algorithm is an efficient iterative algorithm for solving support vector machine-type optimization problems. Its main characteristic is that it optimizes only two Lagrange multipliers in each iteration, decomposing the complex optimization problem into a series of analytically solvable quadratic programming subproblems. The Lagrange dual problem is formed by introducing Lagrange multipliers to transform the original constrained optimization problem into an unconstrained optimization problem, thus avoiding directly dealing with complex constraints in high-dimensional mapping spaces. The hypersphere center vector is the center coordinate vector of the smallest hypersphere enclosing all normal samples in the high-dimensional feature space. The radius parameter is the radius length of the hypersphere. The support vector weights, i.e., the Lagrange multipliers, are used to describe the contribution of each training sample to the formation of the hypersphere boundary.
[0034] In some implementations, all Lagrange multipliers are initialized to zero, and a convergence tolerance threshold is set. During each iteration, the two multipliers with the most severe violation of the KKT conditions are selected as optimization variables, while the other multipliers are fixed. The original problem is simplified to a quadratic programming subproblem with respect to these two variables, which is then solved analytically to update the values of these two multipliers. After each multiplier update, the hypersphere center vector is recalculated based on the updated multipliers. The expression of the center vector in the high-dimensional feature space is composed of the weighted kernel function values of all support vectors. Therefore, the distances from each support vector to the center can be recalculated directly based on the updated multipliers and the center, and the distances corresponding to the support vectors located on the boundary are selected as the new radius parameters. The iteration process continues until all multipliers satisfy the KKT conditions or stabilize within the preset tolerance threshold. Finally, the converged hypersphere center vector, radius parameters, and corresponding support vector weight sets are output.
[0035] Step 104: Collect the operating data of the target electrical appliance in real time, perform preprocessing, generate real-time feature vectors, and combine them with support vector weights to calculate the judgment distance between the real-time feature vectors and the center of the hypersphere in the feature space.
[0036] The decision distance refers to the Euclidean distance between the real-time feature vector, after being mapped to a high-dimensional feature space through a Gaussian radial basis kernel function, and the center of the pre-trained hypersphere.
[0037] In some implementations, the operating power sequence is obtained in real time from the monitoring devices of the target electrical appliances in the virtual power plant (such as smart meters and smart sockets). and corresponding timestamp sequence Then, preprocessing can be performed directly using the same method as in the training phase: first through... right Global normalization is performed to obtain ,in This represents the normalized power value after local standardization of the j-th timestamp in the i-th sliding window during the real-time phase. and This uses historical extreme values from the training phase. Then, it uses the same window length L as the training phase. and Perform sliding window slicing. This allows direct access to the same timescale constant as during the training phase. ,pass Local normalization is performed on the timestamp slices, where This refers to the normalized time value of the j-th timestamp within the i-th sliding window during the real-time phase, after local standardization. This represents the original value of the j-th timestamp within the i-th sliding window in the real-time data (corresponding to the (i+j-1)-th sampling point in the original timestamp sequence). Let be the start timestamp of the i-th sliding window in the real-time data. This is a time scale constant. Finally, the power slice and the timestamp slice are concatenated in the second dimension to generate a real-time feature vector. .
[0038] Using the Gaussian radial basis kernel function determined during the training phase. Based on the Support Vector Data Description (SVDD) theory, real-time feature vectors are... Substituting into the decision distance formula in the kernel mapping space , obtain the determination distance .in This refers to the real-time feature vector generated after preprocessing the real-time collected operating data of the target electrical appliances. Real-time feature vector Determine the distance. Let Gaussian radial basis kernel function be used. Real-time feature vector Compared with its own Gaussian radial basis kernel function value, Real-time feature vector With feature vectors Gaussian radial basis kernel function values between and For Lagrange multipliers, The total number of samples in the training set. It is the sum of the weighted kernel function values of the real-time feature vector and all training samples. , The constant terms calculated during the training phase , which represents the squared norm of the hypersphere's center in the core space.
[0039] The constant term can be calculated and stored during the training phase. And for each real-time feature vector ,calculate and Therefore, the calculated results can be directly obtained. Substitution Thus, the final determination distance is obtained. .in is a constant term, representing the squared norm of the hypersphere's center in the nucleus space.
[0040] It should be noted that the kernel function parameters and Lagrange multiplier subsets used must be completely consistent with those used in the training phase to ensure the accuracy of the distance metric.
[0041] Step 105: Based on the hypersphere's center vector, radius parameters, and judgment distance, filter the abnormal states of target electrical appliances, remove the corresponding devices from the virtual power plant's resource scheduling pool, and send health warning information to the user.
[0042] During the real-time detection phase, the system first acquires the real-time feature vector of the current target electrical appliance. and the distance from the vector to the center of the hypersphere By reading the radius parameter R obtained during the training phase, the current adaptive tolerance factor δ can be calculated, and the anomaly detection threshold T can be calculated using T=R+δ.
[0043] Thus directly Compare with the anomaly detection threshold T: If If the value is ≤T, the equipment status is determined to be normal, and the process ends; if... If T, it is considered an anomaly. Once an anomaly is determined, it is immediately processed according to the formula. The calculated percentage of exceedance is used to determine the anomaly level as mild, moderate, or severe based on the range this percentage falls into (e.g., 0-10%, 10%-30%, above 30%), generating an anomaly severity label. This allows the construction of a system that includes the device ID obtained from the device communication unit, the current system timestamp, and the real-time feature vector. Distance to the center of the hypersphere , and the anomaly label vector of the anomaly degree label.
[0044] Subsequently, a device scheduling block command (containing the device ID and a "remove" opcode) is generated and sent in real time to the resource scheduling management module of the virtual power plant via an internal communication interface. Upon receiving the command, the scheduling module immediately removes the device from the currently schedulable resource pool, ensuring that subsequent scheduling plans do not include the abnormal device. Simultaneously, an early warning module is triggered, encrypting the warning information, including the device ID, anomaly timestamp, and anomaly level, using a pre-set encryption algorithm (such as AES), and then sending it to pre-defined user contacts via SMS, app push notifications, or email. Finally, the anomaly tag vector corresponding to this anomaly event is stored in the historical anomaly database for subsequent periodic model updates (e.g., retraining the model when enough new normal data has been accumulated) or for trend analysis of device health status.
[0045] The adaptive tolerance factor δ is based on all non-zero multipliers in the Lagrange multiplier set (i.e., the multipliers corresponding to the support vectors). The standard deviation of the sample is obtained by multiplying it by a preset adjustment coefficient k.
[0046] It should be noted that the setting of the adjustment coefficient k needs to be adjusted according to the specific operation strategy of the virtual power plant and the requirements for anomaly sensitivity. A higher k value will increase the threshold T, making the detection more lenient and suitable for scenarios with high tolerance for intermittent noise. Conversely, the detection will be more stringent. Furthermore, the anomaly level classification thresholds (10%, 30%, 50%) can be customized according to the importance of different electrical equipment and the consequences of failure.
[0047] For example, taking a commercial air conditioner participating in demand response in a virtual power plant as an example, after calculating its operating feature vector in real time, the determination distance is obtained. =15.2, the trained model radius R=12.0, the standard deviation of the currently calculated support vector weights is 0.5, the adjustment coefficient k=0.4, then δ=0.2, if the anomaly judgment threshold T=12.2. Since 15.2>12.2, it is judged as an anomaly. The calculated excess percentage is (15.2-12.2) / 12.2×100%≈24.6%, which belongs to the moderate anomaly level. Thus, an anomaly label vector [AC-001,2025-10-27,14:30:05,15.2, moderate] is generated, and a blocking command is sent to remove air conditioner AC-001 from the scheduling pool. At the same time, an encrypted warning message is sent to the property manager's mobile phone: "Equipment AC-001 detected a moderate anomaly at 14:30, it is recommended to check."
[0048] Based on the above technical solutions, by collecting power and timestamp sequences and preprocessing and concatenating them, the feature dimensions are enriched to comprehensively depict the operating status of equipment, thus solving the problem of single detection features in traditional methods. Simultaneously, an unsupervised single-classification model is constructed based on SVDD, using Gaussian radial basis kernel functions to achieve high-dimensional mapping of complex data. This eliminates the need to rely on scarce abnormal samples, overcoming the pain points of diverse equipment types and difficulty in labeling abnormal data in virtual power plants, reducing data acquisition and model training costs. Furthermore, combining this with the structure of the SMO algorithm for solving the dual problem allows for rapid acquisition of key parameters of the hypersphere, ensuring model training efficiency and accuracy. In the real-time detection stage, the preprocessing process is reused to generate feature vectors, and the judgment distance is accurately calculated using kernel functions and model parameters, enabling rapid identification of abnormal states. Finally, abnormal equipment is removed promptly and warnings are issued, avoiding the issuance of invalid scheduling commands, improving the confidence and reliability of the virtual power plant's dispatchable capacity, adapting to the real-time monitoring needs of large-scale terminal equipment, and enhancing operational stability.
[0049] In another possible implementation of the embodiments of this application, combined with Figure 1-2 As shown, the process of constructing a single-classification model based on the support vector data description method, using the feature vector set as the normal sample set, can be achieved through the following steps 201 to 203, which are explained in detail below: Step 201: Denote the feature vector set as the normal sample point set, and denote the feature vectors in the feature vector set as normal sample points.
[0050] In some implementations, all feature vectors are aggregated into a feature vector set and labeled as a normal sample point set, where each feature vector is a normal sample point, representing the normal operating state of the appliance within a specific time window. This normal sample point set then serves as input to the subsequent Support Vector Data Description (SVDD) single-classification model, used to construct a hypersphere model describing the distribution of normal data in the feature space.
[0051] Step 202: By finding the minimum hypersphere that encloses all normal sample points in the feature space, define the optimization objective function. The minimum hypersphere is described by the center vector and radius parameters.
[0052] The minimum hypersphere refers to the smallest volume hypergeometry that can enclose all normal sample points in the high-dimensional feature space mapped by the kernel function, and is uniquely determined by the center vector a and the radius R. The optimization objective is to minimize the volume of the hypersphere, i.e., minimize R, while ensuring that normal samples are included as much as possible. 2 .
[0053] In some implementations, the feature vector set is used as input to the normal sample point set. In the high-dimensional feature space, an optimization problem is constructed to find a minimum hypersphere that can enclose all normal sample points, which helps to make the descriptive boundary of the normal data as compact as possible.
[0054] To address potential noise or atypical normal points in real-world data (i.e., not all points can be perfectly enclosed by a compact sphere), a non-negative relaxation variable is introduced into the optimization objective for each sample point. This is used to represent the degree to which the sample point is allowed to deviate from the hypersphere boundary. Accordingly, a term is added to the objective function for all slack variables. And multiply by the penalty factor C, i.e., C*Σ ,in Let be all slack variables. Therefore, the complete optimization objective function is structured as follows: ,in To minimize the square of the hypersphere radius R, The penalty factor C is multiplied by all slack variables. The sum of.
[0055] At the same time, this optimization problem must satisfy the constraint condition: for each normal sample point (After kernel function mapping), the squared distance from it to the center a is no greater than the square of the radius R plus its corresponding slack variable, i.e. And require all ,in For sample points The vector obtained by mapping to a high-dimensional feature space using the Gaussian radial basis kernel function. Let be the square of the Euclidean distance from the mapped sample point to the center of the sphere a.
[0056] The default value of the penalty factor C is usually determined before model training through methods such as cross-validation or grid search. The larger the value, the heavier the penalty is on samples outside the boundary (even noise in normal samples), tending to obtain a more compact hypersphere, but it may reduce the robustness to the inherent fluctuations of the data; conversely, a smaller C value allows more sample points to be located outside the boundary, and the model is more lenient.
[0057] Finally, by solving this constrained optimization problem, we can obtain the minimum hypersphere model that describes the normal data distribution, thus determining the center vector a and the radius parameter R.
[0058] It's important to note that the construction of the objective function is based on the core idea of the Support Vector Data Description (SVDD) single-class classification model. Minimizing the hypersphere volume (R²) allows the model to compactly describe the distribution area of normal data, thus increasing the probability of classifying new data points as anomalies when they fall outside this area. Simultaneously, introducing slack variables and a penalty factor serves as a regularization technique, effectively preventing the model from overfitting to individual noise or minor variations in the training data due to pursuing an excessively small radius, thereby improving the model's generalization ability and practicality in complex real-world operating environments. Finally, the selection of the penalty factor C is a crucial step in model tuning, requiring a trade-off between the sensitivity and false alarm rate of anomaly detection in the specific scenario of the virtual power plant.
[0059] For example, suppose that the normal operation data of a certain type of air conditioner in a virtual power plant, after preprocessing, yields 1000 feature vectors as a normal sample set. When constructing the SVDD model, a penalty factor C = 0.1 is set. By solving the above optimization objective function, the center vector a (a multidimensional vector) and radius R = 2.5 in the high-dimensional feature space are finally calculated. This means that in this model, an ideal, minimal hypersphere enclosing 1000 normal sample points has its center at a, and its boundary is 2.5 units away from the center. The introduction of slack variables means that it may be permissible for a few normal sample points (e.g., due to measurement transient noise) to be slightly more than 2.5 units away from the center, but these points... The value will be very small and subject to a penalty of C=0.1. Thus, this hypersphere with a defined center and radius constitutes the reference benchmark model for the normal operation of the air conditioner.
[0060] Step 203: Introduce slack variables into the objective function and control the degree of boundary slackness through a penalty factor. The slack variables allow some normal sample points to be located outside the hypersphere boundary, and the penalty factor is used to control the penalty weight of the model on samples outside the boundary.
[0061] Among them, the Gaussian radial basis function (RBF) is a commonly used nonlinear kernel function that can map samples in the original feature space to a higher-dimensional or even infinite-dimensional feature space, making originally linearly inseparable data separable. Its expression is: .in Let Gaussian radial basis kernel function be used. For any two eigenvectors and Gaussian radial basis kernel function values between and For any two eigenvectors, It is a natural exponential function. For vectors and The Euclidean distance between them is the bandwidth parameter of the Gaussian radial basis kernel function.
[0062] In some implementations, for a feature vector set containing N normal samples, each sample point... Assign a corresponding slack variable And requires ≥0. At this point, the original optimization objective is to minimize the square of the hypersphere radius R. This is now modified to minimize both R² and the weighted term of the sum of all slack variables. Therefore, the objective function becomes: ,in The goal of this optimization problem is to find a set of parameters that minimizes the objective function. The variables to be optimized include the radius R of the hypersphere, the center vector a, and the relaxation variables corresponding to all samples. R is the radius of the hypersphere being searched. It is the square of its value, where C is the penalty factor and N is the total number of normal training samples. It is the sum of the slack variables of all N training samples.
[0063] During its actual operation, its constraints ranged from strict Relaxed to This means that if a sample point's distance to the center of the sphere exceeds the radius R due to its own characteristics (such as noise or natural fluctuations in normal data), then a positive slack variable can be used to mitigate this. The value is used to "absorb" this excess, so that it still satisfies the constraint, thus allowing the point to lie outside the strict boundary defined by R.
[0064] The pre-setting of the penalty factor C is a crucial step before model training, typically determined based on experience or through a combination of grid search and cross-validation. A larger C value indicates a higher penalty weight applied to the sum of slack variables during optimization, and the model will tend to choose a smaller C value. The value of C forces the hypersphere boundary to be as tight as possible, encompassing more samples. This may make the model more sensitive to anomalies but could also lead to overfitting to noise; conversely, the smaller the C value, the lighter the penalty for relaxation, allowing the model to tolerate larger... The resulting hypersphere has a looser boundary, making it more inclusive of natural variations in normal data, but it may reduce the ability to distinguish real anomalies.
[0065] Therefore, during the model training and solution process, optimization algorithms (such as the Sequence Minimum Optimization (SMO)) will simultaneously optimize the sphere center a, radius R, and all slack variables. This allows it to find the optimal solution that balances the compactness of the hypersphere with the inclusiveness of sample points under the regulation of the penalty factor C.
[0066] For example, when building an anomaly detection model for an office building lighting circuit, power sequences from a week's normal working days are collected as normal samples. Therefore, when training the SVDD model, setting the penalty factor C to a large value (e.g., C=10) indicates that the model has a strong penalizing intention for any sample point located outside the hypersphere. Suppose that a sample point's distance from the center of the hypersphere is slightly greater than the initially calculated radius R due to a power spike at the moment the light is switched on (which is normal operational noise). The optimization algorithm aims to minimize C*Σ in the objective function. The term would tend to slightly increase the radius R or adjust the center a of the sphere, rather than assigning a larger radius to that point. A higher value for C might result in a relatively large boundary that can contain the peak. Conversely, if C is set to a smaller value (e.g., C=0.01), the model's relaxation penalty for the boundary is light. Faced with the same power peak sample, the optimization algorithm might prefer to assign a smaller positive value to that point. The value is adjusted so that the radius R remains relatively small, resulting in a more compact boundary model that ignores individual noise points. This allows the penalty factor C to effectively control the relaxation of the model boundary and the final detection sensitivity.
[0067] Based on the above technical solution, by defining the preprocessed feature vector set as the normal sample point set, the foundation for unsupervised detection can be laid. This eliminates the need for scarce anomaly sample annotations, addressing the pain points of diverse equipment types and difficulty in obtaining anomaly data in virtual power plants, significantly reducing data acquisition and model training costs. Simultaneously, a minimum hypersphere enclosing normal sample points is constructed in the feature space, and an optimization objective function is defined. This allows the hypersphere's center vector and radius parameters to accurately characterize the normal data distribution boundary, making the distinction between normal and anomaly states clearer, improving detection accuracy, and avoiding misjudgments caused by single features in traditional methods. Finally, relaxation variables and penalty factors are introduced, allowing noise or slight fluctuations in normal samples to lie outside the hypersphere boundary. The penalty factor flexibly adjusts the boundary relaxation degree, enhancing the model's robustness to complex operating conditions and effectively addressing data noise in the operation of massive amounts of equipment in virtual power plants. This overall progressive structure enables low-cost, high-precision, and highly adaptable anomaly detection, ensuring the reliability of virtual power plant resource scheduling, avoiding invalid scheduling commands, and improving operational stability.
[0068] In another possible implementation of the embodiments of this application, combined with Figure 1-3 As shown, the process of mapping samples to the feature space using the Gaussian radial basis kernel function and training a parameterized hypersphere model describing the normal data distribution can be achieved through steps 301 to 305, which are explained in detail below: Step 301: Project the feature vectors in the normal sample set from the original feature space to the feature space using the Gaussian radial basis kernel function.
[0069] In some implementations, each feature vector in the preprocessed normal sample set is used as input, and a preset Gaussian radial basis function is applied. The samples are nonlinearly mapped, where σ is the kernel width parameter, and its value is optimized by grid search combined with cross-validation to adapt to the operating characteristics of different electrical equipment.
[0070] The mapping step includes... The inner product of the mapped vectors is calculated directly, without explicitly calculating the mapping function itself. It is an implicit mapping function, while the kernel function is... After introducing the kernel function, the dual optimization problem will be transformed into... ,in, and Let be the Lagrange multiplier, used to represent the weight of each sample's contribution to the hypersphere boundary. For feature vectors The value of its own Gaussian radial basis kernel function; the constraint condition is... , .
[0071] For example, when building an anomaly detection model for a commercial air conditioner, the power sequence during its normal operation can be collected first, and a feature vector set can be obtained after preprocessing. The kernel width parameter σ of the Gaussian radial basis function is set to 1.5, which is selected from {0.5, 1.0, 1.5, 2.0} through grid search, determined by the criterion of achieving the highest accuracy with five-fold cross-validation. This kernel function is then used to map all normal samples to a high-dimensional feature space. In this space, normal sample points exhibit a compact clustered distribution. A minimal hypersphere model is then constructed in this high-dimensional space to enclose these normal sample points. Finally, the center vector and radius of the hypersphere are obtained by solving the equation.
[0072] Step 302: Construct the Lagrange dual problem of SVDD in the feature space.
[0073] The Lagrange dual problem is a dual form formed by transforming the original constrained optimization problem into an unconstrained optimization problem by introducing Lagrange multipliers. Solving this dual problem avoids directly dealing with the complex constraints in high-dimensional mapping spaces. Lagrange multipliers are variables introduced into the optimization problem to handle constraints; in SVDD, they represent the contribution weight of each sample to the formation of the hypersphere boundary. The dual problem refers to transforming the original optimization problem (called the primal problem) into an equivalent but generally easier-to-solve optimization problem using a Lagrange function. The KKT conditions, short for Karush-Kuhn-Tucker conditions, are a set of necessary conditions that must be satisfied for the Lagrange multiplier method to obtain the optimal solution. These include primal constraints, dual feasibility, and complementary relaxation conditions.
[0074] In some implementations, the original optimization problem of SVDD is constructed based on the normal sample set that has been mapped to a high-dimensional feature space through the Gaussian radial basis kernel function. That is, to find the minimum hypersphere, the objective function of which is to minimize the sum of the square of the radius and the slack variable penalty term. The constraint is that the square of the distance from each mapped sample to the center of the sphere is no greater than the square of the radius plus its corresponding slack variable.
[0075] To solve this constrained optimization problem, Lagrange multipliers are introduced to construct the Lagrange function. This function combines the objective function and constraints into an unconstrained expression through the multipliers. Then, by taking the partial derivatives of the Lagrange function with respect to the center vector, the square of the radius, and the slack variables, and setting them to zero, a set of relations is obtained. This shows that the center vector can be represented by a linear combination of all samples, and that there is a specific relationship between the Lagrange multipliers, the slack variables, and the penalty factor. Substituting these relations back into the Lagrange function eliminates the original variables, thus transforming the original optimization problem into a dual optimization problem with respect to the Lagrange multipliers. The objective function is to maximize an expression containing only the values of the Lagrange multipliers and the kernel function, i.e. And at the same time, the constraints must be met. ,and ,in, This serves as a penalty factor, controlling the degree of penalty applied to samples outside the boundary. This allows the construction of the dual optimization problem, laying the foundation for efficient solutions using algorithms such as sequential minimum optimization. By solving for the optimal subset of Lagrange multipliers, the center, radius, and boundary of the hypersphere can be determined.
[0076] It should be noted that the Lagrange dual transformation is key to solving the support vector data description problem, transforming the optimization problem from dealing with geometric constraints in a high-dimensional space into solving a convex quadratic programming problem. Simultaneously, the constraints in the dual problem... This ensures the rationality of the definition of a hypersphere, while constraints The penalty factor C is then directly reflected in the range of values for the multipliers, thereby controlling the model's tolerance for samples outside the boundary. Finally, according to the KKT conditions, the optimal solution is achieved when most of the Lagrange multipliers are... The multiplier will be zero, and only a few samples located on the boundary (i.e., support vectors) will have non-zero multipliers, which greatly reduces the model complexity and improves the computational efficiency of subsequent real-time detection.
[0077] For example, when building an anomaly detection model for commercial refrigerators within a virtual power plant, normal operation data is collected and preprocessed with kernel mapping to obtain a high-dimensional feature sample set. A penalty factor C = 0.1 is set. Then, a Lagrangian dual problem can be constructed based on this sample set: the objective is to maximize... The kernel function K uses a Gaussian radial basis function and the parameter σ has been optimized and determined. The constraints are as follows: And each have By solving this dual problem, a set of optimal Lagrange multipliers is obtained. Most of them The value is 0, and only a few corresponding boundary samples have this value. The values are non-zero, between 0 and 0.1. The corresponding samples and their corresponding support vectors together define the hypersphere boundary describing the normal operating area of the refrigerator.
[0078] Step 303: By solving the Lagrange dual problem, the optimal Lagrange multipliers are obtained, and the boundary of the parameterized hypersphere model is defined.
[0079] In some implementations, after successfully constructing the Lagrange dual problem of SVDD, the sequential minimum optimization algorithm is used to iteratively solve the problem. In this case, the algorithm selects the two Lagrange multipliers that violate the KKT conditions most severely in each iteration as optimization variables, and fixes the other multipliers, thereby decomposing the complex problem into a series of analytically solvable quadratic programming subproblems.
[0080] The selected two multipliers can then be adjusted using an update formula to ensure that the adjusted multiplier values still satisfy the constraints. and And after each multiplier update, based on the updated set of multipliers, the expression of the sphere center in high-dimensional space is used. Recalculate the center vector of the hypersphere, where This is the implicit mapping corresponding to the kernel function.
[0081] Using the updated sphere centers and multiplier subsets, compute all support vectors (i.e., corresponding to...). The distance from the center of the sphere to the sample with a value greater than 0 in the kernel mapping space, and selecting any sample that satisfies this condition. The distances corresponding to the support vectors are used as the updated hypersphere radius R. The iterative process of selecting, updating, and calculating the radius is then repeated until all Lagrange multipliers satisfy the KKT conditions (i.e., the violation is below a preset tolerance threshold, such as...). At this point, the algorithm converges and outputs the final optimal subset of Lagrange multipliers. Vector center and radius Finally, using the obtained optimal subset of Lagrange multipliers and the sphere center vector, the boundary of the parameterized hypersphere model can be completely defined, and its boundary is defined by all vectors satisfying 0 < 0. Supported by support vectors ≤ C, and radius This defines the boundary of the normal data distribution range.
[0082] It should be noted that the optimal Lagrange multipliers obtained by solving the dual problem are sparsity, meaning that most multipliers... The multipliers are zero, with only a few samples located on or outside the boundary having non-zero multipliers. These samples with non-zero multipliers are the support vectors, which determine the final shape and position of the hypersphere. This sparsity significantly reduces the overhead of model storage and real-time computation. Meanwhile, the determination of the hypersphere's radius depends on those samples that satisfy... The support vectors of the sample lie precisely on the boundary of the hypersphere, and the distance from the hypersphere's center to the center is the radius, ensuring the accuracy of the boundary definition. Furthermore, the preset tolerance threshold can also affect the accuracy and speed of iterative convergence. A smaller threshold will improve the solution accuracy but may increase the number of iterations; a balance needs to be struck based on actual computing resources and real-time requirements.
[0083] For example, when training an anomaly detection model for printer equipment in a virtual power plant, normal operation data is collected. After preprocessing, kernel mapping, and constructing a dual problem, a penalty factor C = 0.1 and a tolerance threshold of 0.001 are set. The SMO algorithm is used to solve the problem, and after multiple iterations, the algorithm converges. The final set of optimal Lagrange multipliers contains most of the... The value is 0, with only 5 samples. The value is non-zero, and three of the samples have this value. Equal to 0.1 (i.e., equal to C), 2 samples The value is between 0 and 0.1.
[0084] Therefore, the center vector of the sphere can be calculated using the formula. And select one For support vectors with values between 0 and 0.1, calculate their distance to the center of the sphere to obtain the radius. =2.3. Therefore, the boundary of the parameterized hypersphere model is fully defined: the center of the sphere is located at... The radius is 2.3, and the boundary is supported by these 5 support vectors.
[0085] Based on the above technical solution, by projecting the feature vectors of normal samples from the original space to a high-dimensional feature space using a Gaussian radial basis function, the nonlinear data distribution problem that is difficult to handle by traditional methods can be cleverly solved. This accurately characterizes the complex feature patterns of normal operation of electrical appliances, laying the foundation for anomaly differentiation. Simultaneously, a SVDD Lagrange dual problem is constructed in the high-dimensional space, transforming the solution of the constrained hypersphere into an easily computable convex quadratic programming problem, avoiding the complexity of direct computation in the high-dimensional space and making it more suitable for the massive equipment data processing needs of virtual power plants. Finally, the optimal Lagrange multipliers obtained from the solution define the hypersphere boundary, which can establish a classification benchmark relying only on normal samples, without the need for scarce anomaly sample labeling. This overcomes the pain points of multiple equipment types and difficulty in obtaining anomaly data in virtual power plants, significantly reducing data collection and training costs. Thus, the overall solution can achieve efficient real-time detection under unsupervised conditions, improve the reliability of virtual power plant equipment status monitoring, avoid ineffective scheduling, and enhance operational stability.
[0086] In another possible implementation of the embodiments of this application, combined with Figure 1-4 As shown, the process of solving the Lagrange dual problem of a single-classification model using the sequence minimum optimization algorithm to obtain the hypersphere's center vector, radius parameter, and Lagrange multiplication subset can be achieved through steps 401 to 403, which are explained in detail below: Step 401: Use the sequential minimum optimization algorithm to iteratively solve the Lagrange dual problem. In each iteration, select the top N Lagrange multipliers ranked by severity of violating the KKT conditions as optimization variables, and fix the other multipliers. The degree of violation of the KKT conditions is determined by calculating the difference between the distance and radius of the normal sample to the center of the hypersphere in the kernel mapping space.
[0087] The degree of violation of the KKT conditions refers to the deviation between the current solution and the ideal solution that satisfies the KKT conditions, and is used to measure the optimization state of the current solution.
[0088] In some implementations, all Lagrange multipliers are first initialized, and a convergence tolerance threshold is set. This allows the system to iterate through all training samples in each iteration, and for each sample, calculate the distance from the sample to the center of the hypersphere in the kernel mapping space based on the current set of multipliers, the kernel function, and temporary values of the hypersphere's center and radius. Then, the difference between this distance and the current radius is calculated, serving as a quantification of the severity of the sample violating the KKT conditions.
[0089] Then, all samples are sorted according to the calculated degree of violation, and the top N Lagrange multipliers with the most severe violations are selected as the optimization variables for this iteration, while all other multipliers are kept unchanged. This decomposes the original complex optimization problem into subproblems focusing only on these N variables.
[0090] Based on the update rules in the KKT conditions, the N selected multipliers are adjusted collaboratively to ensure that the adjusted new values still satisfy the constraints in the dual problem regarding the sum of the multipliers being 1 and the range of each multiplier being between 0 and the penalty factor C.
[0091] After the multiplier update is completed, the coordinate vector of the hypersphere's center in the high-dimensional space is immediately recalculated based on the updated set of multipliers. At this point, the center is represented by a weighted kernel mapping combination of all support vectors (i.e., samples with multipliers greater than zero). Subsequently, using the updated center and the set of multipliers, the distances from all support vectors to the new center are recalculated, and the distance corresponding to one of the support vectors whose multiplier values are in the range of 0 to C is selected as the updated hypersphere radius.
[0092] This iterative process is repeated, with each round re-evaluating the degree of violation, selecting variables, updating multipliers, the center of the sphere, and the radius, until the Lagrange multipliers corresponding to all samples satisfy the KKT conditions, i.e., the degree of violation is lower than the preset tolerance threshold. At this point, the algorithm converges and outputs the final determined hypersphere center vector, radius parameters, and Lagrange multiplier set.
[0093] KKT conditions include stationarity conditions, primal feasibility conditions, dual feasibility conditions, and complementary relaxation conditions. Among these, the stationarity condition is the center of the sphere. ,radius R and slack variables The partial derivatives of and itself are both set to zero. The original feasibility condition is that the constraints of the original problem must hold at the optimal solution. and The duality feasibility condition requires that the Lagrange multipliers introduced by the inequality constraints must be non-negative. Finally, the complementary relaxation condition means that an inequality constraint must either be "tight" (equality holds) or its corresponding Lagrange multiplier must be zero; neither can be non-zero simultaneously.
[0094] During use, if the sample point corresponding to the greatest degree of violation of the KKT conditions is selected... As the first variable. At this point, the sample points... The degree of violation of KKT conditions The calculation is as follows: ; in, R represents the degree to which the i-th sample violates the KKT conditions; R is the radius of the hypersphere in the current iteration. Let be the Lagrange multiplier corresponding to the i-th sample, representing the contribution weight of that sample to the boundary of the hypersphere; C is the penalty factor. Indicates sample The distance to the center of the current hypersphere in the high-dimensional feature space after mapping by the Gaussian radial basis kernel function is calculated as follows: ,in All of these are feature vectors from the training set. Let N be the Gaussian radial basis function kernel, and N be the total number of samples in the training set. Then, select the option that maximizes the change after solving the subproblem. As the second variable.
[0095] The parameter update formula, on the other hand, rewrites the optimization problem as a function of... and In short The specific update formula is as follows: .
[0096] in This is the new value after updating the j-th Lagrange multiplier; This is the old value before the j-th Lagrange multiplier is updated; The Lagrange multiplier corresponding to the k-th sample; and These represent the samples corresponding to the first selected optimization variable. With any sample The kernel function value, and the sample corresponding to the second optimization variable. and The kernel function value; and Representing samples respectively and The value of the kernel function, i.e. and ; Represented as a sample and The kernel function values between them, same .
[0097] From the constraints, we get Update formula: ,in This represents the new value of the i-th Lagrange multiplier after updating. This is the old value of the i-th Lagrange multiplier before the update; This is the old value of the j-th Lagrange multiplier before the update; Let be the new value of the j-th Lagrange multiplier.
[0098] For example, when building an anomaly detection model for a commercial air conditioner, the training set contains 1000 normal samples. After initialization, the first iteration calculates the violation degree of all samples and finds that the violation degree of 5 samples is significantly higher than that of the other samples. The algorithm then selects the multipliers corresponding to these 5 samples for optimization and update. After the update, the center and radius of the sphere are recalculated. In the next iteration, the violation degree is calculated again, and the violation degree of another 3 samples may become prominent. These 3 multipliers are then selected for optimization. This process is repeated, and after several iterations, the violation degree of all samples is lower than a preset threshold (e.g., 0.001). When the algorithm stops, it can output the hypersphere model parameters used to describe the normal operating area of the air conditioner.
[0099] Step 402: Update the optimization variables based on KKT conditions and update the hypersphere radius simultaneously.
[0100] In some implementations, the complex problem is first decomposed into a quadratic programming subproblem with N selected optimization variables. Then, for this subproblem, update formulas for these N variables can be derived using the Lagrange multiplier method and duality theory. These formulas are typically expressed as a combination of the old values of the variables, the degree of violation of the KKT, and kernel function calculations. These update formulas can then be directly applied to numerically calculate the new values for each selected optimization variable.
[0101] During the calculation, the global constraint must be strictly adhered to, namely, the sum of all Lagrange multipliers must always equal 1. Therefore, after updating some variables, normalization or other adjustment strategies are needed to maintain this constraint. Simultaneously, it must be ensured that each updated variable value still falls within its preset range (0 to the penalty factor C), and values exceeding this range need to be truncated.
[0102] After updating the selected multipliers, the hypersphere radius can be updated synchronously to reflect the latest state of the model. When updating the radius, the algorithm iterates through all sample points (i.e., support vectors) with Lagrange multipliers greater than zero. Using the latest center vector (calculated by combining all multipliers and samples using a weighted kernel) and the kernel function, it calculates the distance from each support vector to the new center in the kernel mapping space. Then, from all sample points whose multiplier values are strictly greater than 0 and less than C (i.e., standard support vectors located on the boundary), any one is selected, and its calculated distance to the center is directly set as the new hypersphere radius after this iteration. If no such sample exists, the sample with the smallest distance from the multiplier equal to C may be selected as the radius reference.
[0103] It should be noted that the derivation of the update formula relies on strictly limiting the original problem to a convex quadratic programming problem, thus guaranteeing the existence and global optimality of the analytical solution. In choosing "satisfying..." The support vectors are used to calculate the radius because, according to the KKT complementary relaxation condition, these points are precisely located on the boundary of the hypersphere, and their distance to the center of the sphere is theoretically equal to the radius. Therefore, using their distance to update the radius is the most accurate method. Maintaining the sum of the multipliers to 1 is crucial for the algorithm's stable convergence, and this is typically achieved by adjusting the update step size or scaling the updated subset of multipliers.
[0104] For example, in one iteration, the algorithm selects the two multipliers that most severely violate the KKT conditions. and As an optimization variable. Let the current... =0.02, =0.05, and the sum of other multipliers that sum to 1 is 0.93. Calculated according to the updated formula, we get... The new value is 0.03. The new value is 0.08. To keep the sum at 1, these two new values need to be adjusted, but this adjustment may cause... The penalty factor C = 0.1 is exceeded, therefore it is necessary to... Cut off to 0.1 and fine-tune again. To keep the sum as close to 1 as possible. After updating the multipliers, recalculate the center of the sphere and find all support vectors whose multiplier values are in the interval (0, 0.1). Suppose three such vectors are found, and their distances to the new center of the sphere are calculated to be 2.1, 2.15, and 2.08, respectively. The algorithm can choose a distance of 2.08 (or any other distance) as the new hypersphere radius R.
[0105] Step 403: Iterate until all multipliers satisfy the KKT conditions or are below the preset tolerance threshold, and output the hypersphere center vector, radius parameter, and Lagrange multiplier set.
[0106] The preset tolerance threshold is a pre-defined positive decimal used to quantify whether the optimization process has reached acceptable accuracy. The algorithm is considered convergent when the degree of violation of the KKT conditions by all samples is below this threshold. Therefore, a trade-off must be struck between model accuracy and training time when setting this threshold. An excessively small threshold may lead to unnecessary excessive iterations, increasing computational overhead; an excessively large threshold may cause the model to stop prematurely before sufficient optimization, affecting the accuracy of anomaly detection. Simultaneously, the degree of violation refers to the deviation between the current solution and the ideal solution that satisfies the KKT conditions, usually measured by the difference between the distance from the sample to the hypersphere and its radius, or its absolute value.
[0107] In some implementations, after each update of the optimization variables and the hypersphere radius, the algorithm iterates through every sample point in the training set and calculates the violation degree for that sample point based on the latest Lagrange multiplication subset, the hypersphere center vector, and the radius parameters. It then finds the maximum violation degree, i.e., the maximum violation degree. This maximum violation degree can then be directly compared with a pre-set tolerance threshold (e.g., 10). -3 The algorithm compares the maximum violation with the tolerance threshold. If the maximum violation is greater than the tolerance threshold, it indicates that some samples still clearly do not meet the KKT conditions, the model has not reached convergence, and the algorithm will return and continue to the next iteration, including selecting multipliers with high violation for optimization, updating variables and radii, etc. If the maximum violation is less than or equal to the tolerance threshold, it indicates that all samples have (approximately) met the KKT conditions, the algorithm's convergence condition is triggered, and the iteration loop terminates.
[0108] Once the iteration terminates, the algorithm provides the latest hypersphere center vector, radius parameters, and complete subset of Lagrange multipliers—which have passed the convergence test—as the final training output for use by the subsequent real-time detection module.
[0109] The calculation of the degree of violation strictly follows the KKT complementary relaxation conditions: for each sample, its degree of violation is quantified as the difference between the square of its distance to the center of the sphere in the kernel mapping space and the square of its current radius, and is judged in conjunction with its current multiplier value. For example, for a multiplier... For a sample where the distance is equal to 0, if the squared distance is greater than the squared radius, then the difference is considered a positive violation. For a multiplier... For samples of type C, if the squared distance is less than the squared radius, the degree of violation is the absolute value of the negative difference; for For a sample, if the square of its distance is not equal to the square of its radius, then the degree of violation is the absolute value of the difference between the two.
[0110] For example, when training a model containing 5000 normal samples, if the preset tolerance threshold is 0.001, after several iterations, the algorithm calculates the violation degree of all current samples and finds that the sample with the highest violation degree has a difference of 0.0008 between the squared distance and the squared radius. Since 0.0008 is less than 0.001, the convergence condition is met. The algorithm then stops iterating and outputs the sphere center vector, radius R=2.47, and a subset of Lagrange multipliers containing approximately 50 non-zero values. This indicates that the model training is complete, and the resulting hypersphere boundary can wrap around these 5000 normal samples with an accuracy of 0.001.
[0111] Based on the above technical solution, a hierarchical optimized iterative solution logic enables efficient and accurate model training, adapting to the needs of large-scale virtual power plant applications. This allows the system to first focus on the top N Lagrange multipliers that most severely violate the KKT conditions as optimization variables, while fixing the design of other multipliers. This decomposes the complex dual problem into subproblems focusing on the core, significantly reducing computational complexity and solving the problem of low efficiency in iterative solutions for massive amounts of terminal device data, ensuring real-time processing of large-scale data. Then, based on the KKT conditions, the optimization variables and the hypersphere radius are updated synchronously to ensure the synergy of parameter adjustments, avoiding model boundary shifts caused by single parameter updates. This solves the problem of insufficient detection accuracy caused by asynchronous parameters in traditional iterations, improving the accuracy of anomaly detection. Finally, parameters are output only after all multipliers meet the conditions or fall below the tolerance threshold, forming a closed-loop convergence mechanism. This avoids model instability caused by premature termination, solving the pain points of misjudgment and missed judgment in virtual power plant equipment anomaly detection. Ultimately, this ensures accurate identification and timely handling of abnormal equipment during virtual power plant resource scheduling, improving the reliability and operational stability of schedulable resources.
[0112] The above primarily describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, for example, an unsupervised detection system for electrical operation anomalies in a virtual power plant, includes at least one of the hardware structures and software modules corresponding to the execution of each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0113] This application embodiment can divide a system for unsupervised detection of electrical operation anomalies in a virtual power plant into functional units based on the above method example. For example, each function can be divided into separate functional units, or two or more functions can be integrated into the same processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0114] When using integrated units, Figure 5The above embodiment illustrates an unsupervised detection system for electrical appliance operation anomalies in a virtual power plant. It includes a data acquisition and preprocessing module for acquiring and preprocessing the operating power sequence and corresponding timestamp sequence of the target electrical appliance in the virtual power plant. The preprocessed power sequence and timestamp sequence are concatenated along the feature dimension to form a feature vector set. An SVDD model processing module uses the feature vector set as a normal sample set and constructs a single-classification model based on the Support Vector Data Description method. The samples are mapped to the feature space using a Gaussian radial basis kernel function, and a parameterized hypersphere model describing the normal data distribution is trained. The Lagrange duality problem of the single-classification model is solved using a sequence minimum optimization algorithm to obtain the hypersphere's center vector, radius parameter, and Lagrange multiplier subset. The operating data of the target electrical appliance is acquired in real-time and subjected to the same preprocessing to generate real-time feature vectors. Based on the Lagrange multiplier subset and kernel function, the determination distance between the real-time feature vector and the hypersphere's center in the feature space is calculated. The judgment and early warning module is used to identify target electrical appliances whose distance is greater than the radius parameter as being in an abnormal state, remove the abnormal state devices from the resource scheduling pool of the virtual power plant, and send health warning information to the user.
[0115] In one possible implementation, the process of constructing a single-classification model in the SVDD model processing module specifically includes: a sample point acquisition unit denoting the feature vector set as the normal sample point set, and the feature vectors in the feature vector set as normal sample points; an optimization objective function construction unit defining the optimization objective function by finding the smallest hypersphere that encloses all normal sample points in the feature space, where the smallest hypersphere is described by the center vector and radius parameters; and a single-classification model generation unit introducing relaxation variables into the optimization objective function and controlling the degree of boundary relaxation through a penalty factor. The relaxation variables allow some normal sample points to lie outside the hypersphere boundary, and the penalty factor controls the penalty weight for samples outside the boundary.
[0116] In implementation, each step of the method provided in this embodiment can be completed by integrated logic circuits in the processor or by instructions in software form. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0117] The processor in this application may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., and other computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor may be a standalone semiconductor chip or integrated with other circuits into a single semiconductor chip. For example, it may form a System-on-a-Chip (SoC) with other circuits (such as encoding / decoding circuits, hardware acceleration circuits, or various bus and interface circuits), or it may be integrated as a built-in processor within an ASIC. The ASIC with the integrated processor may be packaged separately or together with other circuits. In addition to the cores for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), programmable logic devices (PLDs), or logic circuits that implement dedicated logic operations.
[0118] The memory in the embodiments of this application may include at least one of the following types: read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions; random access memory (RAM) or other types of dynamic storage devices capable of storing information and instructions; or electrically erasable programmable-only memory (EEPROM). In some scenarios, the memory may also be compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0119] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0120] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, can understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0121] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely illustrative descriptions of the application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and variations.
Claims
1. An unsupervised detection method for electrical operation anomalies in a virtual power plant, characterized in that, include: The operating power sequence and timestamp sequence of the target electrical appliance are collected and preprocessed to form a feature vector set; Using the feature vector set as the normal sample set, a single classification model is constructed based on the support vector data description method. The samples are mapped to the feature space through the Gaussian radial basis kernel function to obtain a parameterized hypersphere model describing the distribution of normal data. The Lagrange dual problem of the single-classification model is solved using the sequence minimum optimization algorithm to obtain the hypersphere's center vector, radius parameter, and Lagrange multiplier subset; Real-time acquisition of the target electrical appliance's operating data is performed using the same preprocessing to generate a real-time feature vector. The determination distance between the real-time feature vector and the center of the hypersphere in the feature space is then calculated. Based on the determined distance, the system identifies and removes target appliances in abnormal states from the resource scheduling pool of the virtual power plant, and sends health warning information to the user.
2. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of using the feature vector set as a normal sample set and constructing a single-classification model based on the support vector data description method specifically includes: The feature vector set is denoted as the normal sample point set, and the feature vectors in the feature vector set are denoted as normal sample points; An optimization objective function is defined by finding the minimum hypersphere that encloses all the normal sample points in the feature space. The minimum hypersphere is described by the center vector and the radius parameter. A relaxation variable is introduced into the optimization objective function, and a penalty factor is used to control the degree of boundary relaxation. The relaxation variable allows some of the normal sample points to be located outside the hypersphere boundary, and the penalty factor is used to control the penalty weight of the model on samples outside the boundary.
3. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of mapping samples to the feature space using a Gaussian radial basis kernel function to obtain a parameterized hypersphere model describing the normal data distribution specifically includes: The feature vectors in the normal sample set are projected from the original feature space to the feature space using a Gaussian radial basis function (RBF) kernel, wherein the expression for the Gaussian radial basis function is: ; in, Let be the Gaussian radial basis kernel function. For any two eigenvectors and The Gaussian radial basis kernel function values between and For any two eigenvectors, It is a natural exponential function. For vectors and The Euclidean distance between them The bandwidth parameter of the Gaussian radial basis kernel function; Construct the Lagrangian dual problem of SVDD in the feature space, with the objective function being: ; in, and Let be a Lagrange multiplier, used to represent the contribution weight of each sample to the boundary of the hypersphere. For feature vectors The value of its own Gaussian radial basis kernel function; The constraints are: ,and ,in, This is a penalty factor used to control the degree of penalty for samples outside the boundary; By solving the Lagrange dual problem, the optimal Lagrange multipliers are obtained, and the boundary of the parameterized hypersphere model is defined.
4. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of using the sequence minimum optimization algorithm to solve the Lagrange dual problem of the single-classification model to obtain the hypersphere's center vector, radius parameter, and Lagrange multiplication subset specifically includes: The Lagrange dual problem is solved iteratively using a sequential minimum optimization algorithm. In each iteration, the top N Lagrange multipliers ranked by severity of violating the KKT conditions are selected as optimization variables, while the other multipliers are fixed. The degree of violation of the KKT conditions is determined by calculating the difference between the distance and radius of the normal sample to the center of the hypersphere in the kernel mapping space. The optimization variables are updated based on KKT conditions, and the hypersphere radius is updated synchronously. Iterate until all multipliers satisfy the KKT condition or are below the preset tolerance threshold, and output the hypersphere center vector, radius parameter, and Lagrange multiplier set.
5. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of calculating the determination distance between the real-time feature vector and the center of the hypersphere in the feature space specifically includes: The real-time feature vector By inputting the determination distance calculation formula, the determination distance between the real-time feature vector and the center of the hypersphere in the feature space is obtained. The determination distance calculation formula is as follows: ; in, This refers to the real-time feature vector generated after preprocessing the real-time collected operating data of the target electrical appliances. Real-time feature vector Determine the distance. Let Gaussian radial basis kernel function be used. Real-time feature vector Compared with its own Gaussian radial basis kernel function value, Real-time feature vector With feature vectors Gaussian radial basis kernel function values between and For Lagrange multipliers, This represents the total number of samples in the training set.
6. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of identifying and removing target electrical appliances in an abnormal state from the resource scheduling pool of the virtual power plant based on the determined distance, and sending health warning information to the user, specifically includes: Based on the preset adaptive tolerance factor of the dispersion of the support vector weight distribution in the Lagrange multiplier set, the sum of the radius parameter and the adaptive tolerance factor is calculated and denoted as the anomaly detection threshold. If the determination distance is greater than the anomaly determination threshold, the target electrical appliance is determined to be in an abnormal state, and an anomaly label vector is generated. Based on the abnormal label vector, a device scheduling blocking instruction is generated, which removes the corresponding device from the resource scheduling pool of the virtual power plant in real time and triggers the early warning module to send early warning information to the user.
7. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 1, characterized in that, The process of preprocessing the operating power sequence and corresponding timestamp sequence of the target electrical appliances in the virtual power plant specifically includes: The active power sequence of the target appliance is collected at a preset sampling frequency by using a smart meter or smart socket deployed on the appliance. and the corresponding timestamp sequence ,in Let j be the power value at the j-th sampling point. Let M be the timestamp of the j-th sampling point, and M be the total number of sampling points; pass The power sequence is globally normalized to obtain a normalized power sequence. ,in This is the minimum value in the historical power data. This is the maximum value in the historical power data. Let M be the normalized power value of the j-th sampling point, and M be the total number of sampling points. The normalized power sequence is processed using a sliding window. Slice the data with the timestamp sequence T and extract the power slice corresponding to the i-th sliding window. and timestamp slices , where L is the window length and i is the sliding window index; The timestamp slice is processed by Local standardization is performed to obtain a normalized timestamp slice sequence, where Let i be the start timestamps of the i sliding windows. Values on a time scale. Let be the value of the j-th timestamp within the i-th sliding window in the original timestamp sequence T, where the j-th timestamp is located within the i-th sliding window. This is the normalized time value of the j-th timestamp in the i-th sliding window after standardization.
8. The unsupervised detection method for electrical operation anomalies in a virtual power plant according to claim 7, characterized in that, The process of preprocessing the collected operating power sequence and timestamp sequence of the target electrical appliance to form a feature vector set specifically includes: The power slice corresponding to each window The timestamp slice is considered as two feature sub-vectors, and concatenated along the second dimension to generate the i-th feature vector. , where L is the length of the sliding window; The normalized power slice corresponding to the i-th sliding window contains L consecutive power values; The normalized timestamp slice corresponding to the i-th sliding window contains L consecutive time values; By summing all the aforementioned feature vectors, a feature vector set is obtained. , This represents the total number of samples in the training set.
9. An unsupervised detection system for electrical equipment malfunctions in a virtual power plant, characterized in that, A method for implementing an unsupervised detection of electrical operation anomalies in a virtual power plant as described in any one of claims 1-8 includes: The data acquisition and preprocessing module is used to collect the operating power sequence and corresponding timestamp sequence of the target electrical appliances in the virtual power plant, preprocess them, and concatenate the preprocessed power sequence and timestamp sequence in the feature dimension to form a feature vector set. The SVDD model processing module is used to treat the feature vector set as a normal sample set, construct a single-classification model based on the support vector data description method, map the samples to the feature space through the Gaussian radial basis kernel function, and train to obtain a parameterized hypersphere model describing the distribution of normal data; the sequential minimum optimization algorithm is used to solve the Lagrange dual problem of the single-classification model to obtain the hypersphere center vector, radius parameter, and Lagrange multiplier subset; the operating data of the target electrical appliance is collected in real time and subjected to the same preprocessing to generate real-time feature vectors, and the determination distance between the real-time feature vectors and the hypersphere center in the feature space is calculated based on the Lagrange multiplier subset and kernel function; The judgment and early warning module is used to identify the target electrical appliance corresponding to the judgment distance being greater than the radius parameter as being in an abnormal state, remove the device in the abnormal state from the resource scheduling pool of the virtual power plant, and send a health warning message to the user.
10. The unsupervised detection system for electrical operation anomalies in a virtual power plant according to claim 9, characterized in that, The process of constructing a single-classification model in the SVDD model processing module specifically includes: The sample point acquisition unit is used to denote the feature vector set as the normal sample point set, and the feature vectors in the feature vector set as normal sample points; An optimization objective function construction unit is used to define an optimization objective function by finding the minimum hypersphere that encloses all the normal sample points in the feature space, wherein the minimum hypersphere is described by the center vector and the radius parameter. A single-classification model generation unit is used to introduce slack variables into the optimization objective function and control the degree of boundary slackness through a penalty factor, wherein the slack variables allow some of the normal sample points to be located outside the hypersphere boundary, and the penalty factor is used to control the penalty weight of the model on samples outside the boundary.