Carbon emission reduction method based on large language model driving and electric power operation and maintenance system
By acquiring the carbon emission factors and energy consumption time at the instruction level of the power operation and maintenance system, and optimizing the reasoning process of the large language model, the problem of increasing carbon emissions in the power industry is solved, and intelligentization and carbon emission minimization are achieved.
Patent Information
- Application Number
- CN202411357639.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2025-01-07
AI Technical Summary
In the power industry, the application of large language models has led to an increase in carbon emissions. Existing technologies are unable to effectively optimize carbon emissions and cannot dynamically adapt to changes in energy supply, resulting in poor carbon emission control.
By obtaining the current carbon emission factor of the service area of the power operation and maintenance system, and combining the average energy consumption and processing time at the instruction level, the reasoning process of the large language model is optimized. The trained large language model is used to reason according to the selection probability to output the power operation and maintenance answer, thereby reducing carbon emissions.
It reduces carbon emissions during large language model reasoning, improves the intelligence level of power operation and maintenance systems, dynamically adapts to changes in energy supply, and optimizes carbon emission control.
Smart Images

Figure CN119273518A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a carbon emission reduction method and power operation and maintenance system driven by a large language model. Background Art
[0002] With the increasing prominence of global climate change and the emergence of sustainable development goals, reducing carbon emissions has become the common responsibility of all mankind.
[0003] However, in recent years, with the surge in the use of generative models such as large language models (LLM), the number of visits per month has exceeded hundreds of millions, and the power resources consumed have continued to rise; and when training large language models, a large amount of computing resources are required, which in turn generates a corresponding carbon footprint. And unlike traditional natural language understanding models, generative large language models perform iterative predictions on each request until a predefined tag or iteration limit is reached, which has a higher demand for carbon.
[0004] How to minimize carbon emissions in the application of large language models in the power industry in order to minimize the environmental impact of large language models has become a key issue that needs to be solved urgently. Summary of the invention
[0005] The present application provides a carbon emission reduction method and a power operation and maintenance system driven by a large language model to at least solve one of the technical problems in the related art to a certain extent. The technical solution of the present application is as follows:
[0006] According to one aspect of the present application, a carbon emission reduction method driven by a large language model is provided, and an electric power operation and maintenance system is applied. The method includes:
[0007] In response to the power operation and maintenance problem input by the user, obtaining the current carbon emission factor of the service area corresponding to the power operation and maintenance system;
[0008] Based on the current carbon emission factor, and the average energy consumption and average processing time corresponding to each of the multiple instruction levels, determine the selection probability corresponding to each of the instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model;
[0009] Based on the power operation and maintenance problem, a trained large language model is used to perform reasoning according to the selection probability of each instruction level to obtain a power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates minimal carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
[0010] According to another aspect of the present application, a carbon emission reduction device driven by a large language model is provided, which is applied to an electric power operation and maintenance system, and the device includes:
[0011] An acquisition module, configured to acquire a current carbon emission factor of a service area corresponding to the power operation and maintenance system in response to a power operation and maintenance problem input by a user;
[0012] A determination module, configured to determine the selection probability corresponding to each instruction level based on the current carbon emission factor and the average energy consumption and average processing time corresponding to each instruction level in a plurality of instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model;
[0013] The reasoning module is used to use the trained large language model to perform reasoning according to the selection probability of each instruction level based on the power operation and maintenance problem, and obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the minimum carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
[0014] According to another aspect of the present application, there is provided a power operation and maintenance system, the system comprising:
[0015] A carbon emission reduction device driven by a large language model, used to implement the carbon emission reduction method driven by a large language model proposed in the above aspect of the present application;
[0016] The quality score updating module is used to update the quality score corresponding to each instruction level in the multiple instruction levels.
[0017] According to another aspect of the present application, a non-transitory computer-readable storage medium of computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the carbon emission reduction method based on large language model drive proposed in the above aspect of the present application.
[0018] According to another aspect of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the carbon emission reduction method based on large language model driving proposed in the above aspect of the present application.
[0019] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:
[0020] In response to the power operation and maintenance problem input by the user, the current carbon emission factor of the service area corresponding to the power operation and maintenance system is obtained; based on the current carbon emission factor, and the average energy consumption and average processing time corresponding to each instruction level in multiple instruction levels, the selection probability corresponding to each instruction level is determined; wherein the instruction level is used to control the length of the content generated by the large language model; based on the power operation and maintenance problem, the trained large language model is used to reason according to the selection probability of each instruction level, and the power operation and maintenance answer output by the large language model is obtained, so that the power operation and maintenance system generates the minimum carbon dioxide emissions during the process of reasoning the power operation and maintenance problem by the large language model. Therefore, based on the current carbon emission factor, the selection probability of each instruction level is optimized, and then when the large language model is reasoned according to the selection probability of each instruction level, on the one hand, the power operation and maintenance answer can be obtained to realize the intelligence of the power operation and maintenance system, and on the other hand, the carbon emissions in the reasoning process can be effectively controlled.
[0021] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0023] Figure 1 A flowchart of a carbon emission reduction method driven by a large language model provided in an embodiment of the present application;
[0024] Figure 2 A schematic diagram of a process of a carbon emission reduction method driven by a large language model provided in another embodiment of the present application;
[0025] Figure 3 A schematic structural diagram of a carbon emission reduction device driven by a large language model provided in another embodiment of the present application. DETAILED DESCRIPTION
[0026] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0027] Currently, carbon footprint measurement technology mainly relies on data collection and calculation, including the calculation of operational carbon and embodied carbon. Among them, operational carbon comes from the power grid that powers the data center, and the data center powers the hardware that meets the request; embodied carbon represents the carbon emissions associated with the manufacturing and packaging of computer components, which are effectively reflected in the equipment itself. In related technologies, power operation and maintenance systems mainly use rule-based expert systems and simple machine learning models for carbon emission optimization. However, these methods usually have limited processing capabilities and cannot fully utilize massive real-time data for accurate carbon footprint measurement and optimization. In addition, these systems are difficult to dynamically adapt to changes in energy supply or carbon emissions, and thus cannot achieve optimal carbon emission control.
[0028] In response to the above problems, this application proposes a carbon emission reduction method and power operation and maintenance system driven by a large language model.
[0029] The following describes the carbon emission reduction method and power operation and maintenance system driven by a large language model according to an embodiment of the present application with reference to the accompanying drawings.
[0030] Figure 1 A flowchart of a carbon emission reduction method driven by a large language model provided in an embodiment of the present application.
[0031] The carbon emission reduction method driven by a large language model in the embodiment of the present application is applied to the power operation and maintenance system.
[0032] like Figure 1 As shown, the carbon emission reduction method driven by the large language model may include the following steps:
[0033] Step 101: In response to a power operation and maintenance problem input by a user, a current carbon emission factor of a service area corresponding to a power operation and maintenance system is obtained.
[0034] Among them, power operation and maintenance issues can indicate relevant issues involved in the power operation and maintenance process.
[0035] In an embodiment of the present application, when a user inputs a power operation and maintenance problem in the interactive interface of the power operation and maintenance system, the execution entity of the present application can obtain the current carbon emission factor of the service area corresponding to the power operation and maintenance system in response to the power operation and maintenance problem input by the user.
[0036] It should be noted that the current carbon emission factor is used to indicate the amount of carbon dioxide emitted for each kilowatt-hour (kWh) of electricity currently produced, and its unit is gCO2 / kWh.
[0037] It should also be noted that due to differences in geographical location, meteorological conditions, etc., the carbon emission factors corresponding to different service areas (also known as power service areas, or power grid areas) may be the same or different at different times, and this application does not impose any restrictions on this.
[0038] Step 102 , based on the current carbon emission factor, and the average energy consumption and average processing time corresponding to each instruction level in the multiple instruction levels, determine the selection probability corresponding to each instruction level.
[0039] Among them, the instruction level is used to control the length of the content generated by the large language model.
[0040] As an example, assuming that the instruction levels include L0, L1, and L2, when the instruction level is L0, the content generated by the large language model is "Based on various geological and astronomical evidence, the age of the Earth is approximately 4.5 billion years." At this time, the length of the content generated by the large language model is longer, and the number of generated character units (tokens) is larger; when the instruction level is L1, the content generated by the large language model is "The Earth is about 4.5 billion years." At this time, the length of the content generated by the large language model is moderate, and the number of generated character units is moderate; when the instruction level is L2, the content generated by the large language model is "4.5 billion years." At this time, the length of the content generated by the large language model is the shortest, and the number of generated character units is the least.
[0041] It should be noted that the above-mentioned examples of instruction level and examples of generating content for a large language model are merely exemplary.
[0042] In an embodiment of the present application, in the application of a large language model, when different instruction levels are used to control the large language model to generate content, there may be corresponding average energy consumption and average processing time, that is, each instruction level may have a corresponding average energy consumption and average processing time.
[0043] The average energy consumption corresponding to the instruction level is used to indicate the average amount of electricity consumed by using the corresponding instruction level to control the large language model to generate content once, and the unit of the average energy consumption may be kilowatt-hour (kWh);
[0044] The average processing time corresponding to the instruction level is used to indicate the average time taken to control the large language model to generate content once using the corresponding instruction level. The unit of the average processing time may be seconds (s).
[0045] It is important to understand that the average energy consumption and average processing time corresponding to each instruction level can be determined based on a large number of experiments.
[0046] Step 103, based on the power operation and maintenance problem, use the trained large language model to perform reasoning according to the selection probability of each instruction level to obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the minimum carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
[0047] Among them, the large language model can be, for example, GPT-4 (Generative Pre-trained Transformer 4), and this application does not impose any restrictions on this.
[0048] In an embodiment of the present application, based on the power operation and maintenance problem, a trained large language model can be used to perform reasoning according to the selection probability of each instruction level to obtain the power operation and maintenance answer output by the large language model. At the same time, the carbon dioxide emissions generated by the power operation and maintenance system in the process of the large language model reasoning about the power operation and maintenance problem can be minimized.
[0049] Specifically, the power operation and maintenance problem is input into the trained large language model. At the same time, for any instruction level, the corresponding time proportion is determined based on the selection probability of the instruction level. In the large language model reasoning process of the corresponding time proportion, the power operation and maintenance problem is reasoned according to the corresponding instruction level to obtain the power operation and maintenance answer output by the large language model, and the carbon dioxide emissions generated by the power operation and maintenance system in the process of the large language model reasoning on the power operation and maintenance problem are minimized.
[0050] As an example, assuming that the instruction levels include L0, L1, and L2, and the selection probabilities corresponding to each instruction level are 0.2, 0.3, and 0.5 respectively, then the time proportions corresponding to each instruction level are 20%, 30%, and 50%. In the process of the large language model reasoning about power operation and maintenance issues, 20% of the time uses the L0 level instruction level, 20% of the time uses the L1 level instruction level, and 50% of the time uses the L2 level instruction level. In this way, while reasoning is performed, while obtaining the power operation and maintenance answers output by the large language model, the carbon dioxide emissions generated by the power operation and maintenance system in the process of the large language model reasoning about the power operation and maintenance issues can be minimized.
[0051] In a possible implementation of the embodiment of the present application, the training process of the large language model may include the following steps:
[0052] 1. Obtain sample power data.
[0053] The sample power data may include power knowledge and power operation and maintenance data of a power operation and maintenance system.
[0054] Among them, power operation and maintenance data include equipment operating status, energy consumption, carbon emissions or carbon dioxide emissions, etc.
[0055] It should be noted that the power operation and maintenance data can be real-time operation and maintenance data, or it can be historical operation and maintenance data, and this application does not impose any restrictions on this.
[0056] 2. Structure the sample power data in the form of question-answer pairing to generate multiple question-answer pairs.
[0057] 3. Based on multiple question-answer pairs, the large language model is trained to obtain a trained large language model.
[0058] As an example, the question in a question-answer pair can be input into a large language model to obtain a predicted answer of the large language model response. Based on the difference between the predicted answer of the large language model response and the answer in the question-answer pair, the large language model is adjusted to obtain a trained large language model.
[0059] In this way, the training of the large language model can be realized, the large language model's ability to understand the power field can be improved, and it can adapt to various complex and changing situations.
[0060] It should be noted that the large language model can be continuously optimized based on user feedback and / or new power data to improve the prediction accuracy and generalization ability of the large language model.
[0061] In a possible implementation of an embodiment of the present application, in the process of training a large language model based on multiple question-answer pairs, a gradient checkpoint strategy can be adopted, that is, only the activation values of some key network layers (i.e., checkpoints) are saved in the forward propagation, and then during the back propagation, the activation values of other network layers are calculated based on the saved activation values. In this way, memory usage can be minimized and the increase in computing resources can be effectively controlled.
[0062] As an example, assuming that the number of network layers in the large language model is n, we can use The strategy of saving a checkpoint once.
[0063] The carbon emission reduction method driven by a large language model in the embodiment of the present application obtains the current carbon emission factor of the service area corresponding to the power operation and maintenance system by responding to the power operation and maintenance problem input by the user; determines the selection probability corresponding to each instruction level based on the current carbon emission factor and the average energy consumption and average processing time corresponding to each instruction level in multiple instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model; based on the power operation and maintenance problem, the trained large language model is used to reason according to the selection probability of each instruction level to obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the least carbon dioxide emissions in the process of reasoning the power operation and maintenance problem by the large language model. Therefore, based on the current carbon emission factor, the selection probability of each instruction level is optimized, and then when the large language model is reasoned according to the selection probability of each instruction level, on the one hand, the power operation and maintenance answer can be obtained to realize the intelligence of the power operation and maintenance system, and on the other hand, the carbon emissions in the reasoning process can be effectively controlled.
[0064] In order to clearly explain how the selection probability corresponding to each instruction level is determined based on the current carbon emission factor and the average energy consumption and average processing time corresponding to each instruction level in multiple instruction levels in the above embodiments of the present application, the present application also proposes a carbon emission reduction method driven by a large language model.
[0065] Figure 2 A flowchart of a carbon emission reduction method driven by a large language model provided in another embodiment of the present application.
[0066] like Figure 2 As shown, the carbon emission reduction method driven by the large language model may include the following steps:
[0067] Step 201: In response to a power operation and maintenance problem input by a user, a current carbon emission factor of a service area corresponding to a power operation and maintenance system is obtained.
[0068] It should be noted that the execution process of step 201 can refer to the execution process of any embodiment of the present application and will not be repeated here.
[0069] Step 202, determining the inference hardware involved in the process of using the large language model to infer the power operation and maintenance problem, and the carbon emissions per second of the inference hardware.
[0070] Among them, the carbon emissions allocated per second can be determined based on the total amount of embodied carbon in the production process of the inference hardware and the expected usage time of the inference hardware, that is, based on the total amount of embodied carbon generated in the process of producing the inference hardware and the expected usage time of the inference hardware.
[0071] Among them, the inference hardware can be, for example, a GPU (Graphics Processing Unit), an FPGA (Field Programmable Gate Array), a TPU (Tensor Processing Unit), a CPU (Central Processing Unit), etc., and this application does not impose any restrictions on this.
[0072] Step 203, according to the current carbon emission factor, the carbon emission per second of the inference hardware, the average energy consumption and average processing time corresponding to each instruction level, a linear programming algorithm is used to determine the selection probability corresponding to each instruction level.
[0073] As a possible implementation, the objective function in the linear programming algorithm is:
[0074] minf(x)=k0·e T x+k1·p Tx; (1)
[0075] Where x=[x0,x1,……,x n-1 ] T , f(x) represents the carbon dioxide emissions generated by the power operation and maintenance system during the process of reasoning about power operation and maintenance problems using the large language model. i Indicates the selection probability corresponding to the i-th instruction level, n is the number of instruction levels, k0 represents the current carbon emission factor, k1 represents the carbon emissions per second of the inference hardware, e is a vector based on the average energy consumption corresponding to each instruction level, and p is a vector based on the average processing time corresponding to each instruction level.
[0076] Optionally, the constraints in the linear programming algorithm are:
[0077]
[0078] Where, q=[q0,q1,……,q n-1 ] T , n is the number of instruction levels, q i Indicates the quality score corresponding to the i-th instruction level, qi∈(0,1), Q(x) represents the quality score of the power operation and maintenance answer, k0 represents the current carbon emission factor, Indicates the minimum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, It represents the maximum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, and δ is a pre-set control parameter.
[0079] Among them, the quality score is used to measure the quality of the power operation and maintenance answers output by the large language model.
[0080] Here, δ can be, for example, 0.1, and this application does not impose any limitation on this.
[0081] Step 204, based on the power operation and maintenance problem, the trained large language model is used to perform reasoning according to the selection probability of each instruction level to obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the minimum carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
[0082] It should be noted that the execution process of step 204 can refer to the execution process of any embodiment of the present application, and will not be repeated here.
[0083] The carbon emission reduction method driven by a large language model in the embodiment of the present application determines the inference hardware involved in the process of the large language model reasoning about the power operation and maintenance problem, and the carbon emissions per second of the inference hardware; wherein the carbon emissions per second are determined based on the total amount of carbon implied in the production process of the inference hardware and the expected use time of the inference hardware; according to the current carbon emission factor, the carbon emissions per second of the inference hardware, the average energy consumption and average processing time corresponding to each instruction level, a linear programming algorithm is used to determine the selection probability corresponding to each instruction level. In this way, it is possible to achieve effective optimization of the selection probability corresponding to each instruction level based on the current carbon emission factor.
[0084] With the above Figure 1 to Figure 2 Corresponding to the carbon emission reduction method based on large language model driving provided in the embodiment, the present application also provides a carbon emission reduction device based on large language model driving. Figure 1 to Figure 2 The embodiment provides a carbon emission reduction method based on a large language model, so the implementation method of the carbon emission reduction method based on a large language model is also applicable to the carbon emission reduction device based on a large language model provided in the embodiment of the present application, and will not be described in detail in the embodiment of the present application.
[0085] Figure 3 A schematic structural diagram of a carbon emission reduction device driven by a large language model provided in another embodiment of the present application.
[0086] like Figure 3 As shown, the carbon emission reduction device 300 driven by a large language model may include: an acquisition module 301 , a determination module 302 and a reasoning module 303 .
[0087] The acquisition module 301 is used to acquire the current carbon emission factor of the service area corresponding to the power operation and maintenance system in response to the power operation and maintenance problem input by the user.
[0088] The determination module 302 is used to determine the selection probability corresponding to each instruction level based on the current carbon emission factor, and the average energy consumption and average processing time corresponding to each instruction level in multiple instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model.
[0089] The reasoning module 303 is used to use the trained large language model to perform reasoning according to the selection probability of each instruction level based on the power operation and maintenance problem, and obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the minimum carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
[0090] In a possible implementation of an embodiment of the present application, a determination module 302 is used to: determine the inference hardware involved in the process of reasoning about power operation and maintenance issues using a large language model, and the carbon emissions per second allocated to the inference hardware; wherein the carbon emissions per second allocated are determined based on the total amount of embodied carbon in the production process of the inference hardware and the expected usage time of the inference hardware; and determine the selection probability corresponding to each instruction level using a linear programming algorithm based on the current carbon emission factor, the carbon emissions per second allocated to the inference hardware, and the average energy consumption and average processing time corresponding to each instruction level.
[0091] In a possible implementation of the embodiment of the present application, the objective function in the linear programming algorithm is:
[0092] minf(x)=k0·e T x+k1·p T x; (3)
[0093] Where x=[x0,x1,……,x n ] T , f(x) represents the carbon dioxide emissions generated by the power operation and maintenance system during the process of reasoning about power operation and maintenance problems using the large language model. i Indicates the selection probability corresponding to the i-th instruction level, n is the number of instruction levels, k0 represents the current carbon emission factor, k1 represents the carbon emissions per second of the inference hardware, e is a vector based on the average energy consumption corresponding to each instruction level, and p is a vector based on the average processing time corresponding to each instruction level.
[0094] In a possible implementation of the embodiment of the present application, the constraints in the linear programming algorithm are:
[0095]
[0096] Where, q=[q0,q1,……,q n ] T , n is the number of instruction levels, q i Indicates the quality score corresponding to the i-th instruction level, qi∈(0,1), Q(x) represents the quality score of the power operation and maintenance answer, k0 represents the current carbon emission factor, Indicates the minimum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, It represents the maximum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, and δ is a pre-set control parameter.
[0097] In a possible implementation of the embodiment of the present application, the carbon emission reduction device 300 driven by a large language model may further include:
[0098] The training module is used to obtain sample power data, wherein the sample power data includes power knowledge and power operation and maintenance data of the power operation and maintenance system; structure the sample power data in the form of question-answer pairing to generate multiple question-answer pairs; and train the large language model based on the multiple question-answer pairs to obtain a trained large language model.
[0099] In a possible implementation of an embodiment of the present application, a training module is used to: train a large language model based on multiple question-answer pairs using a gradient checkpoint strategy to obtain a trained large language model.
[0100] The carbon emission reduction device driven by the large language model in the embodiment of the present application obtains the current carbon emission factor of the service area corresponding to the power operation and maintenance system by responding to the power operation and maintenance problem input by the user; determines the selection probability corresponding to each instruction level based on the current carbon emission factor and the average energy consumption and average processing time corresponding to each instruction level in multiple instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model; based on the power operation and maintenance problem, the trained large language model is used to reason according to the selection probability of each instruction level to obtain the power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates the least carbon dioxide emissions in the process of reasoning the power operation and maintenance problem by the large language model. Therefore, based on the current carbon emission factor, the selection probability of each instruction level is optimized, and then when the large language model is reasoned according to the selection probability of each instruction level, on the one hand, the power operation and maintenance answer can be obtained to realize the intelligence of the power operation and maintenance system, and on the other hand, the carbon emissions in the reasoning process can be effectively controlled.
[0101] In order to implement the above embodiment, the present application also proposes a power operation and maintenance system, wherein the system includes a carbon emission reduction device driven by a large language model, wherein:
[0102] The carbon emission reduction device driven by a large language model is used to implement the carbon emission reduction method driven by a large language model proposed in the above aspect of the present application.
[0103] In a possible implementation of the embodiment of the present application, the power operation and maintenance system may further include:
[0104] The quality score updating module is used to update the quality score corresponding to each instruction level in the multiple instruction levels.
[0105] In order to clearly illustrate how the quality score corresponding to each instruction level in multiple instruction levels is updated, in a possible implementation method of an embodiment of the present application, the carbon emission factor of the service area corresponding to the power operation and maintenance system is monitored in real time to obtain a first carbon emission factor of the power operation and maintenance system; the time difference is determined based on the time when the first carbon emission factor is monitored and the last update time of the quality score corresponding to each instruction level; according to the time difference, the first carbon emission factor is corrected to obtain a second carbon emission factor; in response to the second carbon emission factor being less than a set threshold and the time difference being greater than a set duration, the quality score corresponding to each instruction level is detected to determine whether the instruction score corresponding to each instruction level needs to be updated; when it is determined that the quality score corresponding to each instruction level needs to be updated, the instruction score corresponding to each instruction level is updated.
[0106] Among them, the first carbon emission factor is the result obtained by real-time monitoring of the carbon emission factor of the service area corresponding to the power operation and maintenance system.
[0107] In order to correct the first carbon emission factor, in a possible implementation of the embodiment of the present application, the second carbon emission factor may be determined according to the first carbon emission factor k and the time difference using the following formula:
[0108] k′=e -βΔt ·k; (5)
[0109] Among them, k′ represents the second carbon emission factor, e is a natural constant, β represents the decay rate, k represents the first carbon emission factor, and Δt represents the time difference.
[0110] The threshold value may be preset, and the present application does not impose any restrictions on the value of the threshold value.
[0111] Among them, the set duration can be pre-set, such as 1 minute, 24 hours, etc. This application does not limit the value of the set duration.
[0112] As an example, assuming that the first carbon emission factor is k, the time when the first carbon emission factor is monitored is t, and the last update time of the quality score corresponding to each instruction level is t0, the time difference Δt can be determined according to the following formula:
[0113] Δt=t-t0; (6)
[0114] According to the time difference, the first carbon emission factor k is corrected to obtain the second carbon emission factor k′; when the second carbon emission factor is less than the set threshold and the time difference is greater than the set duration, the quality scores corresponding to each instruction level can be tested to determine whether the instruction scores corresponding to each instruction level need to be updated; when it is determined that the quality scores corresponding to each instruction level need to be updated, the instruction scores corresponding to each instruction level can be updated.
[0115] In order to clearly illustrate the power operation and maintenance system of the present application, a detailed description is given below with reference to examples.
[0116] As an example, the power operation and maintenance system of the present application includes a data acquisition module, a data processing module, a vector database, an intelligent question and answer module (recorded as a carbon emission reduction device driven by a large language model in the present application) and a dynamic update module (recorded as a quality score update module in the present application), wherein:
[0117] The data acquisition module is used to acquire power knowledge and collect power operation and maintenance data, where the power operation and maintenance data includes equipment operating status, energy consumption, carbon emissions or carbon dioxide emissions, etc.
[0118] The data processing module is used to clean the power knowledge and power operation and maintenance data to remove noise and irrelevant information; the cleaned data is converted into JSON (JavaScript Object Notation) format according to the pairing form of questions and answers to facilitate subsequent encoding and model training; at the same time, the word embedding method is used to convert the cleaned data into vector representation or matrix representation, and the vector representation or matrix representation is stored in the vector database to form a knowledge base.
[0119] The intelligent question-answering module is used to obtain power operation and maintenance problems, fill the power operation and maintenance problems into the prompt template (i.e., prompt template), and input the power operation and maintenance problems into the trained large language model to obtain power operation and maintenance answers.
[0120] Among them, the carbon footprint optimization method is executed in the process of reasoning about power operation and maintenance problems with the large language model.
[0121] Among them, the carbon footprint optimization method is to use a linear optimization algorithm to determine the selection probabilities corresponding to multiple instruction levels, and use a trained large language model to perform inference according to the selection probabilities corresponding to each instruction level, thereby minimizing carbon emissions while ensuring the performance of the large language model.
[0122] The objective function of the linear optimization algorithm is shown in formula (1), and the constraint conditions are shown in formula (2), which will not be elaborated here.
[0123] Among them, when training a large language model, a gradient checkpoint strategy can be adopted. Specifically, by saving only the activation values of some network layers (i.e., checkpoints) in the forward propagation of the deep neural network, the activation values of other network layers are calculated based on the saved activation values, thereby effectively using the GPU memory.
[0124] The dynamic update module is used to update the quality score corresponding to each instruction level in the multiple instruction levels.
[0125] As an example, through opportunistic offline quality score updates, the instruction scores corresponding to each instruction level are dynamically adjusted according to real-time carbon emission factors and energy supply conditions to ensure optimal carbon emission control.
[0126] Among them, the method of opportunistic offline quality score update is to update the instruction score corresponding to each instruction level only when the current carbon emission factor is monitored to be lower than the set threshold. Since each update consumes a lot of energy and generates more carbon emissions, in order to reduce carbon emissions, it can be updated when the carbon emission factor is lower than the set threshold.
[0127] The frequency of updates can also be adjusted according to time to ensure that updates are not frequent, thereby further reducing carbon emissions. For example, the update frequency of the instruction scores corresponding to each instruction level can be controlled based on the time difference between the time when the current carbon emission factor is monitored and the time when the instruction scores corresponding to each instruction level were last updated.
[0128] Optionally, the power operation and maintenance system may also include an intelligent decision-making module, wherein the intelligent decision-making module is used to generate a power dispatching strategy based on the power operation and maintenance answers and the carbon emission optimization plan, thereby assisting the operation and maintenance personnel in making decisions, balancing the use of large language models and carbon footprint emissions, and improving the operation and maintenance efficiency and green level.
[0129] The power operation and maintenance system of the present application solves the problems of limited data processing capabilities, low intelligence and insufficient carbon footprint optimization after using large language models in traditional power operation and maintenance systems; by combining the carbon footprint optimization architecture with the power operation and maintenance system based on the large language model, real-time decision support and optimization suggestions are provided to achieve efficient operation and maintenance of the power system and minimize carbon emissions.
[0130] The electric power operation and maintenance system of the present application combines a large language model with carbon footprint optimization to achieve intelligent operation and maintenance and minimize carbon emissions. When training a large language model, a gradient checkpoint strategy is adopted to effectively optimize the memory usage of the large language model at runtime and improve the utilization efficiency of computing resources. Through real-time carbon emissions and energy supply conditions, an opportunistic method is used to dynamically adjust the update of instruction-level quality scores, thereby maintaining the optimal state of the system's carbon emissions.
[0131] In order to implement the above embodiments, the present application also proposes an electronic device, wherein the electronic device can be the server or detection device in the aforementioned embodiments; it includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the program, it implements the carbon emission reduction method based on large language model driven as proposed in any of the aforementioned embodiments of the present application.
[0132] In order to implement the above embodiments, the present application also proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the carbon emission reduction method based on large language model drive proposed in any of the aforementioned embodiments of the present application.
[0133] In order to implement the above embodiments, the present application also proposes a computer program product. When the instructions in the computer program product are executed by a processor, the carbon emission reduction method based on large language model driving proposed in any of the aforementioned embodiments of the present application is executed.
[0134] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0135] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0136] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0137] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0138] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0139] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0140] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0141] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A carbon emission reduction method driven by a large language model, characterized in that: Applied to a power operation and maintenance system, the method comprises: In response to the power operation and maintenance problem input by the user, obtaining the current carbon emission factor of the service area corresponding to the power operation and maintenance system; Based on the current carbon emission factor, and the average energy consumption and average processing time corresponding to each of the multiple instruction levels, determine the selection probability corresponding to each of the instruction levels; wherein the instruction level is used to control the length of the content generated by the large language model; Based on the power operation and maintenance problem, a trained large language model is used to perform reasoning according to the selection probability of each instruction level to obtain a power operation and maintenance answer output by the large language model, so that the power operation and maintenance system generates minimal carbon dioxide emissions during the process of the large language model reasoning about the power operation and maintenance problem.
2. The method according to claim 1, characterized in that The determining, based on the current carbon emission factor and the average energy consumption and average processing duration corresponding to each of the multiple instruction levels, of the selection probability corresponding to each of the instruction levels includes: Determine the inference hardware involved in the process of the large language model reasoning about the power operation and maintenance problem, and the carbon emissions per second of the inference hardware; wherein the carbon emissions per second are determined based on the total amount of embodied carbon in the production process of the inference hardware and the expected use time of the inference hardware; According to the current carbon emission factor, the carbon emission per second of the inference hardware, the average energy consumption and average processing time corresponding to each instruction level, a linear programming algorithm is used to determine the selection probability corresponding to each instruction level.
3. The method according to claim 2, characterized in that The objective function in the linear programming algorithm is: min f(x)=k0·e T x+k1·p T x; Where x=[x0,x1,……,x n ] T , f(x) represents the carbon dioxide emissions generated by the power operation and maintenance system during the process of the large language model reasoning about the power operation and maintenance problem, x i Indicates the selection probability corresponding to the i-th instruction level, n is the number of instruction levels, k0 represents the current carbon emission factor, k1 represents the carbon emissions per second of the inference hardware, e is a vector based on the average energy consumption corresponding to each instruction level, and p is a vector based on the average processing time corresponding to each instruction level.
4. The method according to claim 2, characterized in that: The constraints in the linear programming algorithm are: Where, q=[q0,q1,……,q n ] T , n is the number of instruction levels, q i Indicates the quality score corresponding to the i-th instruction level, q i ∈(0,1), Q(x) represents the quality score of the power operation and maintenance answer, k0 represents the current carbon emission factor, represents the minimum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, represents the maximum value of the historical carbon emission factor of the service area corresponding to the power operation and maintenance system, and δ is a preset control parameter.
5. The method according to claim 1, characterized in that The training of the large language model includes: Acquiring sample power data, wherein the sample power data includes power knowledge and power operation and maintenance data of the power operation and maintenance system; Structuring the sample power data in a question-answer pairing format to generate a plurality of question-answer pairs; The large language model is trained according to the multiple question-answer pairs to obtain a trained large language model.
6. The method according to claim 5, characterized in that The step of training the large language model according to the multiple question-answer pairs to obtain a trained large language model includes: According to the multiple question-answer pairs, a gradient checkpoint strategy is adopted to train the large language model to obtain a trained large language model.
7. A power operation and maintenance system, characterized in that: The system comprises: A carbon emission reduction device driven by a large language model is used to implement a carbon emission reduction method driven by a large language model according to any one of claims 1-6.
8. The system according to claim 7, characterized in that The system further comprises: The quality score updating module is used to update the quality score corresponding to each instruction level in the multiple instruction levels.
9. The system according to claim 8, characterized in that The quality score updating module is used to: Performing real-time monitoring on the carbon emission factor of the service area corresponding to the electric power operation and maintenance system to obtain a first carbon emission factor of the electric power operation and maintenance system; Determine the time difference according to the time when the first carbon emission factor is monitored and the time when the quality score corresponding to each of the instruction levels is last updated; According to the time difference, the first carbon emission factor is corrected to obtain a second carbon emission factor; In response to the second carbon emission factor being less than a set threshold and the time difference being greater than a set duration, detecting the quality scores corresponding to the instruction levels to determine whether the instruction scores corresponding to the instruction levels need to be updated; When it is determined that the quality scores corresponding to the instruction levels need to be updated, the instruction scores corresponding to the instruction levels are updated.
10. The system according to claim 9, characterized in that The quality score updating module is used to: According to the first carbon emission factor and the time difference, the second carbon emission factor is determined using the following formula: k′=e -βΔt ·k; Among them, k′ represents the second carbon emission factor, e is a natural constant, β represents the decay rate, k represents the first carbon emission factor, and Δt represents the time difference.