Model training method, data restoration method and device, equipment and storage medium

By building and training the data repair model, the problem of missing power load monitoring data is solved, the repair efficiency and accuracy of power load monitoring data is improved, and the problem of poor repair capabilities in the existing technology is solved.

CN119226695AInactive Publication Date: 2024-12-31STATE GRID JIANGSU ELECTRIC POWER CO LTD NANJING POWER SUPPLY COMPANY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411177157.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing power load monitoring data repair methods have problems such as poor repair capabilities, low repair efficiency and accuracy, especially in large-scale power systems.

Method used

By constructing the original sample tensor, using the data repair model to decompose and synthesize the initial sample tensor, the reconstructed sample tensor, including the repair value of missing values, and the data repair model is trained based on the preset objective function and gradient descent algorithm. Improve data repair capabilities and accuracy.

Benefits of technology

It effectively improves the repair capability of the data repair model, improves the repair efficiency and accuracy of power load monitoring data, reduces resource consumption, and significantly improves the quality of data repair.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226695A_ABST
    Figure CN119226695A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, a data restoration method and device, equipment and a storage medium. An original sample tensor is constructed based on the power measurement sample data, an initial sample tensor is determined based on the original sample tensor, the original sample tensor comprises complete power measurement sample data, and the initial sample tensor comprises a missing value; decomposing the initial sample tensor by using a data restoration model to obtain a preset number of hidden feature sample tensors, synthesizing the preset number of hidden feature sample tensors to obtain a reconstructed sample tensor, the reconstructed sample tensor comprising a restoration value of a missing value in the initial sample tensor; and based on the original sample tensor and the reconstructed sample tensor, training the data restoration model by using a preset objective function and a preset gradient descent algorithm. The data recovery capability is effectively improved, the resource consumption of data recovery is greatly reduced, and the data recovery efficiency and precision are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of electric power information technology, and in particular to a model training method, a data repair method, a device, a equipment and a storage medium. Background Art

[0002] Power load monitoring refers to the process of real-time monitoring and evaluation of the amount of electric energy consumed in the power system. With the expansion of the scale of the power system and the advancement of technology, load monitoring methods and technologies are also evolving. With the rise of smart grids, modern power load monitoring tends to be automated, real-time and intelligent. Using sensors, smart meters, data acquisition equipment and network communication technology, the load data of the power system can be acquired and analyzed in real time, providing more timely and accurate information support for the operation and management of the power system. Although the development of modern power system monitoring equipment has made power load monitoring more convenient and accurate, there are still many factors that may lead to the loss of power load monitoring data. These factors include but are not limited to equipment failure, communication interruption, data transmission errors, human operation errors and environmental factors. Especially in large-scale power systems, these problems may be more significant. Missing data in the power load monitoring process will cause the monitoring system to be unable to fully record and reflect the actual operation of the power system, so data repair is crucial for missing power load monitoring data.

[0003] However, for missing data in large-scale data sets such as power load monitoring data, existing data repair methods have problems such as poor repair capability, low repair efficiency and accuracy. Summary of the invention

[0004] The present invention provides a model training method, a data repair method, an apparatus, a device and a storage medium to solve the problems of poor repair ability, low repair efficiency and precision in existing data repair methods.

[0005] According to one aspect of the present invention, a data repair model training method is provided, comprising:

[0006] Constructing an original sample tensor based on the electric power measurement sample data, and determining an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values;

[0007] Decomposing the initial sample tensor by using a data repair model to obtain a preset number of latent feature sample tensors, synthesizing the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor;

[0008] Based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained using a preset objective function and a preset gradient descent algorithm.

[0009] According to another aspect of the present invention, there is provided a data repair method, comprising:

[0010] Obtaining the power measurement data to be repaired;

[0011] Based on the electric power measurement data to be repaired, construct an original data tensor;

[0012] Inputting the original data tensor into a data repair model, decomposing the original data tensor using the data repair model to obtain a preset number of latent feature tensors, and determining a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired;

[0013] The data repair model is trained based on the data repair model training method described in any embodiment of the present invention.

[0014] According to another aspect of the present invention, there is provided a data repair model training device, comprising:

