Carbon footprint abnormality monitoring method, device and equipment
Through multi-source data processing and model analysis, carbon footprint anomalies can be monitored in real time, solving the problem of insufficient single data monitoring in existing technologies and achieving efficient and accurate carbon footprint anomaly detection.
Patent Information
- Application Number
- CN202410221997.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-02-27
AI Technical Summary
Existing carbon footprint monitoring technologies rely on single data and are unable to detect abnormalities in a timely manner.
By acquiring monitoring data from multiple collection devices, performing data conversion, cleaning and classification, calculating real-time carbon footprint data, and using carbon footprint prediction models and anomaly monitoring models, evaluating anomaly scores in real time and outputting alarm prompts.
The accuracy of carbon footprint anomaly monitoring has been improved, and abnormal situations can be discovered in a timely manner to ensure the normal operation of the production process.
Smart Images

Figure CN118227631B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of carbon emission data processing, and in particular to a method, device and equipment for monitoring carbon footprint anomaly. Background Art
[0002] To promote the construction of a low-carbon, environmentally friendly society, companies have developed carbon footprint monitoring and management. With the popularization and development of the Internet and big data technology, the corporate carbon footprint supervision system has gradually become more popular and standardized.
[0003] At present, carbon footprint monitoring of enterprise production and manufacturing processes mainly involves building a product carbon footprint calculation model based on the life cycle assessment methodology to calculate product carbon footprint data and issue an alarm when the data is abnormal.
[0004] However, existing carbon footprint monitoring technologies only rely on single carbon footprint data and cannot detect carbon footprint anomalies in a timely manner. Summary of the Invention
[0005] The present application provides a carbon footprint anomaly monitoring method, device and equipment to solve the technical problem that the existing carbon footprint monitoring technology only relies on a single carbon footprint data and cannot detect carbon footprint anomalies in a timely manner.
[0006] In a first aspect, the present application provides a method for monitoring carbon footprint anomalies, comprising:
[0007] In response to a user's filling operation, obtaining boundary conditions and checklist settings;
[0008] Obtaining the device number of the corresponding acquisition device according to the boundary conditions and list settings;
[0009] According to the device number, a real-time collection instruction is sent to the corresponding multiple collection devices, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction;
[0010] Reading a plurality of monitoring data sent by the plurality of acquisition devices;
[0011] Performing data conversion, data cleaning, and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each of the standard monitoring data includes a corresponding device number;
[0012] Obtain the corresponding emission factor according to the equipment number;
[0013] Calculate real-time carbon footprint data based on the multiple standard monitoring data and the corresponding emission factors;
[0014] obtaining a real-time carbon footprint fluctuation according to the real-time carbon footprint data, and outputting the real-time carbon footprint fluctuation;
[0015] Inputting the plurality of standard monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data;
[0016] Subtracting the real-time carbon footprint data from the predicted carbon footprint data to obtain residual time series data;
[0017] Inputting the residual time series data into an anomaly monitoring model to obtain a real-time anomaly score;
[0018] Obtaining anomaly score fluctuations according to the real-time anomaly score, and outputting the anomaly score fluctuations;
[0019] If it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold, an alarm prompt is output.
[0020] Optionally, according to the method described above, the reading of the multiple monitoring data sent by the multiple collection devices includes: using Kafka as a distributed message queue to read the multiple monitoring data sent by the multiple collection devices; accordingly, the performing data conversion, data cleaning and data classification on the multiple monitoring data to obtain multiple standard monitoring data, including: importing the multiple monitoring data in Kafka into the Flink distributed computing framework in the form of a data stream, wherein the multiple monitoring data all include a generation time and a device number; obtaining the generation time of the multiple monitoring data, and marking the generation time as a timestamp; performing data conversion on the multiple monitoring data according to a preset data format; performing data cleaning on the missing values and abnormal values of the multiple monitoring data after format conversion, wherein the multiple monitoring data after format conversion include a timestamp and a device number; performing data classification on the multiple monitoring data after data cleaning according to the timestamp and device number to obtain multiple standard monitoring data.
[0021] Optionally, the method as described above, before inputting the multiple standard monitoring data into the carbon footprint prediction model to obtain the carbon footprint prediction data, further includes: obtaining the carbon footprint data of a first preset time period, and dividing the carbon footprint data of the first preset time period into a training data set and a verification data set; using the training data set to train the preset deep learning model to obtain a prediction model to be verified; inputting the verification data set into the prediction model to be verified to obtain a verification prediction value; calculating an error value based on the verification prediction value and the carbon footprint data in the verification data set; if it is determined that the error value meets a preset error threshold, determining that the prediction model to be verified is a carbon footprint prediction model; if it is determined that the error value does not meet the preset error threshold, adjusting the hyperparameters of the prediction model to be verified according to the error value to obtain an optimized prediction model, and using the optimized prediction model as the prediction model to be verified, and re-executing the step of "inputting the verification data set into the prediction model to be verified to obtain a verification prediction value".
[0022] Optionally, the method as described above, wherein the training data set is used to train the preset deep learning model to obtain the prediction model to be verified, includes: inputting the training data set into the preset deep learning model to obtain a carbon footprint prediction value; calculating a loss function based on the carbon footprint prediction value and the corresponding actual carbon footprint data; calculating the loss function gradient based on the loss function; updating the model parameters based on the loss function gradient and a preset optimizer, and assigning the updated parameters to the preset deep learning model, and re-executing the step of "inputting the training data set into the preset deep learning model to obtain a carbon footprint prediction value" until the loss function converges, and then determining that the preset deep learning model is the prediction model to be verified.
[0023] Optionally, the method as described above, before inputting the residual time series data into the anomaly monitoring model to obtain a real-time anomaly score, further includes: obtaining carbon footprint data and corresponding carbon footprint prediction data for a second preset time period; subtracting the carbon footprint data and the carbon footprint prediction data to obtain a residual time series; and training a preset algorithm based on the residual time series to obtain an anomaly monitoring model.
[0024] Optionally, in the above method, the preset algorithm is an isolation forest algorithm; accordingly, the preset algorithm is trained according to the residual time series to obtain an abnormality monitoring model, including: randomly selecting a plurality of sample points {n1, n2, ..., n k}, put it into the root node of the new isolated tree; randomly generate a split point between the minimum and maximum values of the multiple eigenvalues corresponding to the multiple sample points, and use the split point as the boundary to split the multiple sample points into two nodes; transfer the sample points whose corresponding eigenvalues are less than the split point to the left child node, and transfer the sample points whose corresponding eigenvalues are greater than the split point to the right child node; repeat the above splitting operation and node generation operation until there is only one data in all child nodes or the child nodes reach a preset height, then the construction of a single isolated tree is completed; repeat the above isolated tree construction operation until a preset number of isolated trees are generated, and integrate the results of all isolated trees to generate an isolation forest; assign the isolation forest to the isolation forest algorithm to generate an anomaly monitoring model.
[0025] Optionally, the method as described above, if it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold, then after outputting an alarm prompt, it also includes: querying a preset abnormal state table based on the abnormal score fluctuation to obtain the abnormal state; querying a preset solution table based on the abnormal state to obtain a solution; and outputting the solution.
[0026] Optionally, in the above method, the formula for calculating the real-time carbon footprint data based on the multiple standard monitoring data and the corresponding emission factors is:
[0027]
[0028] Where E is the real-time carbon footprint data of the product throughout its entire life cycle during the manufacturing process; Q i is the standard monitoring data collected by the i-th collection device; C i is the emission factor corresponding to the i-th collection device; the error value is calculated based on the verification prediction value and the carbon footprint data in the verification data set, and the formula is:
[0029]
[0030] In the formula, MSE is the error value, e i is the i-th carbon footprint data, is the i-th verification prediction value, n is the number of samples in the verification data set; the residual time series data is input into the anomaly monitoring model to obtain a real-time anomaly score, and the calculation formula of the anomaly monitoring model is:
[0031]
[0032] Where s(x,n) is the anomaly score, x is the residual time series data, n is the number of sample points used in training the model, E(h(x)) is the average height of x in all isolated trees, h(x) is the height of x in a certain isolated tree, and c(n) is the normalization function: where the formula for c(n) is:
[0033]
[0034] Where n is the number of sample points used in training the model, and H(n) is the harmonic series. The formula for H(n) is:
[0035]
[0036] In a second aspect, the present application provides a carbon footprint anomaly monitoring device, comprising:
[0037] A first acquisition module is used to acquire boundary conditions and checklist settings in response to a user's filling operation;
[0038] A second acquisition module is used to obtain the device number of the corresponding acquisition device according to the boundary conditions and the list settings;
[0039] A sending module, configured to send a real-time collection instruction to the corresponding multiple collection devices according to the device number, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction;
[0040] A reading module, configured to read a plurality of monitoring data sent by the plurality of acquisition devices;
[0041] a data processing module, configured to perform data conversion, data cleaning, and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each of the standard monitoring data includes a corresponding device number;
[0042] A third acquisition module is used to obtain a corresponding emission factor according to the equipment number;
[0043] A calculation module, configured to calculate real-time carbon footprint data based on the plurality of standard monitoring data and the corresponding emission factors;
[0044] a first output module, configured to obtain a real-time carbon footprint fluctuation according to the real-time carbon footprint data, and output the real-time carbon footprint fluctuation;
[0045] A first input module is configured to input the plurality of standard monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data;
[0046] a subtraction module, configured to perform subtraction between the real-time carbon footprint data and the carbon footprint prediction data to obtain residual time series data;
[0047] A second input module is used to input the residual time series data into an anomaly monitoring model to obtain a real-time anomaly score;
[0048] a second output module, configured to obtain anomaly score fluctuations according to the real-time anomaly score, and output the anomaly score fluctuations;
[0049] The third output module is configured to output an alarm prompt if it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold.
[0050] In a third aspect, the present application provides a computer device, comprising: a processor, and a memory communicatively connected to the processor;
[0051] The memory stores computer-executable instructions;
[0052] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the carbon footprint anomaly monitoring method as described in the first aspect and various possible designs of the first aspect.
[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect and various possible designs of the first aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in the first aspect and various possible designs of the first aspect.
[0055] The carbon footprint anomaly monitoring method, device, and equipment provided in this application calculate real-time carbon footprint data based on multiple standard monitoring data, and then determine real-time carbon footprint fluctuations based on the real-time carbon footprint data. The multiple monitoring data are then input into a carbon footprint prediction model to obtain carbon footprint prediction data. Residual time series data are obtained by subtracting the real-time carbon footprint from the predicted carbon footprint data. The residual time series data are then input into an anomaly monitoring model to obtain a real-time anomaly score. The anomaly score fluctuations are then determined based on the real-time anomaly score. If the anomaly score fluctuations are determined to have reached a preset anomaly threshold, an alarm is output. By taking multiple factors into consideration, the accuracy of anomaly monitoring is improved, enabling the timely detection of carbon footprint anomalies. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] Figure 1A schematic diagram of a scenario of a carbon footprint anomaly monitoring method provided in an embodiment of the present application;
[0058] Figure 2 A flowchart of a method for monitoring carbon footprint anomalies according to an embodiment of the present application is provided;
[0059] Figure 3 A schematic diagram of the structure of a carbon footprint anomaly monitoring device provided in an embodiment of the present application;
[0060] Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application.
[0061] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0062] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0063] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0064] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0065] Figure 1 Schematic diagram of the scenario of the carbon footprint anomaly monitoring method provided in the embodiment of the present application. Figure 1 As shown, the scenario provided in this embodiment includes a computer device 101 and a collection device 102 .
[0066] The acquisition device 102 may be various types of sensors.
[0067] Specifically, the computer device 101 obtains the device number of the corresponding collection device 102 according to the boundary conditions and list settings, and sends a real-time collection instruction to the corresponding multiple collection devices 102 according to the device number; the collection device 102 collects monitoring data in real time according to the real-time collection instruction, and sends the monitoring data to the computer device 101; the computer device 101 obtains real-time carbon footprint fluctuations, carbon footprint prediction data and abnormal score fluctuations based on multiple monitoring data.
[0068] Figure 2 A flow chart of a carbon footprint anomaly monitoring method provided in one embodiment of the present application. The execution subject of this embodiment can be Figure 1 The computer device 101 shown in FIG may also be other computer devices, and this embodiment does not impose any particular limitation on this. Figure 2 As shown, the method includes:
[0069] S201: In response to the user's filling operation, boundary conditions and checklist settings are obtained.
[0070] It should be noted that, referring to the object and purpose of the life cycle method calculation process, the hypothetical reservation number conditions for product analysis are given to define the boundary conditions.
[0071] It should be noted that the list setting is determined with reference to the monitoring data (i.e. energy consumption data and emission data) generated at each step in the entire life cycle of the product manufacturing process.
[0072] S202: Obtain the device number of the corresponding acquisition device according to the boundary conditions and the list settings.
[0073] S203: Sending a real-time collection instruction to the corresponding multiple collection devices according to the device number, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction.
[0074] Among them, the collection equipment can be gas emission monitoring sensors, liquid emission monitoring sensors, production equipment power sensors, etc.
[0075] It should be noted that the collection device can send the collected monitoring data to the computer device through the Internet of Things gateway through wireless network access, serial port access, USB (Universal Serial Bus) interface access, etc.
[0076] Among them, monitoring data includes energy consumption data and emission data.
[0077] S204: Read multiple monitoring data sent by multiple collection devices.
[0078] Specifically, a preset reading program is used to read a plurality of monitoring data sent by a plurality of collection devices.
[0079] S205: Perform data conversion, data cleaning, and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each standard monitoring data includes a corresponding device number.
[0080] Specifically, a preset data processing algorithm is used to perform data conversion, data cleaning and data classification on multiple monitoring data to obtain multiple standard monitoring data.
[0081] S206: Obtain the corresponding emission factor according to the equipment number.
[0082] S207: Calculate real-time carbon footprint data based on multiple standard monitoring data and corresponding emission factors.
[0083] The real-time carbon footprint data is calculated based on multiple standard monitoring data and corresponding emission factors. The formula is:
[0084]
[0085] Where E is the real-time carbon footprint data of the product throughout its entire life cycle during the manufacturing process; Q i is the standard monitoring data collected by the i-th collection device; C i is the emission factor corresponding to the i-th collection device.
[0086] S208: Obtaining real-time carbon footprint fluctuations according to the real-time carbon footprint data, and outputting the real-time carbon footprint fluctuations.
[0087] Specifically, a time series analysis algorithm is used to perform fluctuation analysis on the real-time carbon footprint data to obtain the real-time carbon footprint fluctuation.
[0088] S209: Inputting a plurality of standard monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data.
[0089] S210: Subtracting the real-time carbon footprint data from the predicted carbon footprint data to obtain residual time series data.
[0090] S211: Input the residual time series data into the anomaly monitoring model to obtain a real-time anomaly score.
[0091] Among them, the residual time series data is input into the anomaly monitoring model to obtain the real-time anomaly score. The calculation formula of the anomaly monitoring model is:
[0092]
[0093] Where s(x,n) is the anomaly score, x is the residual time series data, n is the number of sample points used in training the model, E(h(x)) is the average height of x in all isolated trees, h(x) is the height of x in a certain isolated tree, and c(n) is the normalization function.
[0094] The formula for c(n) is:
[0095]
[0096] Where n is the number of sample points used in training the model, and H(n) is the harmonic series.
[0097] The formula for H(n) is:
[0098]
[0099] In one embodiment of the present application, the Euler approximation calculation formula of H(n) is:
[0100]
[0101] Where C is Euler's constant, and C is taken as 0.5772156649.
[0102] S212: Obtain anomaly score fluctuations based on the real-time anomaly score, and output the anomaly score fluctuations.
[0103] Specifically, a time series analysis algorithm is used to perform fluctuation analysis on the real-time anomaly score to obtain the anomaly score fluctuation.
[0104] S213: If it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold, an alarm prompt is output.
[0105] As can be seen from the above description, this application calculates real-time carbon footprint data based on multiple standard monitoring data, obtains real-time carbon footprint fluctuations based on the real-time carbon footprint data; inputs multiple monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data; subtracts the real-time carbon footprint and carbon footprint prediction data to obtain residual time series data; inputs the residual time series data into an anomaly monitoring model to obtain a real-time anomaly score; obtains anomaly score fluctuations based on the real-time anomaly score; and outputs an alarm prompt if the anomaly score fluctuation is determined to have reached a preset anomaly state threshold. Taking multiple factors into consideration, the accuracy of anomaly monitoring is improved, and carbon footprint anomalies can be detected in a timely manner.
[0106] In one embodiment of the present application, in step S204, multiple monitoring data sent by multiple collection devices are read. Another implementation method is provided, which is detailed as follows:
[0107] S204: Use Kafka as a distributed message queue to read multiple monitoring data sent by multiple collection devices.
[0108] Accordingly, in step S205, data conversion, data cleaning and data classification are performed on the plurality of monitoring data to obtain a plurality of standard monitoring data. The specific process is detailed as follows:
[0109] S2051: Import multiple monitoring data in Kafka into the Flink distributed computing framework in the form of data streams, where the multiple monitoring data include generation time and device number.
[0110] S2052: Obtain the generation time of multiple monitoring data, and mark the generation time as a timestamp.
[0111] S2053: Convert the plurality of monitoring data according to a preset data format.
[0112] S2054: Perform data cleaning on missing values and abnormal values of the plurality of monitoring data after format conversion, wherein the plurality of monitoring data after format conversion includes a timestamp and a device number.
[0113] S2055: Classify the multiple monitoring data after data cleaning according to the timestamp and the device number to obtain multiple standard monitoring data.
[0114] From the above description, it can be seen that this application uses Kafka as a distributed message queue to read multiple monitoring data sent by multiple collection devices, and processes multiple monitoring data through the Flink distributed computing framework. It can effectively solve the problems of inconsistent spatiotemporal scales of multiple monitoring data with multi-source heterogeneous characteristics and time series characteristics, and difficulty in real-time data analysis. It realizes real-time automatic collection and collation of monitoring data of the production process, and ensures the efficiency and real-time performance of the carbon footprint monitoring method.
[0115] In one embodiment of the present application, based on the above embodiment, before step S209, a carbon footprint prediction model training process is further included, which is detailed as follows:
[0116] S214: Acquire carbon footprint data for a first preset time period, and divide the carbon footprint data for the first preset time period into a training data set and a validation data set.
[0117] Specifically, the carbon footprint data of the first preset time period is divided into a training data set and a validation data set according to a preset ratio.
[0118] S215: Using the training data set to train the preset deep learning model to obtain a prediction model to be verified.
[0119] Specifically, S215 includes S2151 to S2154:
[0120] S2151: Input the training data set into a preset deep learning model to obtain a carbon footprint prediction value.
[0121] Among them, the preset deep learning model includes input layer, convolutional neural network layer, gated recurrent unit layer, attention mechanism layer and output layer.
[0122] Specifically, the training data set is input into the convolutional neural network layer for local feature extraction to obtain local feature data; the local feature data is input into the gated recurrent unit layer for time series feature extraction to obtain time series feature data; the time series feature data is input into the attention mechanism layer for data weighting to obtain the carbon footprint prediction value, and the carbon footprint prediction value is output through the output layer.
[0123] S2152: Calculate a loss function based on the predicted carbon footprint value and the corresponding actual carbon footprint data.
[0124] Among them, the loss function can be mean square error loss, mean absolute error loss, etc.
[0125] S2153: Calculate the loss function gradient based on the loss function.
[0126] S2154: Update the model parameters according to the loss function gradient and the preset optimizer, and assign the updated parameters to the preset deep learning model, and re-execute the step of "inputting the training data set into the preset deep learning model to obtain the carbon footprint prediction value" until the loss function converges, then determine the preset deep learning model as the prediction model to be verified.
[0127] S216: Input the verification data set into the prediction model to be verified to obtain a verification prediction value.
[0128] S217: Calculate an error value based on the verification prediction value and the carbon footprint data in the verification data set.
[0129] Among them, the error value is calculated based on the verification prediction value and the carbon footprint data in the verification data set, and the formula is:
[0130]
[0131] In the formula, MSE is the error value, e i is the i-th carbon footprint data, is the i-th validation prediction value, and n is the number of samples in the validation dataset.
[0132] S218: If it is determined that the error value meets the preset error threshold, the prediction model to be verified is determined to be a carbon footprint prediction model.
[0133] S219: If it is determined that the error value does not meet the preset error threshold, the hyperparameters of the prediction model to be verified are adjusted according to the error value to obtain an optimized prediction model, and the optimized prediction model is used as the prediction model to be verified, and the step of "inputting the verification data set into the prediction model to be verified to obtain the verification prediction value" is re-executed.
[0134] From the above description, it can be seen that the carbon footprint prediction model trained by this application can greatly improve the accuracy of his ancestral origin prediction.
[0135] In one embodiment of the present application, based on the above embodiment, before step S211, a process of training an abnormality monitoring model is further included, which is detailed as follows:
[0136] S220: Obtaining carbon footprint data and corresponding carbon footprint prediction data for a second preset time period.
[0137] S221: Subtract the carbon footprint data from the carbon footprint prediction data to obtain a residual time series.
[0138] S222: Training a preset algorithm according to the residual time series to obtain an anomaly monitoring model.
[0139] The preset algorithm may be an isolation forest algorithm.
[0140] Specifically, S222 includes S2221 to S2226:
[0141] S2221: Randomly select multiple sample points {n1,n2,…,n k}, put it into the root node of the new isolated tree.
[0142] S2222: randomly generating a split point between the minimum value and the maximum value of the plurality of eigenvalues corresponding to the plurality of sample points, and using the split point as a boundary to split the plurality of sample points into two nodes.
[0143] S2223: Transferring sample points whose corresponding eigenvalues are smaller than the split point to the left child node, and transferring sample points whose corresponding eigenvalues are larger than the split point to the right child node.
[0144] S2224: Repeat the above splitting operation and node generation operation until there is only one data in all child nodes or the child nodes reach a preset height, and the construction of a single isolated tree is completed.
[0145] S2225: Repeat the above-mentioned isolated tree construction operation until a preset number of isolated trees are generated, and integrate the results of all isolated trees to generate an isolation forest.
[0146] S2226: Assign the isolation forest to the isolation forest algorithm to generate an anomaly monitoring model.
[0147] From the above description, it can be seen that in this application, the residual time series obtained by subtracting carbon footprint data and carbon footprint prediction data is used as training set data to train the anomaly monitoring model, realizing the combination of carbon footprint prediction and anomaly monitoring, analyzing real-time carbon footprint data, and fully tapping the value behind the carbon footprint data. It can help enterprises predict the status of the production process in advance and discover production anomalies in time, providing strong support for improving production efficiency and ensuring the normal progress of the production process.
[0148] In one embodiment of the present application, based on the above embodiment, after step S213, a process of outputting a solution to the abnormal state is further included, which is detailed as follows:
[0149] S223: querying a preset abnormal status table according to the abnormal score fluctuation to obtain the abnormal status.
[0150] S224: Query a preset solution table according to the abnormal state to obtain a solution.
[0151] S225: Output solution.
[0152] Figure 3 This is a schematic diagram of the structure of the carbon footprint anomaly monitoring device provided in the embodiment of the present application. Figure 3 As shown, the carbon footprint anomaly monitoring device 30 includes: a first acquisition module 301, a second acquisition module 302, a sending module 303, a reading module 304, a data processing module 305, a third acquisition module 306, a calculation module 307, a first output module 308, a first input module 309, a difference module 310, a second input module 311, a second output module 312 and a third output module 313.
[0153] The first acquisition module 301 is used to obtain boundary conditions and checklist settings in response to the user's filling operation;
[0154] A second acquisition module 302 is configured to acquire a device number of a corresponding acquisition device according to the boundary conditions and the list settings;
[0155] The sending module 303 is configured to send a real-time collection instruction to the corresponding multiple collection devices according to the device number, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction;
[0156] A reading module 304 is configured to read the plurality of monitoring data sent by the plurality of acquisition devices;
[0157] The data processing module 305 is used to perform data conversion, data cleaning and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each standard monitoring data includes a corresponding device number;
[0158] A third acquisition module 306 is configured to obtain a corresponding emission factor according to the equipment number;
[0159] A calculation module 307 is configured to calculate real-time carbon footprint data based on the plurality of standard monitoring data and the corresponding emission factors;
[0160] A first output module 308 is configured to obtain a real-time carbon footprint fluctuation based on the real-time carbon footprint data and output the real-time carbon footprint fluctuation;
[0161] A first input module 309 is configured to input the plurality of standard monitoring data into the carbon footprint prediction model to obtain carbon footprint prediction data;
[0162] A subtraction module 310 is used to subtract the real-time carbon footprint data from the carbon footprint prediction data to obtain residual time series data;
[0163] The second input module 311 is used to input the residual time series data into the anomaly monitoring model to obtain a real-time anomaly score;
[0164] A second output module 312 is configured to obtain anomaly score fluctuations based on the real-time anomaly score and output the anomaly score fluctuations;
[0165] The third output module 313 is configured to output an alarm prompt if it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold.
[0166] In one possible design, the reading module 304 is specifically used to: use Kafka as a distributed message queue to read the multiple monitoring data sent by the multiple collection devices; accordingly, the data processing module 305 is specifically used to: import the multiple monitoring data in Kafka into the Flink distributed computing framework in the form of a data stream, wherein the multiple monitoring data all include a generation time and a device number; obtain the generation time of the multiple monitoring data, and mark the generation time as a timestamp; perform data conversion on the multiple monitoring data according to a preset data format; perform data cleaning on the missing values and abnormal values of the multiple monitoring data after format conversion, wherein the multiple monitoring data after format conversion include a timestamp and a device number; perform data classification on the multiple monitoring data after data cleaning according to the timestamp and device number to obtain multiple standard monitoring data.
[0167] In one possible design, the carbon footprint anomaly monitoring device 30 further includes:
[0168] The model training module 314 is used to obtain the carbon footprint data of a first preset time period, divide the carbon footprint data of the first preset time period into a training data set and a verification data set; use the training data set to train the preset deep learning model to obtain a prediction model to be verified; input the verification data set into the prediction model to be verified to obtain a verification prediction value; calculate the error value based on the verification prediction value and the carbon footprint data in the verification data set; if it is determined that the error value meets the preset error threshold, determine that the prediction model to be verified is a carbon footprint prediction model; if it is determined that the error value does not meet the preset error threshold, adjust the hyperparameters of the prediction model to be verified according to the error value to obtain an optimized prediction model, and use the optimized prediction model as the prediction model to be verified, and re-execute the step of "inputting the verification data set into the prediction model to be verified to obtain a verification prediction value".
[0169] In one possible design, the model training module 314 is specifically used to: input the training data set into a preset deep learning model to obtain a carbon footprint prediction value; calculate a loss function based on the carbon footprint prediction value and the corresponding actual carbon footprint data; calculate the loss function gradient based on the loss function; update the model parameters based on the loss function gradient and a preset optimizer, and assign the updated parameters to the preset deep learning model, and re-execute the step of "inputting the training data set into the preset deep learning model to obtain a carbon footprint prediction value" until the loss function converges, and then determine that the preset deep learning model is the prediction model to be verified.
[0170] In one possible design, the model training module 314 is further used to: obtain carbon footprint data and corresponding carbon footprint prediction data for a second preset time period; perform a subtraction between the carbon footprint data and the carbon footprint prediction data to obtain a residual time series; and train a preset algorithm based on the residual time series to obtain an anomaly monitoring model.
[0171] In a possible design, the preset algorithm is an isolation forest algorithm; accordingly, the model training module 314 is further specifically used to randomly select a plurality of sample points {n1, n2, ..., n k}, put it into the root node of the new isolated tree; randomly generate a split point between the minimum and maximum values of the multiple eigenvalues corresponding to the multiple sample points, and use the split point as the boundary to split the multiple sample points into two nodes; transfer the sample points whose corresponding eigenvalues are less than the split point to the left child node, and transfer the sample points whose corresponding eigenvalues are greater than the split point to the right child node; repeat the above splitting operation and node generation operation until there is only one data in all child nodes or the child nodes reach a preset height, then the construction of a single isolated tree is completed; repeat the above isolated tree construction operation until a preset number of isolated trees are generated, and integrate the results of all isolated trees to generate an isolation forest; assign the isolation forest to the isolation forest algorithm to generate an anomaly monitoring model.
[0172] In a possible design, the third output module 313 is further used to: query a preset abnormal status table according to the abnormal score fluctuation to obtain the abnormal status; query a preset solution table according to the abnormal status to obtain a solution; and output the solution.
[0173] In one possible design, the formula for calculating the real-time carbon footprint data based on the multiple standard monitoring data and the corresponding emission factors is:
[0174]
[0175] Where E is the real-time carbon footprint data of the product throughout its entire life cycle during the manufacturing process; Q i is the standard monitoring data collected by the i-th collection device; C i is the emission factor corresponding to the i-th collection device;
[0176] The error value is calculated based on the verification prediction value and the carbon footprint data in the verification data set, and the formula is:
[0177]
[0178] In the formula, MSE is the error value, e i is the i-th carbon footprint data, is the i-th validation prediction value, and n is the number of samples in the validation dataset;
[0179] The residual time series data is input into the anomaly monitoring model to obtain a real-time anomaly score. The calculation formula of the anomaly monitoring model is:
[0180]
[0181] Where s(x,n) is the anomaly score, x is the residual time series data, n is the number of sample points used in training the model, E(h(x)) is the average height of x in all isolated trees, h(x) is the height of x in a certain isolated tree, and c(n) is the normalization function:
[0182] The formula for c(n) is:
[0183]
[0184] Where n is the number of sample points used in training the model, and H(n) is the harmonic series;
[0185] The formula for H(n) is:
[0186]
[0187] The device provided in this embodiment can be used to execute the technical solution of the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.
[0188] Figure 4 Schematic diagram of the hardware structure of the computer device provided in the embodiment of this application. Figure 4 As shown, the computer device 40 of this embodiment includes: at least one processor 401 and a memory 402; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the above carbon footprint anomaly monitoring method;
[0189] Optionally, the memory 402 may be independent or integrated with the processor 401 .
[0190] When the memory 402 is independently provided, the computer device further includes a bus 403 for connecting the memory 402 and the processor 401 .
[0191] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the carbon footprint anomaly monitoring method described above is implemented.
[0192] An embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the carbon footprint anomaly monitoring method as described above is implemented.
[0193] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
[0194] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0195] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.
[0196] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.
[0197] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0198] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0199] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep 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.
[0200] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0201] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for monitoring abnormal carbon footprint, characterized in that: Applicable to computer equipment, including: In response to a user's filling operation, obtaining boundary conditions and checklist settings; Obtaining the device number of the corresponding acquisition device according to the boundary conditions and list settings; According to the device number, a real-time collection instruction is sent to the corresponding multiple collection devices, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction; Reading a plurality of monitoring data sent by the plurality of acquisition devices; Performing data conversion, data cleaning, and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each standard monitoring data includes a corresponding device number; Obtain the corresponding emission factor according to the equipment number; Calculate real-time carbon footprint data based on the multiple standard monitoring data and the corresponding emission factors; obtaining a real-time carbon footprint fluctuation according to the real-time carbon footprint data, and outputting the real-time carbon footprint fluctuation; Inputting the plurality of standard monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data; Subtracting the real-time carbon footprint data from the predicted carbon footprint data to obtain residual time series data; Inputting the residual time series data into an anomaly monitoring model to obtain a real-time anomaly score; Obtaining anomaly score fluctuations according to the real-time anomaly score, and outputting the anomaly score fluctuations; If it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold, an alarm prompt is output.
2. The method according to claim 1, characterized in that The reading of the plurality of monitoring data sent by the plurality of acquisition devices includes: Using Kafka as a distributed message queue to read multiple monitoring data sent by the multiple collection devices; Accordingly, the plurality of monitoring data are converted, cleaned and classified to obtain a plurality of standard monitoring data, including: Import multiple monitoring data in Kafka into the Flink distributed computing framework in the form of data streams, where the multiple monitoring data include generation time and device number; Obtaining generation time of the plurality of monitoring data, and marking the generation time as a timestamp; Performing data conversion on the plurality of monitoring data according to a preset data format; performing data cleaning on missing values and outliers of a plurality of monitoring data after format conversion, wherein the plurality of monitoring data after format conversion includes a timestamp and a device number; The multiple monitoring data after data cleaning are classified according to the timestamp and the device number to obtain multiple standard monitoring data.
3. The method according to claim 1, characterized in that Before inputting the plurality of standard monitoring data into the carbon footprint prediction model to obtain the carbon footprint prediction data, the method further includes: Acquire carbon footprint data for a first preset time period, and divide the carbon footprint data for the first preset time period into a training data set and a validation data set; Using the training data set to train a preset deep learning model to obtain a prediction model to be verified; Inputting the verification data set into the prediction model to be verified to obtain a verification prediction value; Calculate an error value based on the verification prediction value and the carbon footprint data in the verification data set; If it is determined that the error value meets the preset error threshold, the prediction model to be verified is determined to be a carbon footprint prediction model; If it is determined that the error value does not meet the preset error threshold, the hyperparameters of the prediction model to be verified are adjusted according to the error value to obtain an optimized prediction model, and the optimized prediction model is used as the prediction model to be verified, and the step of "inputting the verification data set into the prediction model to be verified to obtain a verification prediction value" is re-executed.
4. The method according to claim 3, characterized in that The method of using the training data set to train a preset deep learning model to obtain a prediction model to be verified includes: Inputting the training data set into a preset deep learning model to obtain a carbon footprint prediction value; Calculating a loss function based on the carbon footprint prediction value and the corresponding actual carbon footprint data; Calculate the loss function gradient according to the loss function; The model parameters are updated according to the loss function gradient and the preset optimizer, and the updated parameters are assigned to the preset deep learning model. The step of "inputting the training data set into the preset deep learning model to obtain a carbon footprint prediction value" is re-executed until the loss function converges. The preset deep learning model is then determined to be the prediction model to be verified.
5. The method according to claim 1, wherein Before inputting the residual time series data into the anomaly monitoring model to obtain a real-time anomaly score, the method further includes: Obtaining carbon footprint data for a second preset time period and corresponding carbon footprint prediction data; Subtracting the carbon footprint data from the carbon footprint prediction data to obtain a residual time series; The preset algorithm is trained according to the residual time series to obtain an anomaly monitoring model.
6. The method according to claim 5, characterized in that The preset algorithm is the isolation forest algorithm; Accordingly, the training of a preset algorithm according to the residual time series to obtain an abnormality monitoring model includes: Randomly select multiple sample points {n1, n2, ..., n k }, put it into the root node of the new isolated tree; Randomly generate a split point between a minimum value and a maximum value of a plurality of eigenvalues corresponding to the plurality of sample points, and use the split point as a boundary to split the plurality of sample points into two nodes; Transfer the sample points whose corresponding eigenvalues are less than the split point to the left child node, and transfer the sample points whose corresponding eigenvalues are greater than the split point to the right child node; Repeat the above splitting operation and node generation operation until there is only one data in all child nodes or the child nodes reach the preset height, then the construction of a single isolated tree is completed; Repeat the above isolated tree construction operation until a preset number of isolated trees are generated, and integrate the results of all isolated trees to generate an isolation forest; The isolation forest is assigned to the isolation forest algorithm to generate an anomaly monitoring model.
7. The method according to any one of claims 1 to 6, characterized in that If it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold, after outputting an alarm prompt, the method further includes: Querying a preset abnormal status table according to the abnormal score fluctuation to obtain the abnormal status; Querying a preset solution table according to the abnormal state to obtain a solution; Output the solution.
8. The method according to claim 3, characterized in that The formula for calculating the real-time carbon footprint data based on the multiple standard monitoring data and the corresponding emission factors is: Where E is the real-time carbon footprint data of the product throughout its entire life cycle during the manufacturing process; Q i is the standard monitoring data collected by the i-th collection device; C i is the emission factor corresponding to the i-th collection device; The error value is calculated based on the verification prediction value and the carbon footprint data in the verification data set, and the formula is: In the formula, MSE is the error value, e i is the i-th carbon footprint data, is the i-th validation prediction value, and n is the number of samples in the validation dataset; The residual time series data is input into the anomaly monitoring model to obtain a real-time anomaly score. The calculation formula of the anomaly monitoring model is: Where s(x,n) is the anomaly score, x is the residual time series data, n is the number of sample points used in training the model, E(h(x)) is the average height of x in all isolated trees, h(x) is the height of x in a certain isolated tree, and c(n) is the normalization function: The formula for c(n) is: Where n is the number of sample points used in training the model, and H(n) is the harmonic series; The formula for H(n) is:
9. A carbon footprint abnormality monitoring device, characterized in that: Applicable to computer equipment, including: A first acquisition module is used to acquire boundary conditions and checklist settings in response to a user's filling operation; A second acquisition module is used to obtain the device number of the corresponding acquisition device according to the boundary conditions and the list settings; A sending module, configured to send a real-time collection instruction to the corresponding multiple collection devices according to the device number, so that the multiple collection devices collect monitoring data in real time according to the real-time collection instruction; A reading module, configured to read a plurality of monitoring data sent by the plurality of acquisition devices; a data processing module, configured to perform data conversion, data cleaning, and data classification on the plurality of monitoring data to obtain a plurality of standard monitoring data, wherein each standard monitoring data includes a corresponding device number; A third acquisition module is used to obtain a corresponding emission factor according to the equipment number; A calculation module, configured to calculate real-time carbon footprint data based on the plurality of standard monitoring data and the corresponding emission factors; a first output module, configured to obtain a real-time carbon footprint fluctuation according to the real-time carbon footprint data, and output the real-time carbon footprint fluctuation; A first input module is configured to input the plurality of standard monitoring data into a carbon footprint prediction model to obtain carbon footprint prediction data; a subtraction module, configured to perform subtraction between the real-time carbon footprint data and the carbon footprint prediction data to obtain residual time series data; A second input module is used to input the residual time series data into an anomaly monitoring model to obtain a real-time anomaly score; a second output module, configured to obtain anomaly score fluctuations according to the real-time anomaly score, and output the anomaly score fluctuations; The third output module is configured to output an alarm prompt if it is determined that the abnormal score fluctuation reaches a preset abnormal state threshold.
10. A computer device, characterized in that: include: a processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the carbon footprint anomaly monitoring method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Travel demand prediction method and system for interaction between urban functional areas
CN115204445A
Industrial product carbon footprint online monitoring method, system and equipment and storage medium
CN116468204A