Knowledge enhancement-based power dispatching operation small sample generation method and system
By constructing a corpus knowledge base and noise generator in the power field, and combining iterative adversarial training of semantic association and physical mechanism discriminators, the data scarcity problem of small sample scenarios in power dispatching operations is solved, the accuracy and credibility of model generation are improved, and various applications of power systems are supported.
Patent Information
- Application Number
- CN202510860785.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-10-10
AI Technical Summary
In small sample scenarios in power dispatching operations, data scarcity and complexity make it difficult for artificial intelligence models to learn sufficient feature information. Traditional methods find it difficult to build highly accurate models, and there is a lack of effective sample generation and evaluation systems, which affects model optimization and iteration.
By constructing a corpus knowledge base in the power field, applying noise to generate a power sample generator, and combining semantic associations and physical mechanisms to construct a sample discriminator, adversarial iterative training is performed to optimize the generator and discriminator until they meet the preset standards.
It significantly improves the generation accuracy of large models in small sample scenarios of power dispatching operations, provides high-quality and highly reliable data support, ensures the rationality and uniformity of generated samples, and supports the stable operation and planning decisions of the power system.
Smart Images

Figure CN120764918A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power system knowledge enhancement, and in particular relates to a method and system for generating small samples of power dispatching operations based on knowledge enhancement. Background Art
[0002] With the construction of new power systems, the data involved in the power sector is becoming increasingly large, complex, and diverse. On the one hand, the emergence of large-scale power models has brought new opportunities for many power system application scenarios, such as the promise of more efficient and accurate decision support in power system planning, operating status analysis, and fault diagnosis. However, on the other hand, the dispatching and operation samples of power systems in extreme scenarios face severe challenges. Due to the scarcity, difficulty in reproducing, and simulation of data in small-sample power dispatching scenarios, artificial intelligence models struggle to fully learn sufficient feature information, which severely limits the accuracy of the results generated by the artificial intelligence models in these scenarios.
[0003] At the same time, the inherent complexity of the power system complicates sample construction and model training. The power industry involves numerous specialized terminologies, complex semantic associations, and strict physical constraints. For example, power flow calculations and analysis of power equipment operating characteristics require adherence to specific physical laws. Traditional sample generation and model training methods struggle to account for these complex factors and are unable to effectively construct highly accurate models using limited, small sample data. Furthermore, the lack of a comprehensive system and methodology for evaluating generated samples makes it difficult to accurately determine their quality and credibility, which in turn impacts model optimization and iteration. These issues urgently need to be addressed as the power system evolves towards greater intelligence and efficiency. Summary of the Invention
[0004] The purpose of the present invention is to provide a knowledge-enhanced method and system for generating small samples of power dispatching operations, so as to solve the problem that traditional technologies cannot effectively utilize limited small sample data to build a high-accuracy model, and it is difficult to accurately judge the quality and credibility of the generated samples, which in turn affects the optimization and iteration of the model.
[0005] To achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for generating a small sample of power dispatching operations based on knowledge enhancement, comprising: Collect batch samples from the power dispatching and operation field, build a power field corpus knowledge base, add noise to the power field corpus knowledge base, and obtain a power sample generator; Based on semantic association, a sample discriminator is constructed, which includes power sample similarity scoring indicators and physical mechanism verification, and outputs sample credibility; According to the sample credibility and empirical data output by the discriminator, the generator and discriminator are iteratively optimized, and adversarial iterative training is repeated until the preset generation criteria are met.
[0006] Furthermore, the collecting of batch samples in the field of power dispatching and operation, building a corpus knowledge base in the field of power, and applying noise to the corpus knowledge base in the field of power include: Constructing power based on corpus knowledge base, applying randomly distributed noise vectors through the vector space in the knowledge base ; From the normal distribution Sampling in the middle, where is the mean vector, is the unit covariance matrix; the length of the generated power dispatch operation text sequence is , the vocabulary size is , the noise vector The dimension is set to ; Then pass through a fully connected layer and bias , the noise vector Mapping to latent space representation , the formula is:
[0007] Where: , represents the latent space dimension, , .
[0008] Furthermore, obtaining the power sample generator includes: Get the prompt word set of the power industry based on the knowledge, task requirements and common expressions in the power field ; The fused noise information obtained previously Associate and combine with prompt words to form the format of large model input; The samples without noise are input into the large model in the format to form the fine-tuning training set of the large model of the power industry. , the loss function during fine-tuning is defined as:
[0009] Where: Represents the loss calculation function; by adjusting the large model parameters , so that the loss function Minimize, that is ; After fine-tuning, the combined input with noise and prompt words Feeding into the power industry large model In the formula, the power industry large model generates a virtual sample of the scene according to the input;
[0010] In the formula, the power industry large model generates a virtual sample of the scene according to the input; The generated virtual sample is represented, and the dimension of the generated virtual sample is the same as that of the real power text sample.
[0011] Further, the sample discriminator based on semantic association is constructed to contain the power sample similarity score index and the physical mechanism verification, and the sample credibility is output, including: Let the discriminator be The output of the discriminator is The input is represented The probability of the real power text sample is Power sample text similarity discrimination: The ROUGE-N index calculation formula is as follows:
[0012] In the formula, the power industry large model generates a virtual sample of the scene according to the input; The reference text is represented The word sequence with a length of extracted from the reference text is represented, that is The ROUGE-N index is used to compare the matching conditions of in the generated text and the reference text to evaluate the quality of the generated text; The length of the word sequence is represented The number of in the generated text and the reference text that match is represented The number of in the reference text is represented The key parameters of the generated sample are extracted by the large model, and a physical simulation model is constructed. For the associated sample that satisfies the physical simulation model calculation, it is determined as a positive sample, and for the calculation result that does not conform to the physical mechanism of the power system, it is determined as a negative sample. The discriminator output should be a numerical value or a vector, which is used to represent the possibility that the input sample is a real sample or a generated sample. The construction formula of the credibility is as follows:
[0013] In the formula, the probability that the sample is a real sample is represented The probability that the sample is a generated sample is represented
[0014] Further, the accuracy, recall rate and F1-Score index are calculated to evaluate the performance of the discriminator. The accuracy formula is as follows:
[0015] Where: TP represents the number of true positive examples, which are correctly identified as real samples; TN represents the number of true negative examples, which are correctly identified as generated samples; FP represents the number of false positive examples, which are incorrectly identified as real samples; FN represents the number of false negative examples, which are incorrectly identified as generated samples. The calculation formulas for the remaining indicators are as follows:
[0016]
[0017]
[0018] Where: F1 represents F1-Score; Precision represents precision; Recall represents recall.
[0019] Furthermore, the generator and the discriminator are iteratively optimized based on the sample credibility and empirical data output by the discriminator, and adversarial iterative training is repeated until the preset generation standard is met, including: The samples generated by the generator are mixed with the test dataset, and the discriminator is used to calculate the ROUGE-N, precision, recall, and F1-Score indicators to analyze the discriminator's credibility in distinguishing between real samples and generated samples; Evaluate the two types of samples that have been screened out, judge the rationality and uniformity of the samples based on empirical data, and supplement and revise the scoring judgement; if the sample screened out by the scoring judgement is considered unreasonable, the sample will be re-evaluated or discarded; Generator training The loss function of the generator is expressed as:
[0020] Where: For the prior distribution The noise vector sampled in , the sample that the generator hopes to generate Can make the discriminator Considered to be a real sample, As large as possible, and the loss function It is minimized The negative number of , the fine-tuning training parameters and noise parameters of the generator are updated through the gradient descent algorithm, so that the power industry text samples generated by the generator are closer and closer to the real samples.
[0021] The real samples and generated samples are mixed in a predetermined ratio to form a training dataset, which is sent to the generator for fine-tuning of the large model of the power industry. The adversarial iterative training process is repeated until the generation criteria are met.
[0022] In a second aspect, the present invention provides a knowledge-enhanced power dispatching operation sample generation system, comprising: The generator construction module is used to collect batch samples in the field of power dispatching and operation, build a corpus knowledge base in the power field, and add noise to the corpus knowledge base in the power field to obtain a power sample generator; The discriminator component module is used to build a sample discriminator based on semantic association, including power sample similarity scoring indicators and physical mechanism verification, and output sample credibility; The iterative output module is used to iteratively optimize the generator and discriminator based on the sample credibility and empirical data output by the discriminator, and repeatedly generate adversarial iterative training until the preset generation criteria are met.
[0023] Furthermore, in the generator construction module, the collecting of batch samples in the field of power dispatching and operation, building a corpus knowledge base in the field of power, and applying noise to the corpus knowledge base in the field of power include: Constructing power based on corpus knowledge base, applying randomly distributed noise vectors through the vector space in the knowledge base ; From the normal distribution Sampling in the middle, where is the mean vector, is the unit covariance matrix; the length of the generated power dispatch operation text sequence is , the vocabulary size is , the noise vector The dimension is set to ; Then pass through a fully connected layer and bias , the noise vector Mapping to latent space representation , the formula is:
[0024] Where: , represents the latent space dimension, , .
[0025] Furthermore, obtaining the power sample generator includes: Get the prompt word set of the power industry based on the knowledge, task requirements and common expressions in the power field ; The fused noise information obtained previously Associate and combine with prompt words to form the format of large model input; The samples without noise are input into the large model in the format to form the fine-tuning training set of the large model of the power industry. , the loss function during fine-tuning is defined as:
[0026] wherein: represents a loss calculation function; by adjusting the large model parameters , the loss function is minimized, that is ; After fine-tuning, the combined input with noise and prompt words is sent into the power industry large model , and the power industry large model generates virtual samples for the scene according to the input;
[0027] wherein: represents the generated virtual sample, and the dimension of the generated virtual sample is the same as that of the real power text sample.
[0028] Further, in the discriminator component module, the sample discriminator based on semantic association is constructed to contain power sample similarity score indicators and physical mechanism verification, and the sample credibility is output, including: Let the discriminator be , the output of the discriminator represents the probability that the input is a real power text sample; Power sample text similarity discrimination: The ROUGE-N index calculation formula is as follows:
[0029] wherein: represents the reference text; represents the word sequence with a length of extracted from the reference text, that is used to compare the matching conditions of in the generated text and the reference text to evaluate the quality of the generated text; represents the length of the word sequence; represents the number of matched in the generated text and the reference text; represents the number of all in the reference text; Through the extraction of the key parameters of the generated sample by the large model, a physical simulation model is constructed, and for the associated samples that satisfy the physical simulation model calculation, they are determined as positive samples, and for the calculation results that do not conform to the physical mechanism of the power system, they are determined as negative samples; The discriminator output should be a numerical value or a vector, which is used to represent the possibility that the input sample is a real sample or a generated sample; the construction formula of the credibility is as follows:
[0030] Where: represents the probability that the sample is a true sample, It represents the probability that the sample is the generated sample.
[0031] Furthermore, the performance of the discriminator is evaluated by calculating the accuracy, recall, and F1-Score indicators; the accuracy formula is as follows:
[0032] Where: TP Indicates the number of true positive samples, which are correctly identified as real samples; TN represents the number of true negative examples, which are correctly judged as generated samples; FP Represents the number of false positives, which are incorrectly identified as true samples; FN represents the number of false negative examples, which are mistakenly judged as generated samples; The calculation formulas for the remaining indicators are as follows:
[0033]
[0034]
[0035] Where: F1 express F1 - Score ; Precision table Shows the accuracy, Recall Represents the recall rate.
[0036] Furthermore, in the iterative output module, the generator and the discriminator are iteratively optimized based on the sample credibility and empirical data output by the discriminator, and adversarial iterative training is repeated until the preset generation standard is met, including: The samples generated by the generator are mixed with the test data set and calculated by the discriminator ROUGE-N , precision, recall, F1-Score Metrics, which analyze the discriminator's credibility in distinguishing between real and generated samples; Evaluate the two types of samples that have been screened out, judge the rationality and uniformity of the samples based on empirical data, and supplement and revise the scoring judgement; if the sample screened out by the scoring judgement is considered unreasonable, the sample will be re-evaluated or discarded; Generator training The loss function of the generator is expressed as:
[0037] Where: For the prior distribution The noise vector sampled in , the sample that the generator hopes to generate Can make the discriminator Considered to be a real sample, As large as possible, and the loss function It is minimized The negative number of the generator is used to update the fine-tuning training parameters and noise parameters of the generator through the gradient descent algorithm, so that the power industry text samples generated by the generator are closer and closer to the real samples; The real samples and generated samples are mixed in a predetermined ratio to form a training dataset, which is sent to the generator for fine-tuning of the large model of the power industry. The adversarial iterative training process is repeated until the generation criteria are met.
[0038] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for generating small samples of power dispatching operations based on knowledge enhancement when executing the computer program.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method for generating a small sample of power dispatching operation based on knowledge enhancement.
[0040] Compared with the prior art, the present invention has the following technical effects: The present invention collects small batch samples in the power field and applies noise to construct a power sample generator, constructs a sample discriminator based on semantic association and physical information, and then iteratively optimizes the generator and discriminator based on the discriminator results and human feedback, making full use of the generation capacity of the large model and the small sample construction method of generative adversarial, effectively solving the problem of insufficient samples of the large model in the small sample scenario of power dispatch operation, thereby significantly improving the accuracy of the generation of large models in the small sample scenario of power dispatch, and providing solid and reliable data and technical support for various applications of the power system. By constructing a power sample generator and discriminator, and with the help of a generative adversarial iterative training mechanism, the problem of insufficient samples of the large model in the small sample scenario of power dispatch operation is effectively solved. At the same time, with the help of the multi-dimensional evaluation system of the discriminator and the human feedback mechanism, the high quality and high credibility of the generated samples are ensured, and the generator and discriminator are continuously iteratively optimized, ultimately achieving excellent results in improving the accuracy of the generation of large models in the small sample scenario of the power system, providing strong technical support and data guarantee for the stable operation, planning and decision-making of the power system and other aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of the present invention.
[0042] Figure 2 This is a logic block diagram of the present invention. DETAILED DESCRIPTION
[0043] The present invention is further described below with reference to the accompanying drawings: Example 1, please refer to Figure 1 The present invention provides a method for generating small samples of power dispatching operations based on knowledge enhancement, comprising: Collect batch samples from the power dispatching and operation field, build a power field corpus knowledge base, add noise to the power field corpus knowledge base, and obtain a power sample generator; Based on semantic association, a sample discriminator is constructed, which includes power sample similarity scoring indicators and physical mechanism verification, and outputs sample credibility; According to the sample credibility and empirical data output by the discriminator, the generator and discriminator are iteratively optimized, and adversarial iterative training is repeated until the preset generation criteria are met.
[0044] By collecting small batch samples in the power field and adding noise to build a power sample generator, constructing a sample discriminator based on semantic association and physical information, and then iteratively optimizing the generator and discriminator based on the discriminator results and human feedback, we can make full use of the generation ability of the large model and the small sample construction method of generative adversarial, effectively solve the problem of insufficient samples of the large model in the small sample scenario of power dispatching operation, thereby significantly improving the accuracy of large model generation in small sample scenarios in the power dispatching field, and providing solid and reliable data and technical support for various applications of the power system.
[0045] In Example 2, the present invention provides a method for generating a small sample of power dispatching operation based on knowledge enhancement, which specifically includes: By utilizing the generation capability of large models and the small sample construction method of generative adversarial power dispatching, the accuracy of sample generation by large models in small sample scenarios of power dispatching operation can be improved, and the problem of sample scarcity of large models in small sample scenarios of power dispatching operation can be solved.
[0046] The present invention consists of three main parts. The first part collects small batches of samples from the power dispatching operation domain, applies noise, and constructs a power sample generator. The second part constructs a sample discriminator based on semantic associations and physical information. The third part iteratively optimizes the generator and discriminator based on the discriminator results and human feedback.
[0047] Constructing a power sample generator In the training process of the power industry generative adversarial model, the generator and the discriminator are trained in adversarial fashion. , generator Represents input The virtual samples generated later.
[0048] Noise Embedded in Electrical Terminology First, construct the power corpus-based knowledge base, and apply randomly distributed noise vectors through the vector space in the knowledge base. From the normal distribution Sampling in the middle, where is the mean vector, is the unit covariance matrix. The length of the generated power dispatch operation text sequence is (in words), the vocabulary size is , the noise vector The dimension is set to . Then through a fully connected layer (weight matrix) and bias , the noise vector Mapping to latent space representation , the formula is:
[0049] Where: , represents the latent space dimension, , .
[0050] (2) Constructing the generator large model input Design a collection of prompt words for the power industry based on knowledge, task requirements and common expressions in the power field . The fused noise information obtained previously Associate and combine with prompt words to form a format suitable for large model input.
[0051] (3) Fine-tuning and sample generation based on large models The small samples without noise are input in the format (2) to form the fine-tuning training set of the large model of the power industry. , the loss function during fine-tuning can be defined as:
[0052] Where: Represents the loss calculation function. The large model parameters are continuously adjusted through the optimization algorithm , so that the loss function Minimize, that is .
[0053] After fine-tuning, the combined input with noise and prompt words Feeding into the power industry large model In the ,power industry big model, generates virtual samples of the scenario based on the input.
[0054]
[0055] Where: Represents the generated virtual sample. The dimension of the generated virtual sample is the same as that of the real power text sample.
[0056] Constructing a power sample discriminator Text on the power industry GAN During the training process, the generator and the discriminator are trained against each other. Let the discriminator be , the output of the discriminator Represents input The probability that it is a real electricity text sample.
[0057] Similarity determination of small sample texts in the power industry.
[0058] ROUGE-N The indicator calculation formula is as follows:
[0059] Where: Indicates a reference text; Indicates that the length of the text extracted from the reference text is The word sequence of Used to compare generated text with reference text The quality of the generated text is evaluated by the matching situation; Indicates the length of the word sequence; Indicates that the generated text matches the reference text the number of Indicates all references in the text The number of
[0060] Reference indicators ROUGE-N , mainly focusing on the relationship between the generated power text and the reference power text n-gram Overlap (sequence of n consecutive words). Calculate the proportion of n-grams in the generated power text that can be found in the reference power text to measure the coverage of the reference text content.
[0061] By calculating the precision, recall, F1 - Score The performance of the discriminator is evaluated by indicators such as . The accuracy formula is as follows:
[0062] Where: TP (True Positive) represents the true positive sample, that is, the number of samples correctly identified as true samples; TN(True Negative represents true negative examples, that is, the number of samples correctly judged as generated; FP (False Positive) Represents false positives, that is, the number of samples that are mistakenly identified as true; FN (False Negative)Represents false negative examples, that is, the number of samples that are incorrectly judged to be generated. The calculation formulas for the remaining indicators are as follows:
[0063]
[0064]
[0065] Where: F1 express F1 - Score ; Precision represents the accuracy, Recall Represents the recall rate.
[0066] (2) Identification of the physical mechanism of power samples By extracting key parameters of samples from the large model, and constructing physical simulation models such as power flow calculations, the associated samples that meet the physical simulation model calculation requirements are judged as positive samples. Calculation results that do not conform to the physical mechanisms of the power system are judged as negative samples.
[0067] (3) Discriminator output sample credibility The discriminator output should be a numerical value or vector that represents the probability that the input sample is a real sample or a generated sample. The construction formula of the credibility is as follows:
[0068] Where: represents the probability that the sample is a true sample, It represents the probability that the sample is the generated sample. Generative Adversarial Training (1) Discriminator evaluation indicators The samples generated by the generator are mixed with the test data set and calculated by the discriminator ROUGE-N , precision, recall, F1 - Score Indicators such as , analyze the credibility of the discriminator in distinguishing real samples from generated samples.
[0069] Human feedback evaluation Professionals evaluate the two types of samples selected, judging their rationality and consistency based on practical experience and professional perspectives. They supplement and revise the scoring system to improve its accuracy. If a sample selected by the scoring system is deemed unreasonable by the dispatcher, it will be re-evaluated or discarded.
[0070] Generator training The loss function of the generator can be expressed as:
[0071] Where: For the prior distribution The noise vector sampled in , the sample that the generator hopes to generate Can make the discriminator It is considered to be a real sample, that is, As large as possible, and the loss function It is minimized The negative number of , the fine-tuning training parameters and noise parameters of the generator are updated through optimization algorithms such as gradient descent, so that the power industry text samples generated by the generator are closer and closer to the real samples.
[0072] (4) Update and iteration The training dataset is composed of real samples and generated samples mixed in a certain ratio. This is then fed into the generator to fine-tune the large-scale model for the power industry. The generative adversarial training process is repeated until the generation criteria are met.
[0073] In one embodiment of the present invention, a system for generating power dispatching operation samples based on knowledge enhancement is provided, which can be used to implement the above-mentioned method for generating power dispatching operation samples based on knowledge enhancement. Specifically, the system includes: The generator construction module is used to collect batch samples in the field of power dispatching and operation, build a corpus knowledge base in the power field, and add noise to the corpus knowledge base in the power field to obtain a power sample generator; The discriminator component module is used to build a sample discriminator based on semantic association, including power sample similarity scoring indicators and physical mechanism verification, and output sample credibility; The iterative output module is used to iteratively optimize the generator and discriminator based on the sample credibility and empirical data output by the discriminator, and repeatedly generate adversarial iterative training until the preset generation criteria are met.
[0074] The module division in the embodiments of the present invention is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in various embodiments of the present invention may be integrated into a single processor, exist physically as separate modules, or two or more modules may be integrated into a single module. The integrated modules may be implemented in either hardware or software functional modules.
[0075] In one embodiment of the present invention, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program including program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the knowledge-enhanced power dispatch operation sample generation method.
[0076] In another embodiment of the present invention, a storage medium is provided, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device, used to store programs and data. It is understood that the computer-readable storage medium herein may include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides storage space that stores the terminal's operating system. Furthermore, the storage space also stores one or more instructions suitable for being loaded and executed by a processor. These instructions may be one or more computer programs (including program code). It should be noted that the computer-readable storage medium herein may be high-speed RAM memory or non-volatile memory, such as at least one disk storage device. The processor may load and execute the one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the knowledge-enhanced power dispatch operation sample generation method described in the above-mentioned embodiment.
[0077] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0079] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered by the scope of protection of the claims of the present invention.
Claims
1. A method for generating small samples of power dispatching operations based on knowledge enhancement, characterized in that: include: Collect batch samples from the power dispatching and operation field, build a power field corpus knowledge base, add noise to the power field corpus knowledge base, and obtain a power sample generator; Based on semantic association, a sample discriminator is constructed, which includes power sample similarity scoring indicators and physical mechanism verification, and outputs sample credibility; According to the sample credibility and empirical data output by the discriminator, the generator and discriminator are iteratively optimized, and adversarial iterative training is repeated until the preset generation criteria are met.
2. The method for generating small samples of power dispatching operation based on knowledge enhancement according to claim 1 is characterized in that: The collecting of batch samples in the field of power dispatching and operation, building a corpus knowledge base in the field of power, and applying noise to the corpus knowledge base in the field of power include: Constructing power based on corpus knowledge base, applying randomly distributed noise vectors through the vector space in the knowledge base ; From the normal distribution Sampling in the middle, where is the mean vector, is the unit covariance matrix; the length of the generated power dispatch operation text sequence is , the vocabulary size is , the noise vector The dimension is set to ; Then pass through a fully connected layer and bias , the noise vector Mapping to latent space representation , the formula is: Where: , represents the latent space dimension, , .
3. The method for generating small samples of power dispatching operation based on knowledge enhancement according to claim 2 is characterized in that: The power sample generator is obtained, comprising: Get the prompt word set of the power industry based on the knowledge, task requirements and common expressions in the power field ; The fused noise information obtained previously Associate and combine with prompt words to form the format of large model input; The samples without noise are input into the large model in the format to form the fine-tuning training set of the large model of the power industry. , the loss function during fine-tuning is defined as: Where: Represents the loss calculation function; by adjusting the large model parameters , so that the loss function Minimize, that is ; After fine-tuning, the combined input with noise and prompt words Feeding into the power industry large model In the ,power industry big model, ,generates a virtual sample of the scenario based on the input; Where: Represents the generated virtual sample, and the dimension of the generated virtual sample is the same as that of the real power text sample.
4. The method for generating small samples of power dispatching operation based on knowledge enhancement according to claim 1 is characterized in that: The sample discriminator based on semantic association, which includes a power sample similarity scoring index and physical mechanism verification, outputs sample credibility, including: Let the discriminator be , the output of the discriminator Represents input The probability of being a real electricity text sample; Similarity determination of power sample text: The calculation formula of ROUGE-N indicator is as follows: Where: Indicates a reference text; Indicates that the length of the text extracted from the reference text is The word sequence of Used to compare generated text with reference text The quality of the generated text is evaluated by the matching situation; Indicates the length of the word sequence; Indicates that the generated text matches the reference text the number of Indicates all references in the text the number of By extracting key parameters of samples from a large model, a physical simulation model is constructed. Associated samples that meet the requirements of the physical simulation model are considered positive samples, while calculation results that do not conform to the physical mechanism of the power system are considered negative samples. The discriminator output should be a numerical value or vector that represents the probability that the input sample is a real sample or a generated sample; the construction formula of the credibility is as follows: Where: represents the probability that the sample is a true sample, It represents the probability that the sample is the generated sample.
5. The method for generating small samples of power dispatching operation based on knowledge enhancement according to claim 4 is characterized in that: The performance of the discriminator is evaluated by calculating the accuracy, recall, and F1-Score indicators; the accuracy formula is as follows: Where: TP represents the number of true positive examples, which are correctly identified as real samples; TN represents the number of true negative examples, which are correctly identified as generated samples; FP represents the number of false positive examples, which are incorrectly identified as real samples; FN represents the number of false negative examples, which are incorrectly identified as generated samples. The calculation formulas for the remaining indicators are as follows: Where: F1 represents F1 - Score; Precision means precision, and Recall means recall.
6. The method for generating small samples of power dispatching operation based on knowledge enhancement according to claim 1 is characterized in that: The generator and discriminator are iteratively optimized based on the sample credibility and empirical data output by the discriminator, and adversarial iterative training is repeated until the preset generation standard is met, including: The samples generated by the generator are mixed with the test dataset, and the discriminator is used to calculate the ROUGE-N, precision, recall, and F1-Score indicators to analyze the discriminator's credibility in distinguishing between real samples and generated samples; Evaluate the two types of samples that have been screened out, judge the rationality and uniformity of the samples based on empirical data, and supplement and revise the scoring judgement; if the sample screened out by the scoring judgement is considered unreasonable, the sample will be re-evaluated or discarded; Generator training The loss function of the generator is expressed as: Where: For the prior distribution The noise vector sampled in , the sample that the generator hopes to generate Can make the discriminator Considered to be a real sample, As large as possible, and the loss function It is minimized The negative number of the generator is used to update the fine-tuning training parameters and noise parameters of the generator through the gradient descent algorithm, so that the power industry text samples generated by the generator are closer and closer to the real samples; The real samples and generated samples are mixed in a predetermined ratio to form a training dataset, which is sent to the generator for fine-tuning of the large model of the power industry. The adversarial iterative training process is repeated until the generation criteria are met.
7. The power dispatching operation sample generation system based on knowledge enhancement is characterized by: include: The generator construction module is used to collect batch samples in the field of power dispatching and operation, build a corpus knowledge base in the power field, and add noise to the corpus knowledge base in the power field to obtain a power sample generator; The discriminator component module is used to build a sample discriminator based on semantic association, including power sample similarity scoring indicators and physical mechanism verification, and output sample credibility; The iterative output module is used to iteratively optimize the generator and discriminator based on the sample credibility and empirical data output by the discriminator, and repeatedly generate adversarial iterative training until the preset generation criteria are met.
8. The power dispatching operation sample generation system based on knowledge enhancement according to claim 7 is characterized in that: In the generator construction module, the process of collecting batch samples in the power dispatching operation field, building a power field corpus knowledge base, and applying noise to the power field corpus knowledge base includes: Constructing power based on corpus knowledge base, applying randomly distributed noise vectors through the vector space in the knowledge base ; From the normal distribution Sampling in the middle, where is the mean vector, is the unit covariance matrix; the length of the generated power dispatch operation text sequence is , the vocabulary size is , the noise vector The dimension is set to ; Then pass through a fully connected layer and bias , the noise vector Mapping to latent space representation , the formula is: Where: , represents the latent space dimension, , .
9. The power dispatching operation sample generation system based on knowledge enhancement according to claim 8 is characterized in that: The power sample generator is obtained, comprising: Get the prompt word set of the power industry based on the knowledge, task requirements and common expressions in the power field ; The fused noise information obtained previously Associate and combine with prompt words to form the format of large model input; The samples without noise are input into the large model in the format to form the fine-tuning training set of the large model of the power industry. , the loss function during fine-tuning is defined as: Where: Represents the loss calculation function; by adjusting the large model parameters , so that the loss function Minimize, that is ; After fine-tuning, the combined input with noise and prompt words Feeding into the power industry large model In the ,power industry big model, ,generates a virtual sample of the scenario based on the input; Where: Represents the generated virtual sample, and the dimension of the generated virtual sample is the same as that of the real power text sample.
10. The power dispatching operation sample generation system based on knowledge enhancement according to claim 7, characterized in that: In the discriminator component module, the sample discriminator including the power sample similarity scoring index and physical mechanism verification based on semantic association is constructed to output the sample credibility, including: Let the discriminator be , the output of the discriminator Represents input The probability of being a real electricity text sample; Similarity determination of power sample text: The calculation formula of ROUGE-N indicator is as follows: Where: Indicates a reference text; Indicates that the length of the text extracted from the reference text is The word sequence of Used to compare generated text with reference text The quality of the generated text is evaluated by the matching situation; Indicates the length of the word sequence; Indicates that the generated text matches the reference text the number of Indicates all references in the text the number of By extracting key parameters of samples from a large model, a physical simulation model is constructed. Associated samples that meet the requirements of the physical simulation model are considered positive samples, while calculation results that do not conform to the physical mechanism of the power system are considered negative samples. The discriminator output should be a numerical value or vector that represents the probability that the input sample is a real sample or a generated sample; the construction formula of the credibility is as follows: Where: represents the probability that the sample is a true sample, It represents the probability that the sample is the generated sample.
11. The power dispatching operation sample generation system based on knowledge enhancement according to claim 10, characterized in that: The performance of the discriminator is evaluated by calculating the accuracy, recall, and F1-Score indicators; the accuracy formula is as follows: Where: TP Indicates the number of true positive samples, which are correctly identified as real samples; TN represents the number of true negative examples, which are correctly judged as generated samples; FP Represents the number of false positives, which are incorrectly identified as true samples; FN represents the number of false negative examples, which are mistakenly judged as generated samples; The calculation formulas for the remaining indicators are as follows: Where: F1 express F1 - Score ; Precision table Shows the accuracy, Recall Represents the recall rate.
12. The power dispatching operation sample generation system based on knowledge enhancement according to claim 7, characterized in that: In the iterative output module, the generator and discriminator are iteratively optimized based on the sample credibility and empirical data output by the discriminator, and adversarial iterative training is repeated until the preset generation criteria are met, including: The samples generated by the generator are mixed with the test data set and calculated by the discriminator ROUGE-N , precision, recall, F1-Score Metrics, which analyze the discriminator's credibility in distinguishing between real and generated samples; Evaluate the two types of samples that have been screened out, judge the rationality and uniformity of the samples based on empirical data, and supplement and revise the scoring judgement; if the sample screened out by the scoring judgement is considered unreasonable, the sample will be re-evaluated or discarded; Generator training The loss function of the generator is expressed as: Where: For the prior distribution The noise vector sampled in , the sample that the generator hopes to generate Can make the discriminator Considered to be a real sample, As large as possible, and the loss function It is minimized The negative number of the generator is used to update the fine-tuning training parameters and noise parameters of the generator through the gradient descent algorithm, so that the power industry text samples generated by the generator are closer and closer to the real samples; The real samples and generated samples are mixed in a predetermined ratio to form a training dataset, which is sent to the generator for fine-tuning of the large model of the power industry. The adversarial iterative training process is repeated until the generation criteria are met.
13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method for generating a small sample of power dispatching operation based on knowledge enhancement as described in any one of claims 1 to 6 are implemented.
14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a small sample of power dispatching operation based on knowledge enhancement as claimed in any one of claims 1 to 6 are implemented.