[0015] A tensor construction module, used to construct an original sample tensor based on the electric power measurement sample data, and determine an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values;

[0016] A tensor decomposition module is used to decompose the initial sample tensor using a data repair model to obtain a preset number of latent feature sample tensors, and synthesize the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor;

[0017] A model training module is used to train the data repair model based on the original sample tensor and the reconstructed sample tensor using a preset objective function and a preset gradient descent algorithm.

[0018] According to another aspect of the present invention, there is provided a data repair device, comprising:

[0019] A data acquisition module, used to acquire the power measurement data to be repaired;

[0020] A data tensor construction module, used to construct an original data tensor based on the electric power measurement data to be repaired;

[0021] A data repair module, used to input the original data tensor into a data repair model, decompose the original data tensor using the data repair model to obtain a preset number of latent feature tensors, and determine a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired;

[0022] The data repair model is trained based on the data repair model training method described in any embodiment of the present invention.

[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0024] at least one processor; and

[0025] a memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data repair model training method described in any embodiment of the present invention or execute the data repair method described in any embodiment of the present invention.

[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data repair model training method described in any embodiment of the present invention or the data repair method described in any embodiment of the present invention when executed.

[0028] The technical solution provided by an embodiment of the present invention constructs an original sample tensor based on electric power measurement sample data, and determines an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values; the initial sample tensor is decomposed by using a data repair model to obtain a preset number of latent feature sample tensors, and the preset number of latent feature sample tensors are synthesized to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor; based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained by using a preset objective function and a preset gradient descent algorithm. Through the above technical scheme, the data repair model is used to decompose the initial sample tensor constructed based on the power measurement sample data, and then the latent feature sample tensor obtained after the decomposition is synthesized to obtain a reconstructed sample tensor including the repair value, and then based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained using a preset objective function and a preset gradient descent algorithm. The data repair model is trained using a preset objective function and a preset gradient descent algorithm, which effectively improves the data repair capability of the data repair model and improves the data repair efficiency and accuracy.

[0029] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0031] Figure 1 is a flow chart of a data repair model training method provided in Embodiment 1 of the present invention;

[0032] Figure 2 is a schematic diagram of an initial sample tensor provided in this embodiment;

[0033] Figure 3 is a flow chart of a data repair method provided by Embodiment 2 of the present invention;

[0034] Figure 4 It is a structural schematic diagram of a data repair model training device provided in Embodiment 3 of the present invention;

[0035] Figure 5is a structural schematic diagram of a data repair device provided by Embodiment 4 of the present invention;

[0036] Figure 6 It is a structural schematic diagram of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] Embodiment 1

[0040] Figure 1 1 is a flow chart of a data repair model training method provided in the first embodiment of the present invention. This embodiment is applicable to the case of training a data repair model. The method can be executed by a data repair model training device. The data repair model training device can be implemented in the form of hardware and / or software. The data repair model training device can be configured in an electronic device. Figure 1 As shown, the method includes:

[0041] S110. Construct an original sample tensor based on the electric power measurement sample data, and determine an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values.

[0042] In this embodiment, the power measurement sample data can be understood as the complete data of the power system operation status collected by the monitoring device within a certain time interval. The power measurement sample data includes but is not limited to active power, reactive power, voltage, current and power factor. The original sample tensor is constructed based on the complete power measurement sample data. The missing value can be understood as the missing data in the original sample tensor.

[0043] Specifically, the complete data of the power system operation status collected by the monitoring equipment within a certain time interval is obtained. Considering that the power measurement sample data exists in the form of a time series, it shows randomness and periodicity. In order to better mine the value of these data, a third-order original sample tensor containing three dimensions, including monitoring days, daily sampling frequency and monitoring parameters, is constructed based on the power measurement sample data to support in-depth data analysis and optimization of the power system. In order to better simulate the actual situation of the power measurement sample data during the collection process and the training data repair model, some data in the original sample tensor is removed to obtain the initial sample tensor. At this time, the initial sample tensor includes missing values.

