Carbon emissions calculation method, device and terminal equipment
By obtaining historical electricity consumption and energy consumption data, determining user categories and using multiple modeling methods to establish carbon emission calculation models, the problem of inaccurate carbon emission calculation in the existing technology is solved, and more accurate carbon emission calculation is achieved, supporting the low-carbon transformation of the power industry.
Patent Information
- Application Number
- CN202111333542.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2041-11-11
AI Technical Summary
The lack of accurate carbon emission calculating methods in the existing technology has made it difficult for the power industry to fully adjust the energy structure and industrial structure and to effectively build a clean and low-carbon energy consumption system.
By obtaining the historical electricity consumption data and energy consumption data of the target user, determining the user category, and using the single consumption reduction method, time series method or optimization support vector regression method based on the bat algorithm to establish a carbon emission calculation model to achieve accurate calculation of different user categories.
It improves the accuracy and pertinence of carbon emissions calculations, can more accurately calculate the carbon emissions of target users, and supports the power industry to achieve carbon peak and carbon neutrality goals.
Smart Images

Figure CN114066699B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data statistics and measurement technology, and in particular relates to a carbon emission measurement method, device and terminal equipment. Background Art
[0002] As we all know, energy is an important material foundation for economic and social development. To reduce carbon emissions, my country must build an energy system centered on clean, low-carbon, safe, and efficient energy.
[0003] The core of building an energy consumption system centered on clean, low-carbon, safe and efficient energy is to control carbon emissions.
[0004] There is currently no universally recognized and accurate method for measuring carbon emissions. Therefore, there is an urgent need for a method to measure the carbon emissions of existing industries so that the power industry can comprehensively adjust its energy structure and industrial structure, thereby building an environmentally friendly power system with low-carbon operation as the core. Summary of the Invention
[0005] In order to solve the problem of inaccurate carbon emission measurement in related technologies, the embodiments of the present application provide a carbon emission measurement method, apparatus and terminal device.
[0006] This application is achieved through the following technical solutions:
[0007] In a first aspect, embodiments of the present application provide a method for calculating carbon emissions, including:
[0008] Obtaining historical electricity consumption data and historical energy consumption data of the target user, where the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data;
[0009] Determine the user category corresponding to the target user based on historical electricity usage data and historical energy consumption data;
[0010] Based on the user category, a corresponding modeling method is used to establish a carbon emissions calculation model, including at least one of the unit consumption reduction method, the time series method, and the support vector regression method based on the bat algorithm optimization;
[0011] The carbon emissions of target users are calculated based on the carbon emissions calculation model.
[0012] In a possible implementation of the first aspect, determining a user category corresponding to a target user based on historical electricity usage data and historical energy consumption data includes:
[0013] Based on historical electricity consumption data and historical energy consumption data, determine the target user's energy consumption type, energy consumption stability, and historical energy consumption distribution pattern. Energy consumption types include electricity and other energy sources, and other energy sources include at least one of coal, oil, and natural gas. Energy consumption stability is used to indicate whether the ratio between the energy consumption of other energy sources and electricity consumption is stable. Historical energy consumption distribution patterns are used to indicate the patterns of other energy consumption.
[0014] Determine the user category of the target user based on the target user's energy consumption type, energy consumption stability and historical energy consumption distribution pattern.
[0015] In a possible implementation of the first aspect, determining the user category of the target user based on the target user's energy consumption type, energy consumption stability, and historical energy consumption distribution pattern includes:
[0016] If the energy consumption stability of the target user meets the preset stability condition and the energy consumption type is less than or equal to the threshold, the user category of the target user is the first user category;
[0017] If the target user's energy consumption stability does not meet the preset stability conditions, the energy type is greater than the threshold, and the historical energy consumption distribution pattern does not meet the preset requirements, the target user's user category is the second user category;
[0018] If the energy consumption stability of the target user does not meet the preset stability conditions, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern meets the preset requirements, the user category of the target user is the third user category.
[0019] In a possible implementation of the first aspect, establishing a carbon emissions calculation model using a corresponding modeling method based on the user category includes:
[0020] If the target user's user category is the first user category, the unit consumption reduction method is used to establish a carbon emissions calculation model;
[0021] The carbon emission calculation model is C o is the target user's unit output carbon emission, α2 is the carbon emission coefficient, is the conversion coefficient of electric energy consumption to other energy consumption, and P(t) is the target user's unit output electric energy consumption.
[0022] In a possible implementation of the first aspect, a carbon emissions calculation model is established using a corresponding modeling method based on user categories, including:
[0023] If the target user's user category is the second user category, the time series method is used to establish a carbon emissions calculation model;
[0024] The carbon emission calculation model is C0(t)=α1α2y(t), where C0(t) is the carbon emission in time interval t, y(t) is the value of the target user's unit electricity consumption converted into other energy consumption, α1 is the conversion coefficient between other energy consumption and carbon emissions, and α2 is the carbon emission coefficient, which follows a binomial distribution.
[0025] Among them, for other energy consumption y(t), the historical data of other energy consumption are arranged in time series and modeled using the exponential smoothing method. Assume that the historical time series is [y i (t)] n×1 , then the carbon emission prediction model is:
[0026]
[0027] Where, is the predicted value at time i+1, γ is the weighting coefficient, y i is the actual value at time i, is the predicted value at time i.
[0028] In a possible implementation of the first aspect, a carbon emissions calculation model is established using a corresponding modeling method based on user categories, including:
[0029] If the target user's user category is the third user category, the carbon emission calculation model is established by using the support vector regression method optimized based on the bat algorithm;
[0030] The carbon emission calculation model is f(x) = w·φ(x) + b, where φ(x) is the feature space, w is the weight coefficient, and b is the bias term;
[0031] The kernel functions of the carbon emission calculation model include:
[0032] Gaussian radial basis kernel function K(x i ,x)=exp(-γ‖x i -x‖ 2 ), γ is the radius of the Gaussian radial basis kernel function;
[0033] Polynomial kernel function: K(x i ,x)=[γ(x i ·x)+coef] d , d is the order of the polynomial, and coef is the bias coefficient.
[0034] In a possible implementation of the first aspect, the carbon emissions calculation method further includes the step of optimizing the parameter values of the Gaussian radial basis kernel function using a bat algorithm;
[0035] The bat algorithm is used to optimize the parameter values of the Gaussian radial basis kernel function, including:
[0036] Divide historical electricity consumption data and historical energy consumption data into training samples and test samples;
[0037] Initialize the position and velocity of the bat population and determine the frequency, pulse emission rate, and loudness in the bat algorithm; the position of individual bats in the bat population represents the specific value of the parameters in the SVR model;
[0038] The SVR model is established according to the specific values of frequency, pulse emission rate and loudness in the bat algorithm and the training samples;
[0039] The SVR model is tested using test samples, and the obtained mean square error value is used as the fitness value of the bat individual's position to calculate the position of the best bat individual;
[0040] Update the individual optimal value and the global optimal value, and attenuate the pulse emission rate and loudness according to the number of iterations. The formula is as follows:
[0041] A t =A f A t-1
[0042]
[0043] Where A t 、A t-1 is the loudness of the bat algorithm in the tth and t-1th generations, A f is the loudness attenuation coefficient, r t The pulse emission rate of the bat algorithm in the tth generation, r0 is the initial pulse emission rate, R f is the pulse attenuation coefficient;
[0044] Determine whether the convergence condition is met. The convergence condition is that the difference between the two global optimal values is less than a given threshold or the number of algorithm cycles C reaches the maximum number of cycles;
[0045] If the convergence condition is met, the optimal parameters of the SVR model are output; if the convergence condition is not met, the step of performing sample testing on the SVR model using the test sample is re-executed until the convergence condition is met.
[0046] In a second aspect, an embodiment of the present application provides a carbon emissions measurement device, comprising:
[0047] an acquisition module, configured to acquire historical electricity consumption data and historical energy consumption data of a target user, wherein the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data;
[0048] A determination module is used to determine the user category corresponding to the target user based on historical electricity usage data and historical energy consumption data;
[0049] A model building module is used to establish a carbon emission calculation model based on user categories using a corresponding modeling method, wherein the modeling method includes at least one of a unit consumption reduction method, a time series method, and a support vector regression method based on bat algorithm optimization;
[0050] The calculation module is used to calculate the carbon emissions of target users based on the carbon emissions calculation model.
[0051] In a third aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the carbon emission calculation method as described in any one of the first aspects is implemented.
[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the carbon emission calculation method as described in any one of the first aspects is implemented.
[0053] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the carbon emission calculation method described in any one of the first aspects above.
[0054] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0055] In an embodiment of the present application, the user category corresponding to the target user is determined based on historical electricity consumption data and historical energy consumption data, and then a carbon emission calculation model is established according to the user category using at least one modeling method from a plurality of modeling methods, so as to establish different carbon emission calculation models for target users of different user categories, thereby being able to perform more targeted carbon emission calculations on the target user, thereby improving the accuracy of carbon emission calculations.
[0056] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0058] Figure 1 This is a flow chart of a carbon emissions calculation method provided in one embodiment of the present application;
[0059] Figure 2 This is a flowchart of determining the user category of a target user provided by an embodiment of the present application;
[0060] Figure 3 This is a schematic diagram of different calculation models corresponding to different user categories provided in an embodiment of the present application;
[0061] Figure 4 This is a flowchart of a support vector regression modeling method based on bat algorithm optimization provided by an embodiment of the present application;
[0062] Figure 5 This is a regression prediction chart of the oil-to-electricity conversion coefficient in the oil and natural gas extraction industry provided by an embodiment of the present application;
[0063] Figure 6 This is a structural diagram of a carbon emissions calculation device provided in an embodiment of the present application;
[0064] Figure 7 It is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.
[0066] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.
[0067] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0068] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.
[0069] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0070] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0071] Since there is currently no recognized accurate method for measuring carbon emissions, this application provides a mapping relationship between "electricity-energy-carbon" to accurately measure carbon emissions.
[0072] Obtain historical electricity consumption data and historical energy consumption data of the target user, where the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data; determine the user category corresponding to the target user based on the historical electricity consumption data and historical energy consumption data; establish a carbon emission calculation model based on the user category using a corresponding modeling method, where the modeling method includes at least one of a unit consumption reduction method, a time series method, and a support vector regression method optimized based on a bat algorithm; finally, calculate the carbon emissions of the target user based on the carbon emission calculation model.
[0073] Figure 1 This is a flow chart of a carbon emissions calculation method provided by an embodiment of the present application. Figure 1 The present application is described in detail. The specific embodiments described below are only used to explain the present application and are not used to limit the present application.
[0074] Step 101: Obtain historical electricity usage data and historical energy consumption data of a target user.
[0075] The above-mentioned historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data and historical natural gas consumption data.
[0076] Exemplarily, the historical coal consumption data is data on coal energy consumed by the target user before the current time. For example, the historical coal consumption data may be data on coal energy consumed by the target user in the previous year.
[0077] The historical oil consumption data is the data of oil energy consumed by the target user before the current time. For example, the historical oil consumption data can be the data of oil energy consumed by the target user in the previous year.
[0078] The historical natural gas consumption data is the data of natural gas energy consumed by the target user before the current time. For example, the historical oil consumption data can be the data of natural gas energy consumed by the target user in the previous year.
[0079] Step 102: Determine the user category corresponding to the target user based on the historical electricity usage data and the historical energy consumption data.
[0080] In some embodiments, step 102 may include: determining the target user's energy usage type, energy consumption stability, and historical energy consumption distribution pattern based on historical electricity usage data and historical energy consumption data; determining the target user's user category based on the target user's energy usage type, energy consumption stability, and historical energy consumption distribution pattern.
[0081] Energy types can include electricity and other energy sources, including at least one of coal, oil, and natural gas. Energy consumption stability is used to indicate whether the ratio between the energy consumption of these other energy sources and electricity consumption is stable. Historical energy consumption distribution patterns are used to indicate the patterns of energy consumption of these other energy sources.
[0082] Exemplarily, the energy type may be a combination of at least one of electric energy and other energy sources. For example, the energy type may be a combination of one of electric energy and other energy sources, or the energy type may be a combination of two of electric energy and other energy sources, or the energy type may be a combination of three of electric energy and other energy sources.
[0083] For example, if, over a certain period of time, the ratio of the energy consumption of at least one of coal, oil, or natural gas to the energy consumption of electricity fluctuates around a certain value (e.g., the difference between the ratio and the value is within a preset range), then the ratio of the energy consumption of coal, oil, or natural gas to the energy consumption of electricity can be determined to be stable. If, over a certain period of time, the ratio of the energy consumption of at least one of coal, oil, or natural gas to the energy consumption of electricity has a wide range, and there is no value such that the difference between the ratio and the value is within the preset range, then the ratio of the energy consumption of coal, oil, or natural gas to the energy consumption of electricity can be determined to be unstable.
[0084] Step 103: Based on the user category, a corresponding modeling method is used to establish a carbon emission calculation model.
[0085] The modeling methods may include at least one of the following: unit consumption reduction method, time series method, and support vector regression method optimized by the bat algorithm. For details on the process of establishing carbon emission calculation models using various modeling methods, please refer to the relevant content below and will not be elaborated here.
[0086] In this step, by establishing different carbon emission calculation models for target users of different user categories, carbon emission calculation can be performed on the target users in a more targeted manner, thereby improving the accuracy of carbon emission calculation.
[0087] Step 104: Calculate the carbon emissions of the target user using a carbon emissions calculation model.
[0088] After obtaining the carbon emission calculation model corresponding to the target user, the relevant data is input into the carbon emission calculation model, which can not only calculate the carbon emissions of the target user in a certain historical period, but also estimate future electricity consumption data and other energy consumption data to calculate the carbon emissions of the target user in a certain future period of time.
[0089] The above-mentioned carbon emission calculation method determines the user category corresponding to the target user based on historical electricity consumption data and historical energy consumption data, and then establishes a carbon emission calculation model based on the user category using at least one modeling method among multiple modeling methods, thereby establishing different carbon emission calculation models for users of different user categories, and then being able to perform carbon emission calculations on the target user in a more targeted manner, thereby improving the accuracy of carbon emission calculation.
[0090] Figure 2 A schematic diagram of a process for determining a user category of a target user provided in an embodiment of the present application is shown, including steps 201 to 205 .
[0091] Step 201, please refer to step 101, which will not be repeated here.
[0092] Step 202: Determine the target user's energy consumption type, energy consumption stability, and historical energy consumption distribution pattern based on historical electricity consumption data and historical energy consumption data.
[0093] Exemplarily, the energy types may include two, three, or four energy sources. For example, when the energy types include two energy sources, they may be electricity and coal, electricity and oil, or electricity and natural gas. When the energy types include three energy sources, they may be electricity, coal, and oil, electricity, coal, and natural gas, or electricity, oil, and natural gas. When the energy types include four energy sources, they may be electricity, coal, oil, and natural gas.
[0094] For example, energy consumption stability can be determined based on the ratio of historical energy consumption data for other energy sources to historical electricity consumption data. If the difference between the ratio and a certain value is within a preset range, the user's energy consumption is stable; if there is no value such that the difference between the ratio and the value is within the preset range, the user's energy consumption is unstable. The preset range can be set based on actual conditions and will not be explained in detail.
[0095] For example, the historical energy consumption distribution pattern can be characterized by the autocorrelation coefficient of the historical energy consumption of other energy sources. The autocorrelation coefficient formula is:
[0096]
[0097] Among them, R k is the k-order autocorrelation coefficient, X i is the value at the i-th moment, is the average value of the values over the years, X i+k is the value at time i+k. The strength of the historical energy consumption distribution pattern is proportional to the autocorrelation coefficient. That is, the larger the autocorrelation coefficient, the stronger the historical energy consumption distribution pattern, and the smaller the autocorrelation coefficient, the weaker the historical energy consumption distribution pattern.
[0098] Step 203: If the energy consumption stability of the target user meets the preset stability condition and the energy consumption type is less than or equal to the threshold, the user category of the target user is the first user category.
[0099] Exemplarily, the energy consumption stability meeting the preset stability condition may be that the difference between the ratio of the historical energy consumption data of other energy sources to the historical electricity consumption data of electric energy and a certain value is within a preset range, that is, the energy consumption of the user is stable.
[0100] For example, the threshold value can be 2, 3, or 4. A threshold value of 2 corresponds to two energy types; a threshold value of 3 corresponds to three energy types; and a threshold value of 4 corresponds to four energy types. This embodiment of the present application is described with a threshold value of 2, but is not limited thereto.
[0101] In this step, if the energy consumption of the target user is stable and the energy usage type is less than or equal to threshold 2, it can be determined that the user category of the target user is the first user category.
[0102] In step 204 , if the target user's energy consumption does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern does not meet the preset requirements, the user category of the target user is the second user category.
[0103] Exemplarily, the energy consumption stability does not meet the preset stability condition as follows: if there is no value such that the difference between the ratio and the value is within a preset range, the energy consumption of the user is unstable.
[0104] In this step, if the energy consumption of the target user is unstable, the energy consumption type is greater than the threshold 2, and the historical energy consumption distribution pattern is weak, the user category of the target user can be determined to be the second user category.
[0105] In step 205 , if the target user's energy consumption does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern meets the preset requirements, the user category of the target user is the third user category.
[0106] In this step, if the target user's energy consumption is unstable, the energy consumption type is greater than the threshold 2, and the historical energy consumption distribution pattern is strong, the user category of the target user can be determined to be the third user category.
[0107] The following describes the carbon emission calculation models established using various modeling methods.
[0108] In this embodiment, the modeling methods include single consumption reduction method, time series method and support vector regression method based on bat algorithm optimization. Figure 3 As shown in the figure, if the target user's user category is the first user category, the unit consumption reduction method is used to establish the carbon emission calculation model. If the target user's user category is the second user category, the time series method is used to establish the carbon emission calculation model. If the target user's user category is the third user category, the support vector regression method based on the bat algorithm optimization is used to establish the carbon emission calculation model.
[0109] In some embodiments, for the first user category, since the energy consumption type is less than or equal to the threshold and the energy consumption is stable, the target user's unit output electric energy consumption can be calculated based on the target user's output and electric energy consumption ratio. Moreover, the ratio of the target user's other energy consumption to electric energy consumption is stable, and the other energy consumption can be converted according to the electric energy consumption, thereby calculating the carbon emissions of the existing industry output. Correspondingly, the carbon emissions calculation model is:
[0110]
[0111] Co is the target user's unit output carbon emission, α2 is the carbon emission coefficient, is the conversion coefficient of electric energy consumption to other energy consumption, and P(t) is the target user's unit output electric energy consumption.
[0112] In some embodiments, for the second user category, the energy consumption type is greater than the threshold, the energy consumption is unstable, and the historical energy consumption distribution is irregular. Therefore, the ratio of electric energy consumption to other energy consumption can be used as a time series variable, and the conversion coefficient of electric energy consumption and other energy consumption in different time intervals can be calculated through function calculation. The electric energy consumption and the conversion coefficient are used to calculate the other energy consumption, and then the carbon emissions of the target user are calculated. Correspondingly, the carbon emissions calculation model is:
[0113] C0(t)=α1α2y(t)
[0114] Where C0(t) is the carbon emissions in time interval t, y(t) is the output electricity consumption of the target user unit converted into other energy consumption, α1 is the conversion coefficient between other energy consumption and carbon emissions, and α2 is the emission coefficient, which follows a binomial distribution.
[0115] Among them, for other energy consumption y(t), the historical data of other energy consumption are arranged in time series. The data of y(t) in the last n periods have a greater impact on the predicted value, while the data before n periods have a smaller impact on the predicted value. Therefore, this application adopts the exponential smoothing method for modeling. Assume that the historical time series is [y i (t)] n×1 , the prediction model formula is as follows:
[0116]
[0117] Where, is the predicted value at time i+1, γ is the weighting coefficient, y i is the actual value at time i, is the predicted value at time i.
[0118] In some embodiments, a carbon emission calculation model is established for the third user category using a support vector regression method based on a bat optimization algorithm.
[0119] Support vector regression (SVR) is a type of model that deals with fitting regression problems. It predicts the vector to be predicted in the test data by establishing a nonlinear relationship between the vector to be predicted in the training data and the support vector. For a given training data set T = {(x1, y1), (x2, y2), ..., (x n ,y n)}, where n is the number of training samples. SVR transforms the input space into a high-dimensional feature space through the nonlinear transformation defined by the inner product kernel function and performs regression in the high-dimensional feature space, as shown below:
[0120] f(x)=w·φ(x)+b
[0121] Where: φ(x) is the feature space, w is the weight coefficient, b is the bias term, K(x i ,x)=φ(x i )×φ(x).
[0122] Since the kernel function has an important influence on the performance of the support vector regression machine, in order to better fit the training data, a polynomial kernel function is used as the kernel function:
[0123] K(x i ,x)=[γ(x i ·x)+coef] d
[0124] Where d is the order of the polynomial and coef is the bias coefficient.
[0125] Figure 4 A flow chart of modeling based on the bat algorithm optimized support vector regression method provided in one embodiment of the present application is shown. The specific embodiments described below are only used to explain the present application and are not used to limit the present application.
[0126] Step 401: Normalize historical energy consumption data.
[0127] In this step, the historical energy consumption data is normalized to reduce the possibility of large prediction errors.
[0128] Step 402: Generate training samples and test samples for the SVR model.
[0129] The normalized historical energy consumption data may be divided into training samples and test samples. For example, the ratio of training samples to test samples is 4:1.
[0130] Step 403: Initialize the position and velocity of the bat population and determine the frequency, pulse emission rate, and loudness in the bat algorithm.
[0131] Among them, the position of individual bats in the bat population represents the specific value of the parameters in the SVR model.
[0132] For example, taking the RBF kernel function as an example, the parameters that need to be optimized are the penalty parameter C and the kernel function radius g.
[0133] Step 404: Establish an SVR model based on the determined specific values of frequency, pulse emission rate and loudness and the training samples.
[0134] Step 405 : Perform sample testing on the SVR model using the test sample, use the obtained mean square error value as the fitness value of the position of the individual bat, and calculate the position of the best individual bat.
[0135] For example, this application uses mean square error to evaluate the performance of the support vector regression machine. The specific expression is as follows:
[0136]
[0137] In the formula, l is the number of data in the test sample, y i To test the actual value, The predicted value for the test.
[0138] Step 406: Update the individual optimal value and the global optimal value, and perform attenuation processing on the pulse emission rate and loudness according to the number of iterations.
[0139] The attenuation processing formula is as follows:
[0140] A t =A f A t-1
[0141]
[0142] Where A t 、A t-1 is the loudness of the bat algorithm in the tth and t-1th generations, A f is the loudness attenuation coefficient, r t The pulse emission rate of the bat algorithm in the tth generation, r0 is the initial pulse emission rate, R f is the pulse attenuation coefficient.
[0143] Step 407: Determine whether the convergence condition is met.
[0144] The convergence condition is that the difference between the two global optimal values is less than a given threshold or the number of algorithm cycles C reaches the maximum number of cycles.
[0145] Exemplarily, if the convergence condition is met, the output is the optimal parameters of the SVR model; if the convergence condition is not met, step 405 is re-executed until the convergence condition is met.
[0146] In step 408, the algorithm outputs the optimal parameters of the SVR model, and a prediction model is established based on the optimal parameters.
[0147] To verify the effectiveness of the embodiments of the present application, the natural gas extraction industry was selected as the target user, and its historical electricity usage data and historical energy consumption data were analyzed as follows:
[0148] In the production of natural gas extraction, while consuming electricity, it also consumes coal, oil and natural gas, among which oil consumption accounts for the highest proportion. Therefore, a regression analysis is conducted on the conversion coefficient between electricity and oil. As shown in Table 1:
[0149] Table 1 Historical data of natural gas extraction industry
[0150] years 2010 2011 2012 2013 2014 2015 2016 2018 2019 2020 coal 3.64 3.1 3.71 1.94 1.83 0.89 0.02 0 0 0 oil 37.17 38.87 17.46 16 16.05 15.71 15.5 15 15 14 natural gas 3.01 2.1 1.61 1.58 1.63 1.48 1.48 1.62 1.61 1.60 electricity 11.24 11.19 11.78 12.39 13.07 21.95 13.27 11.94 12.86 12.89
[0151] Since the energy consumption includes two types of energy, the ratio of oil consumption to electricity consumption is unstable, and the electricity-oil conversion coefficient shows a decreasing trend. The calculation of the autocorrelation coefficient shows the distribution law of historical data. Therefore, the method of optimizing support vector regression based on bat algorithm is used to perform regression analysis.
[0152] Figure 5 The figure shows the regression prediction diagram of the oil-to-electricity conversion coefficient in the natural gas extraction industry. The polynomial kernel function is used as the kernel function of SVR, and the bat algorithm is used to optimize the penalty parameter C. The optimization result is 0.16259. Based on this, the support vector regression model is established. The actual and predicted values of the conversion coefficient are shown in Table 2:
[0153] years 2010 2011 2012 2013 2014 2015 2016 2018 2019 2020 2021 2022 Actual value 3.31 3.47 1.48 1.29 1.23 0.72 1.17 1.26 1.17 1.09 Predicted value 3.22 2.37 1.77 1.38 1.16 1.08 1.08 1.19 1.22 1.18 1.02 0.72
[0154] The years 2021 and 2022 represent the predicted values of the electricity-to-oil conversion coefficient for the natural gas extraction industry. Combined with the industry's actual electricity consumption data and the unit carbon emission coefficient of oil, carbon emissions for the next two years can be monitored and calculated. Therefore, by using the bat algorithm to optimize support vector regression to convert electricity to carbon, we can form an "electricity-energy-carbon" mapping, effectively measuring the carbon emissions of target users.
[0155] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0156] Corresponding to the carbon emissions calculation method described in the above embodiment, Figure 6 A structural block diagram of the carbon emission calculation device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0157] See also Figure 6 The carbon emission calculation device in the embodiment of the present application may include: an acquisition module 601, a determination module 602, a model building module 603 and a calculation module 604.
[0158] Acquisition module 601 is used to obtain historical electricity usage data and historical energy consumption data of the target user, where the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data. Determination module 602 is used to determine the user category corresponding to the target user based on the historical electricity usage data and historical energy consumption data. Modeling module 603 is used to establish a carbon emissions calculation model based on the user category using a corresponding modeling method, including at least one of a unit consumption reduction method, a time series method, and a support vector regression method optimized based on a bat algorithm. Calculation module 604 is used to calculate the carbon emissions of the target user based on the carbon emissions calculation model.
[0159] In some embodiments, the determination module 602 is used to: determine the target user's energy usage type, energy consumption stability and historical energy consumption distribution pattern based on historical electricity consumption data and historical energy consumption data, the energy usage type includes electricity and other energy sources, and other energy sources include at least one of coal, oil and natural gas. Energy consumption stability is used to characterize whether the ratio between the energy consumption of other energy sources and the energy consumption of electricity is stable; the historical energy consumption distribution pattern is used to characterize the pattern of other energy consumption; determine the user category of the target user based on the target user's energy usage type, energy consumption stability and historical energy consumption distribution pattern.
[0160] In some embodiments, the above-mentioned determination of the user category of the target user based on the target user's energy consumption type, energy consumption stability and historical energy consumption distribution pattern includes: if the target user's energy consumption stability meets the preset stability condition and the energy consumption type is less than or equal to the threshold, then the user category of the target user is the first user category; if the target user's energy consumption does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern does not meet the preset requirements, then the user category of the target user is the second user category; if the target user's energy consumption does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern meets the preset requirements, then the user category of the target user is the third user category.
[0161] In some embodiments, the model building module 603 is used to: if the user category of the target user is the first user category, then use the unit consumption reduction method to build a carbon emission calculation model; the carbon emission calculation model is C o is the target user's unit output carbon emission, α2 is the carbon emission coefficient, is the conversion coefficient of electric energy consumption to other energy consumption, and P(t) is the target user's unit output electric energy consumption.
[0162] In some embodiments, the model building module 603 is used to: if the user category of the target user is the second user category, establish a carbon emission calculation model using a time series method; the carbon emission calculation model is C0(t)=α1α2y(t), where C0(t) is the carbon emission in time interval t, y(t) is the value of the target user's unit output electric energy consumption converted to other energy consumption, α1 is the conversion coefficient between other energy consumption and carbon emissions, α2 is the carbon emission coefficient, and α2 obeys a binomial distribution;
[0163] Among them, for other energy consumption y(t), the historical data of other energy consumption are arranged in time series and modeled using the exponential smoothing method. Assume that the historical time series is [y i (t)] n×1 , the carbon emission prediction model is:
[0164]
[0165] Where, is the predicted value at time i+1, γ is the weighting coefficient, y i is the actual value at time i, is the predicted value at time i.
[0166] In some embodiments, the model building module 603 is used to: if the user category of the target user is the third user category, establish a carbon emission calculation model using a support vector regression method optimized based on a bat algorithm; the carbon emission calculation model is f(x)=w·φ(x)+b, where φ(x) is the feature space, w is the weight coefficient, and b is the bias term;
[0167] The kernel functions of the carbon emission calculation model include: Gaussian radial basis kernel function: K(x i ,x)=exp(-γ‖x i -x‖ 2 ), γ is the radius of the Gaussian radial basis kernel function; polynomial kernel function: K(x i ,x)=[γ(x i ·x)+coef] d , d is the order of the polynomial, and coef is the bias coefficient.
[0168] In some embodiments, the model building module 603 is further configured to optimize the parameter values of the Gaussian radial basis kernel function using the bat algorithm, and the process is as follows:
[0169] Divide the energy consumption history data into training samples and test samples;
[0170] Initialize the position and velocity of the bat population and determine the frequency, pulse emission rate, and loudness in the bat algorithm; the position of individual bats in the bat population represents the specific value of the parameters in the SVR model;
[0171] The SVR model is established based on the specific values of frequency, pulse emission rate and loudness and the training samples;
[0172] The SVR model is tested using test samples, and the obtained mean square error value is used as the fitness value of the bat individual's position to calculate the position of the best bat individual;
[0173] Update the individual optimal value and the global optimal value, and attenuate the pulse emission rate and loudness according to the number of iterations. The formula is as follows:
[0174] A t =A f A t-1
[0175]
[0176] Where A t 、A t-1 is the loudness of the bat algorithm in the tth and t-1th generations, A f is the loudness attenuation coefficient, r t The pulse emission rate of the bat algorithm in the tth generation, r0 is the initial pulse emission rate, R f is the pulse attenuation coefficient;
[0177] Determine whether the convergence condition is met. The convergence condition is that the difference between the two global optimal values is less than a given threshold or the number of algorithm cycles C reaches the maximum number of cycles;
[0178] If the convergence condition is met, the optimal parameters of the SVR model are output; if the convergence condition is not met, the step of performing sample testing on the SVR model using the test sample is re-executed until the convergence condition is met.
[0179] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.
[0180] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0181] The present application also provides a terminal device, see Figure 7 The terminal device 700 may include: at least one processor 701, a memory 702, and a computer program stored in the memory 702 and executable on the at least one processor 701. When the processor 701 executes the computer program, the steps in any of the above-mentioned carbon emission measurement method embodiments are implemented, for example: Figure 1 Steps 101 to 104 in the embodiment shown. Alternatively, when the processor 701 executes the computer-readable instructions, the functions of the modules / units in the above-mentioned device embodiments are realized, for example Figure 6 Functions of modules 601 to 604 are shown.
[0182] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units being stored in the memory 702 and executed by the processor 701 to complete the present application. The one or more modules / units may be a series of computer program segments capable of completing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 700.
[0183] Those skilled in the art will understand that Figure 7 These are merely examples of terminal devices and do not constitute a limitation on the terminal devices. The terminal devices may include more or fewer components than shown in the figure, or a combination of certain components, or different components, such as input and output devices, network access devices, buses, etc.
[0184] The processor 701 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor.
[0185] The memory 702 may be an internal storage unit of the terminal device or an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. The memory 702 is used to store the computer-readable instructions and other programs and data required by the image reconstruction device. The memory 702 may also be used to temporarily store data that has been output or is to be output.
[0186] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified into address buses, data buses, and control buses. For ease of illustration, the buses in the drawings of this application are not limited to just one bus or just one type of bus.
[0187] An embodiment of the present application further provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the steps in each embodiment of the above-mentioned carbon emission calculation method can be implemented.
[0188] An embodiment of the present application provides a computer program product. When the computer program product is run on a mobile terminal, the mobile terminal can implement the steps in each embodiment of the above-mentioned carbon emission calculation method when executing the computer program product.
[0189] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process of the above-mentioned method embodiment by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium can at least include: any entity or device capable of carrying computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. For example, a USB flash drive, mobile hard drive, magnetic disk, or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunication signals.
[0190] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0191] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0192] In the embodiments provided in this application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely illustrative. For example, the division of the modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0193] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0194] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.
Claims
1. A method for calculating carbon emissions, characterized in that: include: Acquire historical electricity consumption data and historical energy consumption data of the target user, wherein the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data; Based on the historical electricity usage data and the historical energy consumption data, the energy usage type, energy consumption stability and historical energy consumption distribution law of the target user are determined, the energy usage type includes electricity and other energy sources, and the other energy sources include at least one of coal, oil and natural gas. The energy consumption stability is used to characterize whether the ratio between the energy consumption of the other energy sources and the energy consumption of electricity is stable; the historical energy consumption distribution law is used to characterize the law of consumption of other energy sources; if the energy consumption stability of the target user meets the preset stability condition and the energy usage type is less than or equal to the threshold, the user category of the target user is the first user category; if the energy consumption stability of the target user does not meet the preset stability condition, the energy usage type is greater than the threshold, and the historical energy consumption distribution law does not meet the preset requirements, the user category of the target user is the second user category; if the energy consumption stability of the target user does not meet the preset stability condition, the energy usage type is greater than the threshold, and the historical energy consumption distribution law meets the preset requirements, the user category of the target user is the third user category; According to the user category, a corresponding modeling method is adopted to establish a carbon emission calculation model, and the modeling method includes at least one of a unit consumption reduction method, a time series method, and a support vector regression method optimized based on a bat algorithm; if the user category of the target user is the first user category, the unit consumption reduction method is adopted to establish the carbon emission calculation model; if the user category of the target user is the second user category, the time series method is adopted to establish the carbon emission calculation model; if the user category of the target user is the third user category, the support vector regression method optimized based on a bat algorithm is adopted to establish the carbon emission calculation model; The carbon emissions of the target user are calculated according to the carbon emissions calculation model.
2. The carbon emission calculation method according to claim 1, wherein: The carbon emission calculation model is established by using a corresponding modeling method according to the user category, including: If the user category of the target user is the first user category, the carbon emission calculation model is established by adopting the unit consumption reduction method; The carbon emission calculation model is: C o is the target user's unit output carbon emission, α2 is the carbon emission coefficient, is the conversion coefficient of electric energy consumption to other energy consumption, and P(t) is the target user's unit output electric energy consumption.
3. The carbon emission calculation method according to claim 1, wherein: The carbon emission calculation model is established by using a corresponding modeling method according to the user category, including: If the user category of the target user is the second user category, the carbon emissions calculation model is C0(t)=α1α2y(t), where C0(t) is the carbon emissions in time interval t, y(t) is the value of the target user's unit output electricity consumption converted to other energy consumption, α1 is the conversion coefficient between other energy consumption and carbon emissions, and α2 is the carbon emissions coefficient, which follows a binomial distribution; Among them, for other energy consumption y(t), the historical data of other energy consumption are arranged in time series and modeled using the exponential smoothing method. Assume that the historical time series is [y i (t)] n×1 , the carbon emission prediction model is: Where, is the predicted value at time i+1, γ is the weighting coefficient, y i is the actual value at time i, is the predicted value at time i.
4. The carbon emission calculation method according to claim 1, wherein: The carbon emission calculation model is established by using a corresponding modeling method according to the user category, including: If the user category of the target user is the third user category, the carbon emission calculation model is established by using the support vector regression method optimized based on the bat algorithm; The carbon emission calculation model is f(x)=w·φ(x)+b, where φ(x) is the feature space, w is the weight coefficient, and b is the bias term; The kernel function of the carbon emission calculation model includes: Gaussian radial basis kernel function: K(x i ,x)=exp(-γ||x i -x|| 2 ), γ is the radius of the Gaussian radial basis kernel function; Polynomial kernel function: K(x i ,x)=[γ(x i ·x)+coef] d , d is the order of the polynomial, and coef is the bias coefficient.
5. The carbon emission calculation method according to claim 4, wherein: The method further comprises the step of optimizing the parameter values of the Gaussian radial basis kernel function using a bat algorithm; The method of optimizing the parameter value of the Gaussian radial basis kernel function by using the bat algorithm includes: Dividing the historical electricity usage data and the historical energy consumption data into training samples and test samples; Initialize the position and velocity of the bat population and determine the frequency, pulse emission rate, and loudness in the bat algorithm; the position of individual bats in the bat population represents the specific value of the parameters in the SVR model; Establishing the SVR model according to the specific values of frequency, pulse emission rate and loudness in the bat algorithm and the training samples; The SVR model is tested using the test sample, and the obtained mean square error value is used as the fitness value of the position of the bat individual to calculate the position of the optimal bat individual; Update the individual optimal value and the global optimal value, and attenuate the pulse emission rate and loudness according to the number of iterations. The formula is as follows: A t =A f A t-1 Where A t 、A t-1 is the loudness of the bat algorithm in the tth and t-1th generations, A f is the loudness attenuation coefficient, r t The pulse emission rate of the bat algorithm in the tth generation, r0 is the initial pulse emission rate, R f is the pulse attenuation coefficient; Determine whether the convergence condition is met, where the difference between the two global optimal values is less than a given threshold or the number of algorithm cycles C reaches the maximum number of cycles; If the convergence condition is met, the optimal parameters of the SVR model are output; if the convergence condition is not met, the step of performing sample testing on the SVR model using the test sample is re-executed until the convergence condition is met.
6. A carbon emission measurement device, characterized in that: include: an acquisition module, configured to acquire historical electricity consumption data and historical energy consumption data of a target user, wherein the historical energy consumption data includes at least one of historical coal consumption data, historical oil consumption data, and historical natural gas consumption data; a determination module for determining the target user's energy consumption type, energy consumption stability, and historical energy consumption distribution pattern based on the historical electricity consumption data and the historical energy consumption data, wherein the energy consumption type includes electric energy and other energy sources, and the other energy sources include at least one of coal, oil, and natural gas; the energy consumption stability is used to characterize whether the ratio between the energy consumption of the other energy sources and the electric energy consumption is stable; the historical energy consumption distribution pattern is used to characterize the pattern of other energy consumption; if the target user's energy consumption stability meets a preset stability condition and the energy consumption type is less than or equal to a threshold, the user category of the target user is the first user category; if the target user's energy consumption stability does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern does not meet the preset requirements, the user category of the target user is the second user category; if the target user's energy consumption stability does not meet the preset stability condition, the energy consumption type is greater than the threshold, and the historical energy consumption distribution pattern meets the preset requirements, the user category of the target user is the third user category; a model building module, configured to establish a carbon emission calculation model using a corresponding modeling method according to the user category, the modeling method including at least one of a unit consumption reduction method, a time series method, and a support vector regression method optimized based on a bat algorithm; if the user category of the target user is the first user category, the carbon emission calculation model is established using the unit consumption reduction method; if the user category of the target user is the second user category, the carbon emission calculation model is established using the time series method; if the user category of the target user is the third user category, the carbon emission calculation model is established using the support vector regression method optimized based on a bat algorithm; The calculation module is used to calculate the carbon emissions of the target user according to the carbon emissions calculation model.
7. A terminal 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 method according to any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Metering method for carbon emission of intelligent distribution network with distributed power supplies
CN103383718A
Electric power system carbon emissions real-time measuring method and carbon meter system
CN106251095A