Data processing method and device for power report
By performing stochastic gradient adversarial training on the power report text data, the digital information extraction model is optimized, and the data extraction error problem caused by poor anti-interference ability in the existing technology is solved, achieving higher extraction accuracy.
Patent Information
- Application Number
- CN202510155163.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-03
AI Technical Summary
The existing power digital information data extraction model has poor anti-interference ability, which leads to errors in the power report and affects the accuracy of information.
By obtaining the text data of the power report and inputting it into the preset digital information extraction model, the neural network model is optimized using stochastic gradient adversarial training technology to improve anti-interference ability, thereby accurately extracting digital power information.
It improves the anti-interference of the neural network model, enhances the accuracy of power digital information data extraction, and solves the problem of extraction errors in the prior art.
Smart Images

Figure CN120087464A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular, to a data processing method and device for power reports. Background Art
[0002] In the power field, digital information is relatively important in power reports, such as "voltage level (KV): 100, rated capacity: 31500, rated frequency (Hz): 60". However, the existing digital information extraction models only consider the perturbation problem of the input layer. When identifying the digital information in power reports, the anti-interference ability is poor, and extraction errors often occur, that is, extracting "rated capacity: 31500" becomes "rated capacity: 315" or "rated capacity: 3150", resulting in information extraction errors, which will cause serious consequences in the power system. Therefore, the existing data extraction of power digital information has the problem of inaccuracy.
[0003] Therefore, there is an urgent need for a data processing strategy for power reports to solve the problem of inaccurate data extraction of power digital information. Summary of the Invention
[0004] Embodiments of the present invention provide a data processing method and device for power reports to solve the problem of inaccurate data extraction of power digital information.
[0005] To solve the above problems, an embodiment of the present invention provides a data processing method for power reports, including:
[0006] Obtain the text data of the power report;
[0007] Input the text data into a preset digital information extraction model to obtain the digital data corresponding to the text data; wherein, based on power report digital samples, obtain power report digital samples with digital information labels, perform stochastic gradient adversarial training on the neural network model with the power report digital samples with digital information labels, and after outputting the optimal parameters of the neural network model, obtain the digital information extraction model based on the optimal parameters.
[0008] As an improvement of the above solution, the step of obtaining power report digital samples with digital information labels based on power report digital samples, performing stochastic gradient adversarial training on the neural network model with the power report digital samples with digital information labels, and after outputting the optimal parameters of the neural network model, obtaining the digital information extraction model based on the optimal parameters includes:
[0009] Obtain a number of historical power report data;
[0010] Mark digital information for each piece of historical power report data to obtain a digital sample of the power report with digital book information markings;
[0011] Generate a random result for each of the digital samples of the power report to perform stochastic gradient adversarial training according to a preset Bernoulli distribution probability; wherein, the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training;
[0012] According to the random result, perform stochastic gradient adversarial training based on each digital sample of the power report to obtain the optimal parameters of the neural network model, and use the neural network model with the optimal parameters set as the digital information extraction model; wherein, when the loss value during training reaches the loss threshold or the number of training times reaches the set number of times, select the parameters during the current model training as the optimal parameters; when the random result is 1, perform gradient adversarial training on the neural network model based on the current digital sample of the power report; when the random result is 0, perform non-gradient adversarial training on the neural network model based on the current digital sample of the power report.
[0013] As an improvement to the above solution, the gradient adversarial training includes:
[0014] Train the neural network model according to a preset gradient adversarial training algorithm, so that the input layer, output layer and several network layers of the neural network model are respectively randomly gradient attacked based on a preset probability; the gradient adversarial training algorithm satisfies the following conditions:
[0015]
[0016] In the formula, L 1 is the mathematical expectation of the gradient adversarial training, calculating the average worst loss of all samples in the data distribution under adversarial perturbations, Δ x is the perturbation to the digital sample x of the power report, Δ l is the perturbation to the l-th hidden variable layer h l of, θ is the optimal parameter of the model, x is the digital sample of the power report, y is the label of the digital sample of the power report, L() is the loss function, f() is the neural network, p l is the probability of a gradient attack occurring in the l-th layer, N is the number of layers of the neural network model, E (x,y)~D is the mathematical expectation of the sample x and the label y in the data distribution D.
[0017] As an improvement to the above solution, the non-gradient adversarial training satisfies the following conditions:
[0018] L 2 =E (x,y)~D [L(f(x;θ),y)]
[0019] Where L 2 is the mathematical expectation of non-gradient adversarial training, which calculates the average worst-case loss of all samples in the data distribution under normal conditions.
[0020] As an improvement of the above solution, the stochastic gradient adversarial training satisfies the following conditions:
[0021]
[0022] Where L 3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of Bernoulli distribution.
[0023] Correspondingly, an embodiment of the present invention further provides a data processing device for power reports, including: a data acquisition module and a result generation module;
[0024] The data acquisition module is used to acquire the text data of the power report;
[0025] The result generation module is used to input the text data into a preset digital information extraction model to obtain the digital data corresponding to the text data; wherein, based on the power report digital samples, power report digital samples with digital book information tags are obtained, and the power report digital samples with digital book information tags are used for stochastic gradient adversarial training of the neural network model. After the optimal parameters of the neural network model are output, the digital information extraction model is obtained based on the optimal parameters.
[0026] As an improvement of the above solution, the method of obtaining power report digital samples with digital book information tags based on the power report digital samples, performing stochastic gradient adversarial training on the neural network model with the power report digital samples with digital book information tags, and obtaining the digital information extraction model based on the optimal parameters after outputting the optimal parameters of the neural network model includes:
[0027] Obtain a number of historical power report data;
[0028] Perform digital information tagging on each historical power report data to obtain power report digital samples with digital book information tags;
[0029] Generate random results for performing stochastic gradient adversarial training on each of the power report digital samples according to a preset Bernoulli distribution probability; wherein, the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training;
[0030] Based on the random results, perform random gradient adversarial training on each of the power report digital samples to obtain the optimal parameters of the neural network model, and use the neural network model with the optimal parameters as the digital information extraction model; wherein, when the loss value of the training reaches the loss threshold or the number of training times reaches the set number of times, select the parameters during the current model training as the optimal parameters; when the random result is 1, perform gradient adversarial training on the neural network model based on the current power report digital sample; when the random result is 0, perform non-gradient adversarial training on the neural network model based on the current power report digital sample.
[0031] As an improvement to the above solution, the gradient adversarial training includes:
[0032] Train the neural network model according to a preset gradient adversarial training algorithm, so that the input layer, output layer, and several network layers of the neural network model are respectively randomly gradient attacked based on a preset probability; the gradient adversarial training algorithm satisfies the following conditions:
[0033]
[0034] where L 1 is the mathematical expectation of gradient adversarial training, calculating the average worst loss of all samples in the data distribution under adversarial perturbations, Δ x is the perturbation to the power report digital sample x, Δ l is the perturbation to the l-th hidden variable layer h l , θ is the optimal parameter of the model, x is the power report digital sample, y is the power report digital sample label, L() is the loss function, f() is the neural network, p l is the probability of gradient attack occurring in the l-th layer, N is the number of layers of the neural network model, E (x,y)~D is the mathematical expectation of the sample x and the label y in the data distribution D.
[0035] As an improvement to the above solution, the non-gradient adversarial training satisfies the following conditions:
[0036] L 2 = E (x,y)~D [L(f(x; θ), y)]
[0037] where L 2 is the mathematical expectation of non-gradient adversarial training, calculating the average worst loss of all samples in the data distribution under normal conditions.
[0038] As an improvement to the above solution, the random gradient adversarial training satisfies the following conditions:
[0039]
[0040] In the formula, L 3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of Bernoulli distribution.
[0041] As can be seen from the above, the present invention has the following beneficial effects:
[0042] The present invention provides a data processing method for power reports, which obtains the text data of the power reports; inputs the text data into a preset digital information extraction model to obtain digital data corresponding to the text data; wherein, based on power report digital samples, a neural network model is subjected to stochastic gradient adversarial training to obtain the digital information extraction model. By performing stochastic gradient adversarial training on the neural network model, the present invention can further extract digital information from power reports through the obtained digital information extraction model. Based on stochastic gradient adversarial training, the anti-interference ability of the neural network model can be improved, thereby improving the accuracy of data extraction of power digital information. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 is a schematic flowchart of a data processing method for power reports provided by an embodiment of the present invention;
[0044] Figure 2 is a schematic structural diagram of a data processing device for power reports provided by an embodiment of the present invention;
[0045] Figure 3 is a schematic structural diagram of a terminal device provided by an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of a gradient adversarial training model provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0047] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0048] Embodiment 1
[0049] Refer to Figure 1 , Figure 1 which is a schematic flowchart of a data processing method for power reports provided by an embodiment of the present invention. As Figure 1 shown, this embodiment includes steps 101 to 102, and the specific steps are as follows:
[0050] Step 101: Obtain the text data of the power report.
[0051] Step 102: Input the text data into a preset digital information extraction model to obtain the digital data corresponding to the text data; wherein, based on the power report digital samples, power report digital samples with digital book information tags are obtained, and the power report digital samples with digital book information tags are used to perform stochastic gradient adversarial training on the neural network model. After the optimal parameters of the neural network model are output, the digital information extraction model is obtained based on the optimal parameters.
[0052] As an improvement to the above solution, the process of obtaining power report digital samples with digital book information tags based on the power report digital samples, performing stochastic gradient adversarial training on the neural network model with the power report digital samples with digital book information tags, and obtaining the digital information extraction model based on the optimal parameters after outputting the optimal parameters of the neural network model includes:
[0053] Obtain a number of historical power report data;
[0054] Perform digital information tagging on each piece of historical power report data to obtain power report digital samples with digital book information tags;
[0055] Generate random results for performing stochastic gradient adversarial training on each of the power report digital samples according to a preset Bernoulli distribution probability; wherein, the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training;
[0056] According to the random results, perform stochastic gradient adversarial training based on each of the power report digital samples to obtain the optimal parameters of the neural network model, and use the neural network model with the optimal parameters set as the digital information extraction model; wherein, when the loss value of the training reaches the loss threshold or the number of training times reaches the set number of times, select the parameters during the current model training as the optimal parameters; when the random result is 1, perform gradient adversarial training on the neural network model based on the current power report digital sample; when the random result is 0, perform non-gradient adversarial training on the neural network model based on the current power report digital sample.
[0057] It should be noted that the data information tagging includes but is not limited to: transformer voltage level, manufacturer, model, factory date, serial number, insulation resistance value, nameplate capacitance.
[0058] It can be understood that the existing adversarial training gradient attack occurs throughout the entire process of neural network training, that is, the gradient attack is applied to each batch of data in each round of training. This approach increases the computational burden of training and is not necessary because when specifically using the neural network for inference, the perturbation caused by the gradient attack does not occur every time. Therefore, we propose a solution that introduces randomness into the gradient training as a whole. Specifically, we let the model trigger adversarial training with a certain probability during the training process.
[0059] It should be noted that through the probability control mechanism, the gradient attack does not occur every time during the training process but occurs according to a certain probability. This method can alleviate the problem of time-consuming adversarial training to a certain extent.
[0060] As an improvement to the above solution, the gradient adversarial training includes:
[0061] Training the neural network model according to a preset gradient adversarial training algorithm so that the input layer, output layer, and several network layers of the neural network model are respectively subjected to random gradient attacks based on a preset probability; the gradient adversarial training algorithm satisfies the following conditions:
[0062]
[0063] where L 1 is the mathematical expectation of gradient adversarial training, calculating the average worst-case loss of all samples in the data distribution under adversarial perturbations, Δ x is the perturbation to the power report digital sample x, Δ l is the perturbation to the hidden variable layer h l at the l-th layer, θ is the optimal parameter of the model, x is the power report digital sample, y is the power report digital sample label, L() is the loss function, f() is the neural network, p l is the probability of gradient attack occurring at the l-th layer, N is the number of layers of the neural network model, and E (x,y)~D is the mathematical expectation of the sample x and label y in the data distribution D.
[0064] In a specific embodiment, first assume that the gradient attack will occur in the Embedding layer (i.e., the input layer described in the present invention) and any network layer during a single backpropagation of the network. If a neural network has a total of N layers, then the probability of gradient attack occurring at the l-th layer is p l , and whether gradient attack occurs in each layer is independently distributed. Then, the gradient adversarial training model can be obtained:
[0065]
[0066] where Δ x is the perturbation to the data x, Δl is the perturbation of the l-th layer of hidden variable layer h l , where θ is the optimal parameter of the model as described above. Other parameters in the formula are the same as those described above.
[0067] A schematic diagram of the gradient adversarial training model can be seen in Figure 4 , from Figure 4 it can be seen that in addition to definitely occurring in the Embedding layer, the gradient attack can occur randomly in any layer of the network with a certain probability, not limited to the Embedding layer only. In this way, our network can not only defend against perturbations from the lower layers but also defend against perturbations from the internal layers of the network. When we set p l = 0, l = 1, 2, ... , N, we then obtain the original scheme of adversarial training. Therefore, the standard adversarial training method is a special case of ours.
[0068] It should be noted that the gradient adversarial training model enables the gradient attack to occur randomly in any layer of the neural network, which can not only defend against perturbations from the lower layers but also defend against perturbations from the internal layers of the network.
[0069] As an improvement to the above scheme, the non-gradient adversarial training satisfies the following conditions:
[0070] L 2 = E (x,y)~D [L(f(x; θ), y)]
[0071] In the formula, L 2 is the mathematical expectation of non-gradient adversarial training, calculating the average worst-case loss of all samples in the data distribution under normal circumstances.
[0072] In a specific embodiment, adversarial training, in terms of mathematical modeling, is to solve a max-min problem, specifically:
[0073]
[0074] Its meaning is to find an optimal parameter θ on the training dataset D to minimize the empirical risk and at the same time achieve the minimum structural risk for the perturbation Δ. Among them, y is the training set label, L is the loss function, and f is the neural network.
[0075] As can be seen from the above formula, the perturbation is directly added to the input layer or the Embedding layer, without being added to the network layer and without introducing the concept of randomness, and only simply forces the network output loss after adding the perturbation to be minimized.
[0076] As an improvement to the above scheme, the stochastic gradient adversarial training satisfies the following conditions:
[0077]
[0078] In the formula, L 3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of Bernoulli distribution.
[0079] See Figure 2 , Figure 2 Figure 2 is a schematic structural diagram of a data processing device for an electric power report provided by an embodiment of the present invention, including: a data acquisition module 201 and a result generation module 202;
[0080] The data acquisition module is used to acquire the text data of the electric power report;
[0081] The result generation module is used to input the text data into a preset digital information extraction model to obtain digital data corresponding to the text data; wherein, based on the electric power report digital samples, electric power report digital samples with digital book information tags are obtained, and the electric power report digital samples with digital book information tags are used to perform stochastic gradient adversarial training on the neural network model. After the optimal parameters of the neural network model are output, the digital information extraction model is obtained based on the optimal parameters.
[0082] As an improvement of the above solution, the method of obtaining the electric power report digital samples with digital book information tags based on the electric power report digital samples, performing stochastic gradient adversarial training on the neural network model with the electric power report digital samples with digital book information tags, and obtaining the digital information extraction model based on the optimal parameters after outputting the optimal parameters of the neural network model includes:
[0083] Obtain a number of historical electric power report data;
[0084] Perform digital information tagging on each historical electric power report data to obtain electric power report digital samples with digital book information tags;
[0085] Generate random results for performing stochastic gradient adversarial training on each of the electric power report digital samples according to a preset Bernoulli distribution probability; wherein, the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training;
[0086] Based on the random results, perform stochastic gradient adversarial training on each of the power report digital samples to obtain the optimal parameters of the neural network model, and use the neural network model with the optimal parameters as the digital information extraction model; wherein, when the loss value during training reaches the loss threshold or the number of training times reaches the set number of times, select the parameters during the current model training as the optimal parameters; when the random result is 1, perform gradient adversarial training on the neural network model based on the current power report digital sample; when the random result is 0, perform non-gradient adversarial training on the neural network model based on the current power report digital sample.
[0087] As an improvement to the above solution, the gradient adversarial training includes:
[0088] Train the neural network model according to a preset gradient adversarial training algorithm, so that the input layer, output layer, and several network layers of the neural network model are respectively randomly gradient attacked based on a preset probability; the gradient adversarial training algorithm satisfies the following conditions:
[0089]
[0090] In the formula, L 1 is the mathematical expectation of gradient adversarial training, calculating the average worst loss of all samples in the data distribution under adversarial perturbations, Δ x is the perturbation to the power report digital sample x, Δ l is the perturbation to the l-th hidden variable layer h l , θ is the optimal parameter of the model, x is the power report digital sample, y is the label of the power report digital sample, L() is the loss function, f() is the neural network, p l is the probability of gradient attack occurring in the l-th layer, N is the number of layers of the neural network model, E (x,y)~D is the mathematical expectation of the sample x and the label y in the data distribution D.
[0091] As an improvement to the above solution, the non-gradient adversarial training satisfies the following conditions:
[0092] L 2 = E (x,y)~D [L(f(x; θ), y)]
[0093] In the formula, L 2 is the mathematical expectation of non-gradient adversarial training, calculating the average worst loss of all samples in the data distribution under normal conditions.
[0094] As an improvement to the above solution, the stochastic gradient adversarial training satisfies the following conditions:
[0095]
[0096] In the formula, L 3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of the Bernoulli distribution.
[0097] In this embodiment, the text data of the power report is obtained; the text data is input into a preset digital information extraction model to obtain digital data corresponding to the text data; wherein, based on the digital samples of the power report, the neural network model is subjected to stochastic gradient adversarial training to obtain the digital information extraction model. The present invention can perform digital information extraction of the power report through the digital information extraction model obtained by training by performing stochastic gradient adversarial training on the neural network model. Based on stochastic gradient adversarial training, the anti-interference ability of the neural network model can be improved, thereby improving the accuracy of data extraction of power digital information.
[0098] Embodiment 2
[0099] Refer to Figure 3 , Figure 3 which is a schematic structural diagram of a terminal device provided by an embodiment of the present invention.
[0100] A terminal device in this embodiment includes: a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301. When the processor 301 executes the computer program, the steps in the above-mentioned data processing method of each power report in the embodiment are implemented, for example Figure 1 all the steps of the data processing method of the power report shown. Or, when the processor executes the computer program, the functions of each module in the above-mentioned device embodiments are implemented, for example: Figure 2 all the modules of the data processing device of the power report shown.
[0101] In addition, an embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the data processing method of the power report as described in any one of the above embodiments.
[0102] Those skilled in the art can understand that the schematic diagram is only an example of the terminal device, and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine some components, or different components. For example, the terminal device may further include input / output devices, network access devices, buses, etc.
[0103] The so-called processor 301 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor 301 is the control center of the terminal device, and connects various parts of the entire terminal device through various interfaces and lines.
[0104] The memory 302 can be used to store the computer programs and / or modules. The processor 301 realizes various functions of the terminal device by running or executing the computer programs and / or modules stored in the memory, and by calling the data stored in the memory 302. The memory 302 may mainly include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, at least one magnetic disk storage device, flash device, or other volatile solid-state storage devices.
[0105] Among them, if the modules / units integrated in the terminal device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-described embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above-described various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0106] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the attached drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that they have a communication connection, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative efforts.
[0107] The above is the preferred embodiment of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.
Claims
1. A method for processing power report data, characterized in that: include: Get text data of power report; The text data is input into a preset digital information extraction model to obtain digital data corresponding to the text data; wherein, based on the digital sample of the power report, the digital sample of the power report marked with digital book information is obtained, and the digital sample of the power report marked with digital book information is subjected to random gradient adversarial training on the neural network model, and after outputting the optimal parameters of the neural network model, the digital information extraction model is obtained based on the optimal parameters.
2. The data processing method of power report according to claim 1, characterized in that: The method comprises: obtaining a digital sample of the power report with a digital book information mark based on the digital sample of the power report, performing random gradient adversarial training on the neural network model with the digital sample of the power report with the digital book information mark, and obtaining the digital information extraction model based on the optimal parameters after outputting the optimal parameters of the neural network model, including: Get some historical data of electricity reports; Marking each historical data of the power report with digital information to obtain a digital sample of the power report with digital book information marking; Generate a random result of performing stochastic gradient adversarial training on each digital sample of the power report according to a preset Bernoulli distribution probability; wherein the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training; According to the random result, random gradient adversarial training is performed based on each of the digital samples of the power report to obtain the optimal parameters of the neural network model, and the neural network model set with the optimal parameters is used as the digital information extraction model; wherein, when the loss value of the training reaches the loss threshold, or the number of training times reaches the set number of times, the parameters of the current model training are selected as the optimal parameters; when the random result is 1, gradient adversarial training is performed on the neural network model based on the current digital sample of the power report; when the random result is 0, non-gradient adversarial training is performed on the neural network model based on the current digital sample of the power report.
3. The data processing method of power report according to claim 2, characterized in that: The gradient adversarial training comprises: The neural network model is trained according to a preset gradient adversarial training algorithm, so that the input layer, the output layer and several network layers of the neural network model are respectively subjected to random gradient attacks based on preset probabilities; the gradient adversarial training algorithm satisfies the following conditions: Where L1 is the mathematical expectation of gradient adversarial training, which calculates the average worst loss of all samples in the data distribution under adversarial perturbations, Δ x is the disturbance to the power report digital sample x, Δ l is the lth hidden variable layer h l perturbation, θ is the optimal model parameter, x is the digital sample of the power report, y is the label of the digital sample of the power report, L() is the loss function, f() is the neural network, p l is the probability of gradient attack occurring in the lth layer, N is the number of layers of the neural network model, E (x,y)~D It is the mathematical expectation of sample x and label y in data distribution D.
4. The data processing method of power report according to claim 3, characterized in that: The non-gradient adversarial training satisfies the following conditions: L2=E (x,y)~D [L(f(x;θ),y)] Where L2 is the mathematical expectation of non-gradient adversarial training, which calculates the average worst loss of all samples in the data distribution under normal circumstances.
5. The data processing method of power report according to claim 4, characterized in that: The stochastic gradient adversarial training satisfies the following conditions: Where L3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of Bernoulli distribution.
6. A data processing device for power reports, characterized in that: include: Data acquisition module and result generation module; The data acquisition module is used to acquire text data of the power report; The result generation module is used to input the text data into a preset digital information extraction model to obtain digital data corresponding to the text data; wherein, based on the digital sample of the power report, the digital sample of the power report with the digital book information mark is obtained, and the digital sample of the power report with the digital book information mark is subjected to random gradient adversarial training on the neural network model. After outputting the optimal parameters of the neural network model, the digital information extraction model is obtained based on the optimal parameters.
7. The data processing device for power reports according to claim 6, characterized in that: The method comprises: obtaining a digital sample of the power report with a digital book information mark based on the digital sample of the power report, performing random gradient adversarial training on the neural network model with the digital sample of the power report with the digital book information mark, and obtaining the digital information extraction model based on the optimal parameters after outputting the optimal parameters of the neural network model, including: Get some historical data of electricity reports; Marking each historical data of the power report with digital information to obtain a digital sample of the power report with digital book information marking; Generate a random result of performing stochastic gradient adversarial training on each digital sample of the power report according to a preset Bernoulli distribution probability; wherein the stochastic gradient adversarial training includes: gradient adversarial training and non-gradient adversarial training; According to the random result, random gradient adversarial training is performed based on each of the digital samples of the power report to obtain the optimal parameters of the neural network model, and the neural network model set with the optimal parameters is used as the digital information extraction model; wherein, when the loss value of the training reaches the loss threshold, or the number of training times reaches the set number of times, the parameters of the current model training are selected as the optimal parameters; when the random result is 1, gradient adversarial training is performed on the neural network model based on the current digital sample of the power report; when the random result is 0, non-gradient adversarial training is performed on the neural network model based on the current digital sample of the power report.
8. The data processing device for power reports according to claim 7, characterized in that: The gradient adversarial training comprises: The neural network model is trained according to a preset gradient adversarial training algorithm, so that the input layer, the output layer and several network layers of the neural network model are respectively subjected to random gradient attacks based on preset probabilities; the gradient adversarial training algorithm satisfies the following conditions: Where L1 is the mathematical expectation of gradient adversarial training, which calculates the average worst loss of all samples in the data distribution under adversarial perturbations, Δ x is the disturbance to the power report digital sample x, Δ l is the lth hidden variable layer h l perturbation, θ is the optimal model parameter, x is the digital sample of the power report, y is the label of the digital sample of the power report, L() is the loss function, f() is the neural network, p l is the probability of gradient attack occurring in the lth layer, N is the number of layers of the neural network model, E (x,y)~D It is the mathematical expectation of sample x and label y in data distribution D.
9. The data processing device for power report according to claim 8, characterized in that: The non-gradient adversarial training satisfies the following conditions: L2=E (x,y)~D [L(f(x;θ),y)] Where L2 is the mathematical expectation of non-gradient adversarial training, which calculates the average worst loss of all samples in the data distribution under normal circumstances.
10. The data processing device for power reports according to claim 9, characterized in that: The stochastic gradient adversarial training satisfies the following conditions: Where L3 is the weighted sum of the mathematical expectation of gradient adversarial training and the mathematical expectation of non-gradient adversarial training, and p is the probability of Bernoulli distribution.