[0044] Optionally, after obtaining the initial sample tensor, the initial sample tensor may be preprocessed to obtain a preprocessed initial sample tensor. The preprocessing process may include identifying missing values ​​in the initial sample tensor, and the identified missing values ​​may be marked with a preset identifier, such as a question mark or NaN. For example, Figure 2 is a schematic diagram of an initial sample tensor provided in this embodiment, such as Figure 2 As shown, the initial sample tensor includes three dimensions: monitoring days I, daily monitoring sampling frequency J and monitoring parameters K. The question mark in the figure indicates missing values.

[0045] S120. Decompose the initial sample tensor using a data repair model to obtain a preset number of latent feature sample tensors, and synthesize the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor.

[0046] In this embodiment, the data repair model is a pre-built model for predicting and recovering missing values. The model may include a preset tensor decomposition algorithm and a preset tensor reconstruction algorithm. Among them, the preset tensor decomposition algorithm may include Tucker decomposition and tensor ring decomposition, etc., and the preset tensor reconstruction algorithm may include matrix filling and deep learning, etc. The latent feature sample tensor is used to represent the potential features of the initial sample data. The preset quantity can be understood as a preset quantity value.

[0047] Specifically, the initial sample tensor is input into the data repair model. The data repair model can first decompose and reduce the dimension of the initial sample tensor through a preset tensor decomposition algorithm, and extract a preset number of latent feature sample tensors. These latent feature sample tensors are not only lower in dimension and easier to process, but also reveal the potential patterns and relationships in the initial sample data. Then, the data repair model uses a preset tensor reconstruction algorithm to synthesize a preset number of latent feature sample tensors to obtain a reconstructed sample tensor. In this process, the data repair model uses the information in the latent feature sample tensor to accurately predict and fill in the missing values ​​in the initial sample tensor, so that the reconstructed sample tensor retains the characteristics of the original data while reasonably filling in the missing values.

[0048] S130. Based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained using a preset objective function and a preset gradient descent algorithm.

[0049] In this embodiment, the preset objective function can be understood as a pre-set function for measuring the difference between the original sample tensor and the reconstructed sample tensor. For example, the preset objective function can be the mean square error MSE and the mean absolute error MAE. The preset gradient descent algorithm can be understood as a pre-set algorithm for minimizing the preset objective function. For example, the preset gradient descent algorithm can include stochastic gradient descent SGD, batch gradient descent BGD, or mini-batch gradient descent Mini-Batch GD. Both the preset objective function and the preset gradient descent algorithm are used to train the data repair model.

[0050] Specifically, a preset objective function is used to quantify the difference between the reconstructed sample tensor and the original sample tensor, and then a preset gradient descent algorithm is used to iteratively update the model parameters to minimize the preset objective function. In each iteration, the gradient of the preset objective function to the model parameters is calculated, and the parameters are updated according to the gradient and the preset learning rate. The above process is repeated until the training stop condition is met. Among them, the training stop condition may include: the model performance is no longer significantly improved or the predetermined number of iterations is reached.

[0051] The technical solution provided in the first embodiment of the present invention is to construct an original sample tensor based on the electric power measurement sample data, determine the initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values; decompose the initial sample tensor using a data repair model to obtain a preset number of latent feature sample tensors, synthesize the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes the repair value of the missing value in the initial sample tensor; based on the original sample tensor and the reconstructed sample tensor, train the data repair model using a preset objective function and a preset gradient descent algorithm. Through the above technical solution, the original sample tensor is constructed based on the electric power measurement sample data, the reconstructed sample tensor is determined using the data repair model, and then based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained using a preset objective function and a preset gradient descent algorithm, which effectively improves the data repair capability, greatly reduces the resource consumption of data repair, and improves the data repair efficiency and accuracy.

[0052] In some embodiments, the preset number of latent feature sample tensors is obtained by decomposing the initial sample tensor using a tensor ring decomposition algorithm in the data repair model. Through the above technical solution, implicit feature information can be extracted, thereby enhancing the performance of the data repair model and further improving the quality of repairing damaged or missing data.

[0053] In this embodiment, tensor ring decomposition is a tensor network technology used to decompose and reduce the dimension of a high-dimensional tensor. It usually represents a high-order tensor as a cyclic product of a series of third-order tensors.

