Carbon emission detection method and device, computer equipment and storage medium
By encoding carbon satellite data, carbon source data and wind field data and inputting them into the target detection model, the problem of equipment dependence in traditional carbon emission detection methods is solved, and low-cost and efficient carbon emission data acquisition is achieved.
Patent Information
- Application Number
- CN202410844636.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-06
AI Technical Summary
Traditional carbon emission detection methods require special equipment, resulting in high detection costs.
By acquiring carbon satellite data, carbon source data and wind field data in the target area, coding and processing are then input into the target detection model to obtain carbon emission data, avoiding the use of special equipment.
It reduces the cost of carbon emission detection and improves detection efficiency and accuracy.
Smart Images

Figure CN118607789A
Abstract
Description
Technical Field
[0001] The present application relates to the field of energy technology, and in particular to a method, apparatus, computer equipment and storage medium for determining carbon emissions. Background Art
[0002] Carbon emissions mainly refer to greenhouse gas emissions, especially carbon dioxide (CO2), generated when humans produce, transport, use and recycle a product. These greenhouse gas emissions are mainly caused by the burning of fossil fuels (such as coal, oil and natural gas) and changes in land use (such as deforestation). Detecting carbon emissions is of great significance for protecting the environment and promoting sustainable development.
[0003] In traditional technology, it is usually necessary to set up dedicated carbon emission detection equipment to obtain carbon emission data, which leads to the problem of high carbon emission detection costs. Summary of the invention
[0004] Based on this, it is necessary to provide a carbon emission detection method, device, computer equipment and storage medium to address the above technical problems, which can reduce the cost of carbon emission detection.
[0005] In a first aspect, the present application provides a carbon emission detection method, the method comprising:
[0006] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0007] Encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector;
[0008] The first vector and the second vector are input into a target detection model to obtain carbon emission data of the target area.
[0009] In one embodiment, the obtaining of target carbon satellite data, target carbon source data and target wind field data corresponding to the target area includes:
[0010] Obtain initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area;
[0011] According to the initial carbon satellite data, a target area is screened out from the initial area; wherein a difference between an air mixing ratio XCO2 of the target area and an air mixing ratio XCO2 of the candidate area is greater than a preset threshold; wherein the candidate area is an area other than the target area in a designated area including the target area;
[0012] Extracting target carbon source data corresponding to the target area from the initial carbon source data;
[0013] Extracting target wind field data corresponding to the target area from the initial wind field data;
[0014] Extracting candidate carbon satellite data corresponding to the target area from the initial carbon satellite data;
[0015] The carbon satellite data in the candidate carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, is used as the target carbon satellite data corresponding to the target area.
[0016] In one of the embodiments, the target detection model includes an embedding network, a feature extraction network, and a fully connected layer;
[0017] The step of inputting the first vector and the second vector into a target detection model to obtain carbon emission data of the target area includes:
[0018] Fusing the first vector and the second vector to obtain a fused feature;
[0019] Inputting the fused features into the embedding network for embedding processing to obtain basic features;
[0020] Inputting the basic features into the feature extraction network to extract global features to obtain global features;
[0021] The global features are input into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0022] In one of the embodiments, the embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer;
[0023] The step of inputting the fused features into the embedding network for embedding processing to obtain basic features includes:
[0024] Inputting the fused features into the fully connected embedding layer for processing to obtain fully connected features;
[0025] Inputting a preset vector into the semantic embedding layer to extract semantic features to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fusion feature;
[0026] Inputting a preset matrix into the position coding embedding layer to extract position features to obtain position features; wherein the preset matrix is used to characterize the positional relationship between the first vector and the second vector in the fusion feature;
[0027] The fully connected feature, the semantic feature and the position feature are fused to obtain the basic feature.
[0028] In one embodiment, the feature extraction network includes a preset number of self-attention modules connected end to end;
[0029] The step of inputting the basic features into the feature extraction network to extract global features to obtain global features includes:
[0030] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; wherein the input features of the first self-attention module are the basic features; and the output features of the last self-attention module are the global features.
[0031] In one embodiment, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer;
[0032] The step of inputting the output feature of the previous self-attention module to the next self-attention module to obtain the output feature of the next self-attention module includes:
[0033] Input the output feature of the previous self-attention module to the first linear layer in the next self-attention module for linear processing to obtain the first linear feature;
[0034] Inputting the first linear feature into the attention layer in the next self-attention module for feature extraction to obtain an attention feature;
[0035] Inputting the attention feature into the connection layer in the next self-attention module for connection processing to obtain a connection feature;
[0036] The connection feature is input into the second linear layer in the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0037] In a second aspect, the present application also provides a carbon emission detection device, the device comprising:
[0038] An acquisition module is used to acquire target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0039] An encoding module, used for encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector;
[0040] A detection module is used to input the first vector and the second vector into a target detection model to obtain carbon emission data of the target area.
[0041] In a third aspect, the present application further provides a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0042] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0043] Encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector;
[0044] The first vector and the second vector are input into a target detection model to obtain carbon emission data of the target area.
[0045] In a fourth aspect, the present application further 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 following steps are implemented:
[0046] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0047] Encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector;
[0048] The first vector and the second vector are input into a target detection model to obtain carbon emission data of the target area.
[0049] In a fifth aspect, the present application further provides a computer program product, the computer program product comprising a computer program, which implements the following steps when executed by a processor:
[0050] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0051] Encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector;
[0052] The first vector and the second vector are input into a target detection model to obtain carbon emission data of the target area.
[0053] The above-mentioned carbon emission detection method, device, computer equipment and storage medium first obtain the target carbon satellite data, target carbon source data and target wind farm data corresponding to the target area; and encode the target carbon satellite data and target wind farm data to obtain a first vector, and encode the target carbon source data and target wind farm data to obtain a second vector; and then input the first vector and the second vector into the target detection model to obtain the carbon emission data of the target area. The above scheme can obtain the carbon emission data of the target area based on the target carbon satellite data, target carbon source data and target wind farm data through the target detection model, without setting up dedicated carbon emission detection equipment, thereby reducing the cost of carbon emission detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1A A schematic diagram of a process for detecting carbon emissions in one embodiment;
[0055] Figure 1B is a mean difference diagram of satellite strips under different time backgrounds in one embodiment;
[0056] Figure 1C is a schematic diagram of encoding multimodal data in one embodiment;
[0057] Figure 2 A schematic diagram of a process for obtaining target carbon satellite data, target carbon source data and target wind farm data corresponding to a target area in one embodiment;
[0058] Figure 3 is a schematic diagram of the structure of a target detection model in one embodiment;
[0059] Figure 4 A schematic diagram of a process for obtaining carbon emission data of a target area in one embodiment;
[0060] Figure 5 A schematic diagram of the structure of an embedded network in one embodiment;
[0061] Figure 6 A schematic diagram of a process for obtaining basic features in an embodiment;
[0062] Figure 7 A schematic diagram of the structure of a feature extraction network in one embodiment;
[0063] Figure 8 Schematic diagram of the structure of a self-attention module in one embodiment;
[0064] Fig. 9 A schematic diagram of a process for obtaining output features of each self-attention module in one embodiment;
[0065] Fig.10A schematic diagram of the result of prediction of a training data set by a target detection model in one embodiment;
[0066] Fig.11 A schematic diagram of the result of prediction of a test data set by a target detection model in one embodiment;
[0067] Fig.12 A schematic diagram showing the effect of the position of a carbon source on the detection of carbon emission data in one embodiment;
[0068] Fig.13 is a structural block diagram of a carbon emission detection device in one embodiment;
[0069] Fig.14 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] The carbon emission detection method provided in the embodiment of the present application can be applied to the application scenario of detecting carbon emission data in a certain area.
[0072] The method can be executed by a server or by a terminal device with a certain computing power. The server can be implemented as an independent server or a server cluster composed of multiple servers. The terminal device can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.
[0073] In one embodiment, Figure 1A As shown, a carbon emission detection method is provided, which is described by taking the method applied to a server as an example, and includes the following steps:
[0074] S101, acquiring target carbon satellite data, target carbon source data and target wind field data corresponding to a target area.
[0075] Exemplarily, the target area can be understood as the current area to be detected, the target carbon satellite data is the carbon satellite data corresponding to the target area; the target carbon source data is the carbon source data corresponding to the target area; the target wind field data is the wind field data corresponding to the target area. Among them, carbon satellite data refers to data collected and processed by carbon satellites (commonly known as global carbon dioxide monitoring scientific experimental satellites), which are mainly used to monitor and analyze the concentration and distribution of carbon dioxide in the global atmosphere. Carbon source data mainly refers to data about the source of carbon dioxide. These data may include the type, location, scale, activity intensity, etc. of carbon sources, as well as changes over time. Wind field data may include data such as wind speed and wind direction.
[0076] Exemplarily, target carbon satellite data may be directly acquired, and target carbon source data and target wind field data may be acquired through monitoring equipment.
[0077] S102, encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector.
[0078] Exemplarily, the target area can be divided into multiple minimum areas that can be monitored by carbon satellites, and the carbon satellite data corresponding to each minimum area in the target area and the wind field data corresponding to the minimum area are vectorized and encoded to obtain the first vector corresponding to each minimum area. For example, the first vector corresponding to the i-th minimum area in the target area is:
[0079] S i =[lon i ,lat i , x i ,u i , v i , S max , S min , S m , b m , b s ]
[0080] Among them, S i is the first vector corresponding to the i-th minimum area, lon i and lat i represents the center coordinate of the i-th smallest area in the satellite strip, x i The carbon dioxide mixing ratio X in the dry air of the minimum area CO2 ,u i , v i Represents the wind speed along longitude and latitude respectively, S max , S min , S m , b m , b sThey represent the maximum value, minimum value, mean value, variance of the satellite stripe, and the background mean value under the satellite stripe time. The first vector can be understood as the carbon satellite stripe symbol.
[0081] For example, see Figure 1B , Figure 1B A plot of the mean differences of a satellite swath in different time contexts is provided. Figure 1B The figure shows that the overall mean value of satellite strip data increases gradually with the year. It shows that it is lower in certain months and higher in other months within a year. This is an important evidence for extracting effective statistical features of carbon satellite observation data.
[0082] Exemplarily, the target carbon source data and the target wind farm data are vectorized and encoded to obtain a second vector. For example, the obtained second vector is as follows:
[0083] P=[lon p ,lat p ,0,u p , v p ,g1,g2,0,0,0,0]
[0084] Among them, P is the second vector, lon p ,lat p is the longitude and latitude of the carbon source, u p , v p is the wind speed of the carbon source in latitude and longitude, g1 and g2 represent the power information of the carbon source, g1 is the power generation, g2 is the power consumption, and if there is no corresponding data, it is set to 0. The second vector can be understood as the carbon source symbol.
[0085] For example, see Figure 1C , Figure 1C Schematic diagram of encoding multimodal data, which refers to carbon satellite data, carbon source data and wind field data. Each minimum area i in the satellite strip data is encoded as a strip symbol S i , Stripe symbol S i It includes the location information of the smallest area, XCO2, wind farm data, etc. At the same time, the carbon source is encoded as a carbon source shape symbol P, which includes the power generation, power consumption information, location information and wind farm data of the carbon source. Among them, swath token is a strip shape symbol, soure token is a carbon source shape symbol, token embedding is the fully connected feature corresponding to the fully connected embedding layer, segment embedding is the semantic feature corresponding to the semantic embedding layer; position embedding is the position feature corresponding to the position encoding embedding layer.
[0086] S103, inputting the first vector and the second vector into a target detection model to obtain carbon emission data of the target area.
[0087] Furthermore, the first vector and the second vector corresponding to each minimum area in the target area are input into the target detection model, and the target detection model outputs the carbon emission data of the target area based on the first vector and the second vector corresponding to each minimum area.
[0088] The above carbon emission detection method first obtains the target carbon satellite data, target carbon source data and target wind farm data corresponding to the target area; and encodes the target carbon satellite data and target wind farm data to obtain a first vector, and encodes the target carbon source data and target wind farm data to obtain a second vector; and then inputs the first vector and the second vector into the target detection model to obtain the carbon emission data of the target area. The above scheme can obtain the carbon emission data of the target area based on the target carbon satellite data, target carbon source data and target wind farm data through the target detection model, without setting up dedicated carbon emission detection equipment, thereby reducing the cost of carbon emission detection.
[0089] In some optional implementations, see Figure 2 , Figure 2 A schematic flow chart of obtaining target carbon satellite data, target carbon source data and target wind field data corresponding to a target area is provided, including the following steps:
[0090] S201, obtaining initial carbon satellite data, initial carbon source data and initial wind field data corresponding to an initial area.
[0091] Exemplarily, the initial area can be understood as an area that includes the target area. The initial carbon satellite data in the initial area does not necessarily meet the requirements. For example, in the process of monitoring the carbon emission data of a certain area, it is necessary to use more representative carbon emission data in the area. Therefore, the target area can be screened out by first obtaining the initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area.
[0092] S202, screening out a target area from the initial area according to the initial carbon satellite data.
[0093] Exemplarily, the difference between the air mixing ratio XCO2 of the target area and XCO2 of the candidate area is greater than a preset threshold value; wherein the candidate area is an area other than the target area in the designated area including the target area. Therefore, when screening the target area, a candidate area can be screened out in the initial area, for example, a circumferential area W1; and then a concentric circle area W2 can be determined in the circumferential area; if the difference M between the average air mixing ratio XCO2 of area W2 and XCO2 of area W1 is greater than a preset threshold value T, then area W2 is used as the target area. The preset threshold value T can be set according to empirical data.
[0094] S203, extracting target carbon source data corresponding to the target area from the initial carbon source data.
[0095] Exemplarily, the initial carbon satellite data includes target carbon source data corresponding to the target area, so that the target carbon source data corresponding to the target area can be screened out from the initial carbon satellite data.
[0096] S204: extracting target wind field data corresponding to the target area from the initial wind field data.
[0097] Similarly, the initial wind field data also includes the target wind field data, so the target carbon source data corresponding to the target area can be screened out from the initial wind field data.
[0098] S205: Extract candidate carbon satellite data corresponding to the target area from the initial carbon satellite data.
[0099] Illustratively, in the process of determining the target carbon satellite data, the carbon satellite data corresponding to the target area may be first extracted, and the screened carbon satellite data may be used as candidate carbon satellite data to facilitate further screening of the target carbon satellite data.
[0100] S206: Use the carbon satellite data in the candidate carbon satellite data, whose wind direction is in the upwind direction relative to the carbon source in the target carbon source data, as the target carbon satellite data corresponding to the target area.
[0101] Optionally, if the angle corresponding to the wind direction of the carbon source in the candidate data relative to the target carbon source data is less than the set angle, it can be considered that the wind direction of the candidate carbon satellite data relative to the carbon source in the target carbon source data is in the upwind direction; wherein the set angle can be set according to actual conditions or empirical data, for example, set to 20°. The carbon satellite data in the candidate carbon satellite data that is in the upwind direction relative to the carbon source in the target carbon source data can be used as the target carbon satellite data corresponding to the target area.
[0102] Optionally, in order to further ensure that the target carbon satellite data can accurately reflect the carbon emissions of the target area, after determining the target carbon satellite data, it is also possible to further determine whether the target carbon satellite data is valid. Specifically, the distance K between the target carbon satellite data and the carbon source in the target carbon source data can be determined. If the ratio of M to K is less than a set threshold, for example, the set threshold is 0.2, the target carbon satellite data is considered valid, otherwise the target carbon satellite data is considered invalid. Wherein, M is the difference between XCO2 of the target area and XCO2 of the candidate area.
[0103] In an embodiment of the present application, an achievable method for obtaining target carbon satellite data, target carbon source data and target wind field data corresponding to a target area is provided, so that the obtained data can better reflect the carbon emission data of the target area, thereby improving the accuracy of the obtained carbon emission data of the target area.
[0104] For example, see Figure 3 , Figure 3 A structural diagram of a target detection model is provided. Figure 3 It shows that the target detection model includes an embedding network, a feature extraction network, and a fully connected layer. On this basis, see Figure 4 , Figure 4 A schematic diagram of a process for obtaining carbon emission data of a target area is provided, which specifically includes the following steps:
[0105] S401, fusing the first vector and the second vector to obtain a fusion feature.
[0106] Exemplarily, the first vector can be understood as the first vector corresponding to each minimum area corresponding to the target area. Fusing the first vector and the second vector can be understood as splicing to obtain a fusion feature. The obtained fusion feature is as follows:
[0107] I = [P, S0, S1, S2, ..., S n-1 ]
[0108] Among them, I is the fusion feature, n is the number of the smallest area in the target area, S0, S1, S2, ..., S n-1 They are the first vectors corresponding to the 1st, 2nd, 3rd,…, nth smallest areas respectively.
[0109] S402: Input the fused features into the embedding network for embedding processing to obtain basic features.
[0110] Exemplarily, the embedding network is used to extract basic features from the fused features, thereby inputting the fused features into the embedding network for embedding processing to obtain basic features.
[0111] S403: Input the basic features into the feature extraction network to extract global features to obtain global features.
[0112] Exemplarily, the feature extraction network is used to further extract the basic features, thereby inputting the basic features into the feature extraction network for global feature extraction to obtain global features. The feature extraction network may be composed of multiple first-connected self-attention modules.
[0113] S404, inputting the global features into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0114] Furthermore, the global features can be input into the fully connected layer for connection processing to obtain the carbon emission data of the target area.
[0115] In an embodiment of the present application, an optional structure of a target detection model is provided, based on which carbon emission data of a target area can be quickly and accurately acquired.
[0116] In some optional implementations, see Figure 5 , Figure 5 A schematic diagram of the structure of an embedded network is provided. Figure 5 It is shown that the embedding network can include a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer. Based on this, see Figure 6 , Figure 6 A flowchart for obtaining basic features is provided, which specifically includes the following steps:
[0117] S601, input the fused features into the fully connected embedding layer for processing to obtain fully connected features.
[0118] Exemplarily, the fully connected embedding layer is used to extract features from the fused features, thereby inputting the fused features into the fully connected embedding layer for processing to obtain the fully connected features.
[0119] S602: Input the preset vector into the semantic embedding layer to extract semantic features and obtain semantic features.
[0120] Exemplarily, the preset vector is used to represent the position information corresponding to the first vector in the fusion feature; for example, the preset vector Vec can be set to [1, 0, 0, ..., 0], which is used to indicate that the first vector of the input fusion feature I is the second vector, i.e., the carbon source shape symbol. Thus, the preset vector is input into the semantic embedding layer for semantic feature extraction to obtain a semantic feature, which is used to reflect the position of the first vector in the fusion feature.
[0121] S603, inputting the preset matrix into the position coding embedding layer to extract position features and obtain position features.
[0122] The preset matrix is used to characterize the positional relationship between the first vector and the second vector in the fusion feature. For example, the preset matrix can reflect the adjacent positional relationship between the first vector and the second vector in the fusion feature. Thus, the preset matrix is input into the position coding embedding layer for position feature extraction to obtain a position feature, which can reflect the adjacent relationship between the first vector and the second vector.
[0123] S604: The fully connected features, semantic features, and position features are fused to obtain basic features.
[0124] For example, the fully connected features, semantic features and position features may be fused to obtain basic features. For example, the basic features obtained are as follows:
[0125] F0=E t (I)+E s (Vec)+E p (M)
[0126] Among them, F0 is the basic feature, E t (I) is the fully connected feature, E s (Vec) is the semantic feature, E p (A) is the position feature, and A is the preset matrix. , where R(n+1)×c represents the shape of the basic matrix, n is the maximum length of the satellite strip, that is, the number of minimum areas in the satellite strip; c is the dimension of the basic feature.
[0127] In an embodiment of the present application, an optional structure of an embedded network is provided, and an achievable method for obtaining basic features is provided, so that the obtained basic features can capture the positional relationship between the first vector and the second vector in the fused features, thereby facilitating subsequent processing of the basic features.
[0128] In some optional implementations, see Figure 7 , Figure 7 A structural diagram of a feature extraction network is provided. Figure 7 It is shown that the feature extraction network includes a preset number of self-attention modules connected in the first place, and the preset number can be set according to the training accuracy and actual situation.
[0129] Based on this, the process of obtaining global features can be achieved in the following ways:
[0130] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; among them, the input features of the first self-attention module are the basic features; the output features of the last self-attention module are the global features.
[0131] In the embodiment of the present application, by setting a preset number of self-attention modules, the feature dependencies of the basic features can be captured, thereby facilitating subsequent more accurate prediction of the carbon emission data of the target area.
[0132] In some optional implementations, see Figure 8 , Figure 8 A structural schematic diagram of a self-attention module is provided, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer.
[0133] Based on this, see Fig. 9 , Fig. 9 A flowchart for obtaining the output features of each self-attention module is provided, which specifically includes the following steps:
[0134] S901, input the output feature of the previous self-attention module to the first linear layer in the next self-attention module for linear processing to obtain the first linear feature.
[0135] Exemplarily, the output features of the previous self-attention module are input into the first linear layer in the next self-attention module for linear processing, such as data conversion and feature extraction, to obtain the first linear features.
[0136] S902, input the first linear feature into the attention layer in the next self-attention module for feature extraction to obtain an attention feature.
[0137] Exemplarily, the first linear feature can be input into the attention layer in the next self-attention module for feature extraction, so as to capture important information in the first linear feature, for example, capture global dependencies, and then obtain the attention feature.
[0138] S903, input the attention feature to the connection layer in the next self-attention module for connection processing to obtain the connection feature.
[0139] Exemplarily, the attention feature can be input into the connection layer in the next self-attention module for connection processing. The connection processing makes the self-attention module easier to train and reduces the gradient vanishing problem, thereby obtaining the connection feature.
[0140] S904: Input the connection feature to the second linear layer in the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0141] Furthermore, the connection features can be input into the second linear layer in the next self-attention module for linear processing, for example, data conversion and feature extraction can also be performed to obtain the output features of the next self-attention module.
[0142] For example, the output features of each attention module are F1, F2, ..., F m , where m is the number of self-attention modules, and The output feature of the self-attention module at the end is F m =[f0, f1, …, f n ], where f0, f1, …, f n is a vector of dimension c.
[0143] In an embodiment of the present application, an optional structure of a self-attention module is provided, and an implementation method for obtaining the output features of each self-attention module based on the optional structure is provided, so that the output features of each self-attention module can capture more key information, thereby facilitating improving the accuracy of the carbon emission data of the target area.
[0144] Exemplarily, the feature extraction network may also include a three-layer convolutional pooling network, which takes the output feature F of the last self-attention module m The input is sent to a three-layer convolutional pooling network for global pooling operations to obtain global features.
[0145] The global features can then be input into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0146] In some optional implementations, the target detection model can be obtained by training the initial detection model, wherein the initial detection model can be one or more of a deep learning model, a random forest model, a support vector machine model, and a deep neural network CarNet based on an attention mechanism. The actual carbon emission data of the sample area monitored by the continuous emission monitoring system (CEMS) is used as the label data, and the sample carbon satellite data, sample carbon source data, and sample wind field data corresponding to the sample area are used as the training data and verification data to train the initial detection model. When the loss function meets the preset conditions, the trained sample detection model is used as the target detection model. Among them, the loss function can select the L1 loss function.
[0147] In some optional implementations, see Figure 10-11 , Fig.10 The schematic diagram shows the result of the target detection model predicting the training data set. Fig.10 It can be seen that the target detection model fully fits the training set and learns the mapping from the target carbon satellite data, target carbon source data and target wind field data of the target area to the carbon emission data of the target area. Fig.11 The schematic diagram shows the result of the target detection model predicting the test data set. Fig.11 It can be seen that the target detection model can estimate the carbon emission data of carbon sources within an appropriate error range, and when the carbon emission data of carbon sources is large, the target detection model shows more accurate carbon emission estimation performance.
[0148] Optional, attend Fig.12 , Fig.12 A schematic diagram of the effect of the location of the carbon source on the detection of carbon emission data is provided. Fig.12It can be seen that when other data remain unchanged, the carbon source will detect higher carbon emissions along the wind speed direction, and the closer to the edge, the lower the carbon emission data. This shows that the target detection model fully learns the relationship between the relative position in the multimodal data and the intensity of carbon emission data.
[0149] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0150] Based on the same inventive concept, the embodiment of the present application also provides a carbon emission detection device for implementing the carbon emission detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more carbon emission detection device embodiments provided below can refer to the limitations of the carbon emission detection method above, and will not be repeated here.
[0151] In one embodiment, Fig.13 As shown, a carbon emission detection device is provided, comprising
[0152] An acquisition module 10 is used to acquire target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0153] An encoding module 20, configured to encode the target carbon satellite data and the target wind farm data to obtain a first vector, and to encode the target carbon source data and the target wind farm data to obtain a second vector;
[0154] The detection module 30 is used to input the first vector and the second vector into the target detection model to obtain the carbon emission data of the target area.
[0155] The above-mentioned carbon emission detection device first obtains the target carbon satellite data, target carbon source data and target wind field data corresponding to the target area; and encodes the target carbon satellite data and target wind field data to obtain a first vector, and encodes the target carbon source data and target wind field data to obtain a second vector; and then inputs the first vector and the second vector into the target detection model to obtain the carbon emission data of the target area. The above scheme can obtain the carbon emission data of the target area based on the target carbon satellite data, target carbon source data and target wind field data through the target detection model, without setting up dedicated carbon emission detection equipment, thereby reducing the cost of carbon emission detection.
[0156] In one embodiment, the acquisition module 10 is specifically used for:
[0157] Acquire initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area; select a target area from the initial area according to the initial carbon satellite data; wherein the difference between the air mixing ratio XCO2 of the target area and the XCO2 of the alternative area is greater than a preset threshold; wherein the alternative area is an area other than the target area in a designated area including the target area; extract target carbon source data corresponding to the target area from the initial carbon source data; extract target wind field data corresponding to the target area from the initial wind field data; extract alternative carbon satellite data corresponding to the target area from the initial carbon satellite data; use the carbon satellite data in the alternative carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, as the target carbon satellite data corresponding to the target area.
[0158] In one embodiment, the target detection model includes an embedding network, a feature extraction network and a fully connected layer; the detection module 30 specifically includes:
[0159] A fusion unit, used for fusing the first vector and the second vector to obtain a fusion feature;
[0160] The embedding unit is used to input the fused features into the embedding network for embedding processing to obtain the basic features;
[0161] The global extraction module is used to input the basic features into the feature extraction network to extract global features and obtain global features;
[0162] The connection processing module is used to input the global features into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0163] In one embodiment, the embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer; the embedding unit is specifically used to:
[0164] The fused features are input into the fully connected embedding layer for processing to obtain fully connected features; the preset vector is input into the semantic embedding layer for semantic feature extraction to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fused features; the preset matrix is input into the position coding embedding layer for position feature extraction to obtain position features; wherein the preset matrix is used to represent the positional relationship between the first vector and the second vector in the fused features; the fully connected features, semantic features and position features are fused to obtain basic features.
[0165] In one embodiment, the feature extraction network includes a preset number of self-attention modules connected end to end; the global extraction module is specifically used for:
[0166] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; among them, the input features of the first self-attention module are the basic features; the output features of the last self-attention module are the global features.
[0167] In one embodiment, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer; and the global extraction module is specifically used for:
[0168] The output feature of the previous self-attention module is input into the first linear layer of the next self-attention module for linear processing to obtain the first linear feature; the first linear feature is input into the attention layer of the next self-attention module for feature extraction to obtain the attention feature; the attention feature is input into the connection layer of the next self-attention module for connection processing to obtain the connection feature; the connection feature is input into the second linear layer of the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0169] Each module in the above carbon emission detection device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0170] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.14As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store carbon satellite data, carbon source data and environmental data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a carbon emission detection method is implemented.
[0171] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0172] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0173] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0174] Encoding the target carbon satellite data and the target wind field data to obtain a first vector, and encoding the target carbon source data and the target wind field data to obtain a second vector;
[0175] The first vector and the second vector are input into the target detection model to obtain the carbon emission data of the target area.
[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0177] Acquire initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area; select a target area from the initial area according to the initial carbon satellite data; wherein the difference between the air mixing ratio XCO2 of the target area and the XCO2 of the alternative area is greater than a preset threshold; wherein the alternative area is an area other than the target area in a designated area including the target area; extract target carbon source data corresponding to the target area from the initial carbon source data; extract target wind field data corresponding to the target area from the initial wind field data; extract alternative carbon satellite data corresponding to the target area from the initial carbon satellite data; use the carbon satellite data in the alternative carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, as the target carbon satellite data corresponding to the target area.
[0178] In one embodiment, the target detection model includes an embedding network, a feature extraction network, and a fully connected layer; when the processor executes the computer program, the following steps are also implemented:
[0179] The first vector and the second vector are fused to obtain fused features; the fused features are input into the embedding network for embedding processing to obtain basic features; the basic features are input into the feature extraction network for global feature extraction to obtain global features; the global features are input into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0180] In one embodiment, the embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer; when the processor executes the computer program, the following steps are also implemented:
[0181] The fused features are input into the fully connected embedding layer for processing to obtain fully connected features; the preset vector is input into the semantic embedding layer for semantic feature extraction to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fused features; the preset matrix is input into the position coding embedding layer for position feature extraction to obtain position features; wherein the preset matrix is used to represent the positional relationship between the first vector and the second vector in the fused features; the fully connected features, semantic features and position features are fused to obtain basic features.
[0182] In one embodiment, the feature extraction network includes a preset number of self-attention modules connected end to end; when the processor executes the computer program, the following steps are also implemented:
[0183] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; among them, the input features of the first self-attention module are the basic features; the output features of the last self-attention module are the global features.
[0184] In one embodiment, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer; when the processor executes the computer program, the following steps are also implemented:
[0185] The output feature of the previous self-attention module is input into the first linear layer of the next self-attention module for linear processing to obtain the first linear feature; the first linear feature is input into the attention layer of the next self-attention module for feature extraction to obtain the attention feature; the attention feature is input into the connection layer of the next self-attention module for connection processing to obtain the connection feature; the connection feature is input into the second linear layer of the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0186] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0187] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0188] Encoding the target carbon satellite data and the target wind field data to obtain a first vector, and encoding the target carbon source data and the target wind field data to obtain a second vector;
[0189] The first vector and the second vector are input into the target detection model to obtain the carbon emission data of the target area.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] Acquire initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area; select a target area from the initial area according to the initial carbon satellite data; wherein the difference between the air mixing ratio XCO2 of the target area and the XCO2 of the alternative area is greater than a preset threshold; wherein the alternative area is an area other than the target area in a designated area including the target area; extract target carbon source data corresponding to the target area from the initial carbon source data; extract target wind field data corresponding to the target area from the initial wind field data; extract alternative carbon satellite data corresponding to the target area from the initial carbon satellite data; use the carbon satellite data in the alternative carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, as the target carbon satellite data corresponding to the target area.
[0192] In one embodiment, the target detection model includes an embedding network, a feature extraction network, and a fully connected layer; when the computer program is executed by a processor, the following steps are also implemented:
[0193] The first vector and the second vector are fused to obtain fused features; the fused features are input into the embedding network for embedding processing to obtain basic features; the basic features are input into the feature extraction network for global feature extraction to obtain global features; the global features are input into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0194] In one embodiment, the embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer; when the computer program is executed by the processor, the following steps are also implemented:
[0195] The fused features are input into the fully connected embedding layer for processing to obtain fully connected features; the preset vector is input into the semantic embedding layer for semantic feature extraction to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fused features; the preset matrix is input into the position coding embedding layer for position feature extraction to obtain position features; wherein the preset matrix is used to represent the positional relationship between the first vector and the second vector in the fused features; the fully connected features, semantic features and position features are fused to obtain basic features.
[0196] In one embodiment, the feature extraction network includes a preset number of self-attention modules connected end to end; when the computer program is executed by the processor, the following steps are also implemented:
[0197] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; among them, the input features of the first self-attention module are the basic features; the output features of the last self-attention module are the global features.
[0198] In one embodiment, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer; when the computer program is executed by a processor, the following steps are also implemented:
[0199] The output feature of the previous self-attention module is input into the first linear layer of the next self-attention module for linear processing to obtain the first linear feature; the first linear feature is input into the attention layer of the next self-attention module for feature extraction to obtain the attention feature; the attention feature is input into the connection layer of the next self-attention module for connection processing to obtain the connection feature; the connection feature is input into the second linear layer of the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0200] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0201] Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area;
[0202] Encoding the target carbon satellite data and the target wind field data to obtain a first vector, and encoding the target carbon source data and the target wind field data to obtain a second vector;
[0203] The first vector and the second vector are input into the target detection model to obtain the carbon emission data of the target area.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] Acquire initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area; select a target area from the initial area according to the initial carbon satellite data; wherein the difference between the air mixing ratio XCO2 of the target area and the XCO2 of the alternative area is greater than a preset threshold; wherein the alternative area is an area other than the target area in a designated area including the target area; extract target carbon source data corresponding to the target area from the initial carbon source data; extract target wind field data corresponding to the target area from the initial wind field data; extract alternative carbon satellite data corresponding to the target area from the initial carbon satellite data; use the carbon satellite data in the alternative carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, as the target carbon satellite data corresponding to the target area.
[0206] In one embodiment, the target detection model includes an embedding network, a feature extraction network, and a fully connected layer; when the computer program is executed by a processor, the following steps are also implemented:
[0207] The first vector and the second vector are fused to obtain fused features; the fused features are input into the embedding network for embedding processing to obtain basic features; the basic features are input into the feature extraction network for global feature extraction to obtain global features; the global features are input into the fully connected layer for processing to obtain the carbon emission data of the target area.
[0208] In one embodiment, the embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer; when the computer program is executed by the processor, the following steps are also implemented:
[0209] The fused features are input into the fully connected embedding layer for processing to obtain fully connected features; the preset vector is input into the semantic embedding layer for semantic feature extraction to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fused features; the preset matrix is input into the position coding embedding layer for position feature extraction to obtain position features; wherein the preset matrix is used to represent the positional relationship between the first vector and the second vector in the fused features; the fully connected features, semantic features and position features are fused to obtain basic features.
[0210] In one embodiment, the feature extraction network includes a preset number of self-attention modules connected end to end; when the computer program is executed by the processor, the following steps are also implemented:
[0211] The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; among them, the input features of the first self-attention module are the basic features; the output features of the last self-attention module are the global features.
[0212] In one embodiment, each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer; when the computer program is executed by a processor, the following steps are also implemented:
[0213] The output feature of the previous self-attention module is input into the first linear layer of the next self-attention module for linear processing to obtain the first linear feature; the first linear feature is input into the attention layer of the next self-attention module for feature extraction to obtain the attention feature; the attention feature is input into the connection layer of the next self-attention module for connection processing to obtain the connection feature; the connection feature is input into the second linear layer of the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
[0214] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0215] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0216] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A carbon emission detection method, characterized in that: The method comprises: Obtain target carbon satellite data, target carbon source data and target wind field data corresponding to the target area; Encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector; The first vector and the second vector are input into a target detection model to obtain carbon emission data of the target area.
2. The method according to claim 1, characterized in that The step of obtaining target carbon satellite data, target carbon source data and target wind field data corresponding to the target area includes: Obtain initial carbon satellite data, initial carbon source data and initial wind field data corresponding to the initial area; According to the initial carbon satellite data, a target area is screened out from the initial area; wherein a difference between an air mixing ratio XCO2 of the target area and an air mixing ratio XCO2 of the candidate area is greater than a preset threshold; wherein the candidate area is an area other than the target area in a designated area including the target area; Extracting target carbon source data corresponding to the target area from the initial carbon source data; Extracting target wind field data corresponding to the target area from the initial wind field data; Extracting candidate carbon satellite data corresponding to the target area from the initial carbon satellite data; The carbon satellite data in the candidate carbon satellite data, whose wind direction relative to the carbon source in the target carbon source data is in the windward direction, is used as the target carbon satellite data corresponding to the target area.
3. The method according to claim 1, characterized in that: The target detection model includes an embedding network, a feature extraction network and a fully connected layer; The step of inputting the first vector and the second vector into a target detection model to obtain carbon emission data of the target area includes: Fusing the first vector and the second vector to obtain a fused feature; Inputting the fused features into the embedding network for embedding processing to obtain basic features; Inputting the basic features into the feature extraction network to extract global features to obtain global features; The global features are input into the fully connected layer for processing to obtain the carbon emission data of the target area.
4. The method according to claim 3, characterized in that The embedding network includes a fully connected embedding layer, a semantic embedding layer, and a position encoding embedding layer; The step of inputting the fused features into the embedding network for embedding processing to obtain basic features includes: Inputting the fused features into the fully connected embedding layer for processing to obtain fully connected features; Inputting a preset vector into the semantic embedding layer to extract semantic features to obtain semantic features; wherein the preset vector is used to represent the position information corresponding to the first vector in the fusion feature; Inputting a preset matrix into the position coding embedding layer to extract position features to obtain position features; wherein the preset matrix is used to characterize the positional relationship between the first vector and the second vector in the fusion feature; The fully connected feature, the semantic feature and the position feature are fused to obtain the basic feature.
5. The method according to claim 3, characterized in that: The feature extraction network includes a preset number of self-attention modules connected end to end; The step of inputting the basic features into the feature extraction network to extract global features to obtain global features includes: The output features of the previous self-attention module are input into the next self-attention module to obtain the output features of the next self-attention module; wherein the input features of the first self-attention module are the basic features; and the output features of the last self-attention module are the global features.
6. The method according to claim 5, characterized in that Each self-attention module includes a first linear layer, an attention layer, a connection layer, and a second linear layer; The step of inputting the output feature of the previous self-attention module to the next self-attention module to obtain the output feature of the next self-attention module includes: Input the output feature of the previous self-attention module to the first linear layer in the next self-attention module for linear processing to obtain the first linear feature; Inputting the first linear feature into the attention layer in the next self-attention module for feature extraction to obtain an attention feature; Inputting the attention feature into the connection layer in the next self-attention module for connection processing to obtain a connection feature; The connection feature is input into the second linear layer in the next self-attention module for linear processing to obtain the output feature of the next self-attention module.
7. A carbon emission detection device, characterized in that: The device comprises: An acquisition module is used to acquire target carbon satellite data, target carbon source data and target wind field data corresponding to the target area; An encoding module, used for encoding the target carbon satellite data and the target wind farm data to obtain a first vector, and encoding the target carbon source data and the target wind farm data to obtain a second vector; A detection module is used to input the first vector and the second vector into a target detection model to obtain carbon emission data of the target area.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