[0054] Specifically, considering that tensor ring decomposition can obtain more latent feature sample tensors and effectively capture the complex patterns in the original sample tensor, the tensor ring decomposition algorithm is used in the data repair model to decompose the initial sample tensor to obtain a preset number of latent feature sample tensors.

[0055] Exemplarily, the initial sample tensor is decomposed by tensor ring decomposition Decomposed into three latent feature sample tensors: and Among them, R 1 , R 2 , R 3 They represent the dimensions of each order in the initial sample tensor Y.

[0056] In some embodiments, the preset objective function includes a loss function term, a regularization term, and a non-negative constraint, wherein the loss function term is determined based on the Euclidean distance between the original sample tensor and the reconstructed sample tensor, the regularization term is determined based on Tikhonov regularization, and the non-negative constraint is a constraint on the parameters of the latent feature sample tensor. Through the above technical solution, the accuracy of data restoration and the generalization ability of the model are effectively improved.

[0057] In this embodiment, the loss function term is used to evaluate the performance of the model during the training process and guide the adjustment of the model parameters. The regularization term is used to control the complexity of the model and prevent overfitting.

[0058] Specifically, according to the original sample tensor, through the tensor ring synthesis operation, the reconstructed sample tensor can be obtained as follows:

[0059]

[0060] Among them, U, V, Z represent the latent feature sample tensors respectively, and φ() represents the tensor ring synthesis operation. Reconstructed sample tensor The expression for a single element in is as follows:

[0061]

[0062] in, Represent the elements of the latent feature sample tensor, r 1 、r 2 、r 3 They are used to traverse the dimensions of each order of the original sample tensor Y.

[0063] Furthermore, the loss function term is determined based on the Euclidean distance between the original sample tensor and the reconstructed sample tensor, as shown in the following formula:

[0064]

[0065] Among them, ε is given by It is obtained by squaring the norm of .

[0066] The original sample tensor and the reconstructed sample tensor are represented by corresponding elements, then The norm of can be expressed as:

[0067]

[0068] Among them, y ijk Represents a single element in the original samples tensor.

[0069] Therefore, ε can be expressed as follows:

[0070]

[0071] Furthermore, in order to prevent the model from overfitting and increase the generalization ability of the model, Tikhonov regularization is added to the above loss function:

[0072]

[0073] Among them, λ is the regularization term coefficient. express

[0074]

[0075] Regularization term. Represents a non-negative constraint. Considering that the power load measurement data obtained in the original sample tensor are all non-negative, in the above formula, a non-negative constraint is imposed on the parameters in the latent feature sample tensor to improve the representation ability of the model and achieve a more accurate representation of the power load monitoring data.

[0076] In some embodiments, the preset gradient descent algorithm is a stochastic gradient descent algorithm; using the preset gradient descent algorithm to train the data repair model includes: using the stochastic gradient descent algorithm to update the parameter value of the data repair model; truncating the parameter value so that the parameter value is non-negative. Through the above technical solution, model parameters can be effectively optimized, convergence speed can be accelerated, and the generalization ability and prediction accuracy of the model can be improved.

[0077] In this embodiment, the stochastic gradient descent algorithm is an iterative method for optimizing the objective function.

[0078] Specifically, the stochastic gradient descent algorithm is used to solve the preset objective function. According to the derivation principle, the following formula is obtained by derivation of each factor in the latent feature sample tensor U, V and Z:

[0079]

[0080] in, represents a subset of the i-th lateral slice matrix of the latent feature sample tensor. The i-th lateral slice matrix represents the matrix obtained by fixing the i-th dimension in the original sample tensor Y and passing through the j-th and K-th dimensions. Similarly, we can know and According to the principle of stochastic gradient descent algorithm, the change of gradient in the iterative update process may make the training parameters in the hidden feature sample tensor negative, which will cause the repaired missing value to be negative, which is obviously unreasonable. In order to ensure the repair ability of the model, it is very important to impose truncation during the iterative update process of the stochastic gradient descent algorithm. The update formula of truncated stochastic gradient descent is as follows:

[0081]

[0082] Among them, η represents the learning rate of the corresponding training parameter. The partial derivative is the partial derivative of the loss function with respect to the element weight of the latent feature sample tensor, and max(iteration weight, 0) means using the truncation method to ensure that the output result is non-negative.

[0083] Optionally, incorporating the alternating direction method into the iterative update process can significantly improve the convergence speed of the model. First, the original task is refined into multiple subtasks for more precise processing; second, these subtasks are solved one by one in a specific order. In this process, the solution of each subtask will refer to the results of the previously solved subtasks to ensure the coherence and efficiency of the overall optimization process. Therefore, the process of solving U, V, and Z in the nth training iteration is treated as a separate subtask:

[0084]

[0085] Among them, U (n) 、V (n) , Z (n) and U (n+1) 、V (n+1) , Z (n+1) denote the initial states at the nth and (n+1)th training iterations respectively.

[0086] Optionally, in order to evaluate the ability to repair the power measurement sample data, the two most widely used evaluation indicators are used to verify the effect of the model. One metric is the root mean square error (RMSE) and the other is the mean absolute error (MAE). The calculation formulas for the two evaluation indicators are given below:

[0087]

[0088] The lower the RMSE or MAE, the better the repair effect of the repair method on the missing data of power load monitoring.

[0089] Through the above steps, the power measurement sample data can be repaired, while the calculation complexity of the model is reduced, the calculation efficiency is improved, and strong data support is provided for the in-depth application of power load monitoring.

[0090] Exemplarily, the data repair model NTTR of the present application is compared with the existing data repair models CTF, TCA and HDOP: CTF is an advanced data completion model, which uses CP decomposition to construct a basic model and uses Cauchy loss to measure the difference between the known value and the completed value to improve the robustness of the model; TCA: is a multidimensional tensor completion model based on CP decomposition, which uses least squares and gradient descent methods to train the factor matrix; HDOP is a multidimensional data completion method, which models multidimensional data through tensor-based multilinear algebra concepts and completes it through CP decomposition.

[0091] Table 1 Hyperparameter settings

[0092]

[0093] In order to fairly compare the performance of different models, the latent feature dimension of all models is set to 5. In addition, adjusting the hyperparameters of the model for each dataset is also a key step, because different datasets may have different data distributions and characteristics, and the appropriate hyperparameters may also be different. Through grid search parameter adjustment, Table 1 shows the hyperparameter settings of all models on each dataset. These hyperparameters may include learning rate, regularization coefficient, etc.

[0094] Table 2 Comparison results

[0095]

[0096] Table 2 lists in detail the RMSE and MAE of the four models on the two datasets D1 and D2.

[0097] (1) As can be seen from Table 2, NTTR has higher repair accuracy than other models. As shown in Table 2, when the missing rate of power measurement sample data is as high as 95%, the RMSE of NTTR on D1 is 0.1623, while CTF, TCA, and HDOP are 0.1836, 0.2014, and 0.2177, respectively. The RMSE of NTTR is 11.60%, 19.41%, and 25.45% lower than that of the other three models, respectively. The MAE of NTTR on D1 is 0.0773, which is 17.15% lower than CTF's 0.0933, 18.03% lower than TCA's 0.0943, and 24.44% lower than HDOP's 0.1023. Similar results can be obtained on D2. From the above analysis, it can be seen that NTTR has the best ability to repair missing data for power load monitoring. NTTR is a model constructed using tensor ring decomposition. Compared with CTF, TCA, and HDOP constructed by CP decomposition, it has a larger latent feature space and is more capable of capturing complex patterns in the power load monitoring tensor, thus having a higher representation capability for the power load monitoring tensor.

[0098] (2) After training, the number of iterations that NTTR achieved the minimum RMSE on D1 was 35, while the number of iterations that CTF, TCA, and HDOP achieved the minimum RMSE on D1 were 142, 93, and 95, respectively. The number of iterations counted for NTTR was 24.65%, 37.63%, and 36.84% of them. The number of iterations that CTF, TCA, and HDOP achieved the minimum RMSE on D2 was 108, 45, and 86, respectively, while the number of iterations counted for NTTR was 22, which were 20.37%, 48.89%, and 25.58% of them, respectively. Similar conclusions can be drawn on the MAE of D1 and D2.

[0099] Embodiment 2

[0100] Figure 3 1 is a flow chart of a data repair method provided by Embodiment 2 of the present invention. The method can be executed by a data repair device. The data repair device can be implemented in the form of hardware and / or software. The data repair device can be configured in an electronic device. Figure 3 As shown, the method includes:

[0101] S210: Obtaining power measurement data to be repaired.

[0102] In this embodiment, the power measurement data to be repaired can be understood as power measurement information that is missing or abnormal due to sensor failure, data transmission error or other reasons in the power system, and needs to be restored to its integrity and accuracy through specific data repair technology.

[0103] Specifically, the power measurement data to be repaired are collected from sensors and measuring devices deployed in the power system. These data may include parameters such as voltage, current, power, and power factor.

[0104] S220: constructing an original data tensor based on the electric power measurement data to be repaired.

[0105] Specifically, the missing values ​​in the power measurement data to be repaired are identified and marked, and then the original data tensor is constructed based on the marked power measurement data to be repaired. The original data tensor includes the marked data to be repaired.

[0106] S230. Input the original data tensor into a data repair model, use the data repair model to decompose the original data tensor to obtain a preset number of latent feature tensors, and determine a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired.

[0107] The data repair model is trained based on the data repair model training method described in any embodiment of the present invention.

[0108] Specifically, the original data tensor is input into the trained data repair model, and the preset tensor decomposition algorithm in the data repair model is used to decompose and reduce the dimension of the original data tensor to extract a preset number of latent feature tensors; then the preset tensor reconstruction algorithm is used to synthesize the preset number of latent feature tensors to obtain a reconstructed tensor. The reconstructed tensor intelligently predicts and fills in missing values ​​while retaining the original data features.

[0109] The technical solution provided in the second embodiment of the present invention uses a trained data repair model to repair the electric power measurement data to be repaired, thereby effectively improving the repair efficiency and accuracy of the data.

[0110] Embodiment 3

[0111] Figure 4 Schematic diagram of the structure of a data repair model training device provided by Embodiment 3 of the present invention. Figure 4 As shown, the device comprises:

[0112] A tensor construction module 31 is used to construct an original sample tensor based on the power measurement sample data, and determine an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete power measurement sample data, and the initial sample tensor includes missing values;

[0113] A tensor decomposition module 32 is used to decompose the initial sample tensor using a data repair model to obtain a preset number of latent feature sample tensors, and synthesize the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor;

[0114] The model training module 33 is used to train the data repair model based on the original sample tensor and the reconstructed sample tensor using a preset objective function and a preset gradient descent algorithm.

[0115] The technical solution provided in the third embodiment of the present invention effectively improves the data repair capability, greatly reduces the resource consumption of data repair, and improves the data repair efficiency and accuracy.

[0116] Optionally, the preset number of latent feature sample tensors are obtained by decomposing the initial sample tensor using a tensor ring decomposition algorithm in the data repair model.

[0117] Optionally, the preset objective function includes a loss function term, a regularization term and a non-negative constraint, wherein the loss function term is determined based on the Euclidean distance between the original sample tensor and the reconstructed sample tensor, the regularization term is determined based on Tikhonov regularization, and the non-negative constraint is a constraint on the parameters of the latent feature sample tensor.

[0118] Optionally, the preset gradient descent algorithm is a stochastic gradient descent algorithm;

[0119] Optionally, the model training module 33 includes:

[0120] A parameter updating module, used for updating the parameter values ​​of the data repair model using a stochastic gradient descent algorithm;

[0121] The parameter value truncation module is used to perform a truncation operation on the parameter value so that the parameter value is a non-negative number.

[0122] The data repair model training device provided in the embodiment of the present invention can execute the data repair model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0123] Embodiment 4

[0124] Figure 5 FIG. 4 is a schematic diagram of the structure of a data repair device provided by Embodiment 4 of the present invention. Figure 5 As shown, the device comprises:

[0125] The data acquisition module 41 is used to acquire the power measurement data to be repaired;

[0126] A data tensor construction module 42, configured to construct an original data tensor based on the electric power measurement data to be repaired;

[0127] A data repair module 43 is used to input the original data tensor into a data repair model, decompose the original data tensor using the data repair model to obtain a preset number of latent feature tensors, and determine a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired;

[0128] The data repair model is trained based on the data repair model training method described in any embodiment of the present invention.

[0129] The data repair device provided in the embodiment of the present invention can execute the data repair model training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0130] Embodiment 5

[0131] Figure 6 It is a structural schematic diagram of an electronic device provided in Embodiment 5 of the present invention. The electronic device may be an electronic device intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0132] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0133] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0134] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, such as a data repair model training method or a data repair method.

[0135] In some embodiments, the data repair model training method or the data repair method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data repair model training method or the data repair method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the data repair model training method or the data repair method in any other appropriate manner (e.g., by means of firmware).

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

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

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

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

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

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

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

[0143] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A data repair model training method, characterized in that: include: Constructing an original sample tensor based on the electric power measurement sample data, and determining an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values; Decomposing the initial sample tensor by using a data repair model to obtain a preset number of latent feature sample tensors, synthesizing the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor; Based on the original sample tensor and the reconstructed sample tensor, the data repair model is trained using a preset objective function and a preset gradient descent algorithm.

2. The method according to claim 1, characterized in that The preset number of latent feature sample tensors is obtained by decomposing the initial sample tensor using a tensor ring decomposition algorithm in the data repair model.

3. The method according to claim 1, characterized in that The preset objective function includes a loss function term, a regularization term and a non-negative constraint, wherein the loss function term is determined based on the Euclidean distance between the original sample tensor and the reconstructed sample tensor, the regularization term is determined based on Tikhonov regularization, and the non-negative constraint is a constraint on the parameters of the latent feature sample tensor.

4. The method according to claim 3, characterized in that: The preset gradient descent algorithm is a stochastic gradient descent algorithm; The data repair model is trained using a preset gradient descent algorithm, including: Updating the parameter values ​​of the data repair model using a stochastic gradient descent algorithm; The parameter value is truncated to make it a non-negative number.

5. A data repair method, characterized in that: include: Obtaining the power measurement data to be repaired; Based on the electric power measurement data to be repaired, construct an original data tensor; Inputting the original data tensor into a data repair model, decomposing the original data tensor using the data repair model to obtain a preset number of latent feature tensors, and determining a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired; The data repair model is trained based on the data repair model training method according to any one of claims 1 to 4.

6. A data repair model training device, characterized in that: include: A tensor construction module, used to construct an original sample tensor based on the electric power measurement sample data, and determine an initial sample tensor based on the original sample tensor, wherein the original sample tensor includes complete electric power measurement sample data, and the initial sample tensor includes missing values; A tensor decomposition module is used to decompose the initial sample tensor using a data repair model to obtain a preset number of latent feature sample tensors, and synthesize the preset number of latent feature sample tensors to obtain a reconstructed sample tensor, wherein the reconstructed sample tensor includes repair values ​​of missing values ​​in the initial sample tensor; A model training module is used to train the data repair model based on the original sample tensor and the reconstructed sample tensor using a preset objective function and a preset gradient descent algorithm.

7. A data repair device, characterized in that: include: A data acquisition module, used to acquire the power measurement data to be repaired; A data tensor construction module, used to construct an original data tensor based on the electric power measurement data to be repaired; A data repair module, used to input the original data tensor into a data repair model, decompose the original data tensor using the data repair model to obtain a preset number of latent feature tensors, and determine a reconstructed tensor based on the product of the preset number of latent feature tensors, wherein the reconstructed tensor includes a repair value of the data to be repaired in the electric power measurement data to be repaired; The data repair model is trained based on the data repair model training method according to any one of claims 1 to 4.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data repair model training method as described in any one of claims 1 to 4 or execute the data repair method as described in claim 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the data repair model training method as described in any one of claims 1 to 4 or the data repair method as described in claim 5.

10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the data repair model training method according to any one of claims 1 to 4 or performs the data repair method according to claim 5.

Citation Information

Patent Citations

  • Network traffic missing data completion method and device, electronic equipment and storage medium

    CN117938762A