Carbon data processing method and device based on block chain, equipment and medium
Through the blockchain-based carbon data processing method, dynamic key encryption and smart contract analysis are used to solve the problems of low data security and unintelligent analysis methods in enterprise carbon emission data processing, and high security and intelligent carbon data processing are achieved.
Patent Information
- Application Number
- CN202411671888.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-11-21
AI Technical Summary
In the processing of corporate carbon emission data, there are problems such as low data security, lack of effective encryption protection measures, and insufficient intelligent automation of analysis methods.
The blockchain-based carbon data processing method is adopted to collect carbon data through IoT devices, generate dynamic keys for encryption, and use blockchain nodes to verify the legitimacy of the data and the key generation logic. Then, smart contracts are used to analyze encrypted carbon data to achieve intelligent and automated data analysis.
It improves the confidentiality and integrity of carbon data in transmission and storage, ensures the security and reliability of data, and realizes intelligent and automated analysis of carbon emission data, and deeply explores the value behind the data.
Smart Images

Figure CN119598515A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based carbon data processing method, device, equipment and medium. Background Art
[0002] Existing technologies have certain limitations in processing corporate carbon emission data. Usually, they simply collect corporate carbon emission source data without in-depth consideration of data security and accuracy. In the process of data transmission and storage, no effective encryption protection measures are taken for carbon data, which is prone to data leakage and tampering risks, and the legitimacy and integrity of the data source are difficult to guarantee. In addition, there is a lack of intelligent and automated analysis methods for the collected carbon data, and most of them rely on manual or simple statistical methods. It is difficult to deeply explore the value behind the data, such as carbon emission trends, the relationship with various factors in the production process, etc., and it is also impossible to accurately assess the carbon emission level of enterprises in the industry. Summary of the invention
[0003] In view of this, the embodiments of the present invention provide a blockchain-based carbon data processing method, device, equipment and medium to solve the problems of low data security, lack of effective encryption protection measures and insufficient intelligent automation of analysis methods in the processing of corporate carbon emission data.
[0004] In a first aspect, an embodiment of the present invention provides a carbon data processing method based on blockchain, the method comprising:
[0005] Obtain carbon data collected by IoT devices on corporate carbon emission sources;
[0006] Generate a dynamic key based on the device information of the Internet of Things device and the collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data;
[0007] Sending the encrypted carbon data and the dynamic key to a blockchain node, and verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result;
[0008] If the verification result is that the encrypted carbon data and the dynamic key verification pass, a target smart contract matching the encrypted carbon data is selected based on multiple smart contracts deployed in the blockchain node, and the encrypted carbon data is analyzed using the target smart contract to obtain evaluation information.
[0009] Furthermore, the carbon data collected by the IoT device on the carbon emission sources of the enterprise may be obtained by:
[0010] Obtaining indicator data of key monitoring indicators of the enterprise's carbon emission sources;
[0011] If the indicator data reaches the preset threshold corresponding to the key monitoring indicator, a collection instruction is triggered;
[0012] Based on the collection instruction, the Internet of Things device is controlled to collect the carbon emission sources of the enterprise to obtain collection data of multiple different dimensions;
[0013] The carbon data is obtained by performing calculations based on collected data of multiple different dimensions.
[0014] Furthermore, the generating of a dynamic key based on the device information of the IoT device and the collection parameters corresponding to the carbon data includes:
[0015] Obtain the device model and device type of the IoT device;
[0016] Obtaining the collection timestamp and data type corresponding to the carbon data;
[0017] The dynamic key is generated based on the device model, the device type, the acquisition timestamp, and the data type.
[0018] Further, the generating the dynamic key based on the device model, the device type, the acquisition timestamp and the data type includes:
[0019] Obtaining a code mapping table, wherein the code mapping table includes digital codes corresponding to a preset device model, a preset device type, and a preset data type;
[0020] Acquire from the code mapping table a first digital code corresponding to the device model, a second digital code corresponding to the device type, and a third digital code corresponding to the data type;
[0021] Using the first digital code, the second digital code, the third digital code and the timestamp to concatenate, an initial data sequence is obtained;
[0022] Using a hash algorithm to operate the initial data sequence to obtain a hash code, and extracting a code of a preset length from the hash code as an initial dynamic key;
[0023] Part of the code in the initial dynamic key is transformed to obtain the dynamic key.
[0024] Further, the transforming of a part of the code in the initial dynamic key to obtain the dynamic key includes:
[0025] Divide the initial dynamic key into multiple coding groups, and obtain the algorithm corresponding to each coding group;
[0026] Using the algorithm to replace characters in the corresponding coding group, or using the algorithm to shift characters in the corresponding coding group to obtain an adjusted coding group;
[0027] The adjusted code group is reorganized to obtain the dynamic key.
[0028] Furthermore, the encrypted carbon data and the dynamic key are verified by the blockchain node to obtain a verification result, including:
[0029] Using a preset verification mechanism to extract the data source corresponding to the encrypted carbon data and the relevant characteristic information in the dynamic key;
[0030] According to the preset consensus algorithm and the preset contract, query the authorized device list existing on the blockchain node, and if the IoT device corresponding to the data source belongs to the authorized device list, use the key generation algorithm stored in the blockchain node and the historical key;
[0031] Using the key generation algorithm and the historical key to verify whether the generation logic of the dynamic key is correct;
[0032] If the generation logic of the dynamic key is correct, the encrypted carbon data is decrypted to obtain the carbon data;
[0033] The carbon data is verified based on the data specification on the blockchain node to obtain the verification result.
[0034] Furthermore, the encrypted carbon data is analyzed by using the target smart contract to obtain evaluation information, including:
[0035] Extracting a data extraction strategy and a data analysis strategy from the target smart contract;
[0036] extracting key data elements from the carbon data obtained by encrypting the encrypted carbon data according to the data extraction strategy;
[0037] Comparing the key data element with different types of data values to obtain a comparison result;
[0038] Analyze the key data elements according to the data analysis strategy to obtain process parameters and correlation parameters;
[0039] The evaluation information is generated based on the comparison result, the process line parameter and the relevance parameter.
[0040] In a second aspect, an embodiment of the present invention provides a carbon data processing device based on blockchain, the device comprising:
[0041] An acquisition module is used to obtain carbon data collected by IoT devices on carbon emission sources of enterprises;
[0042] A generation module, used to generate a dynamic key based on device information of the Internet of Things device and collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data;
[0043] A sending module, used for sending the encrypted carbon data and the dynamic key to a blockchain node, and verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result;
[0044] An analysis module is used to select a target smart contract that matches the encrypted carbon data based on multiple smart contracts deployed in the blockchain node if the verification result is encrypted carbon data and the dynamic key verification passes, and use the target smart contract to analyze the encrypted carbon data to obtain evaluation information.
[0045] In a third aspect, an embodiment of the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0046] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0047] The embodiment of the present application first generates a dynamic key based on the device information of the IoT device and the collection parameters corresponding to the carbon data after obtaining the carbon data collected by the IoT device, and then uses the dynamic key to encrypt the carbon data to obtain encrypted carbon data. This process provides a strong encryption protection measure for the data, so that the carbon data has high confidentiality and integrity during transmission and storage, and effectively solves the problems of low data security and lack of effective encryption protection measures. Then, the encrypted carbon data and the dynamic key are sent to the blockchain node for verification, and the verification mechanism of the blockchain node is used to ensure that the data source is legal and the key generation logic is correct, further ensuring the security and reliability of the data. When the verification result is passed, based on the multiple smart contracts deployed in the blockchain node, the target smart contract matching the encrypted carbon data is selected according to the characteristics of the encrypted carbon data, and then the encrypted carbon data is analyzed using the target smart contract, realizing the intelligence and automation of the analysis means, and being able to deeply explore the value behind the data, such as carbon emission trends, and the correlation with various factors in the production process, so as to accurately evaluate the carbon emission level of the enterprise in the industry, making up for the lack of intelligence and automation of traditional analysis means. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 is a flowchart of a blockchain-based carbon data processing method according to some embodiments of the present invention;
[0050] Figure 2 is a flowchart of another blockchain-based carbon data processing method according to some embodiments of the present invention;
[0051] Figure 3 is a flowchart of another blockchain-based carbon data processing method according to some embodiments of the present invention;
[0052] Figure 4 is a flowchart of another blockchain-based carbon data processing method according to some embodiments of the present invention;
[0053] Figure 5 is a flowchart of another blockchain-based carbon data processing method according to some embodiments of the present invention;
[0054] Figure 6 is a structural block diagram of a carbon data processing device based on blockchain according to an embodiment of the present invention;
[0055] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0057] According to an embodiment of the present invention, a blockchain-based carbon data processing method, device, equipment and medium are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0058] In this embodiment, a carbon data processing method based on blockchain is provided. Figure 1 is a flowchart of a carbon data processing method based on blockchain according to an embodiment of the present invention, such as Figure 1 As shown, the process includes the following steps:
[0059] Step S101, obtaining carbon data collected by IoT devices on the carbon emission sources of the enterprise.
[0060] In the embodiment of the present application, carbon data collected by the IoT device on the carbon emission sources of the enterprise is obtained, such as Figure 2 As shown, the following steps A1-A4 are included:
[0061] Step A1, obtaining indicator data of key monitoring indicators of the enterprise's carbon emission sources.
[0062] Specifically, enterprises should identify factors that play a key role in carbon emissions based on their own production processes, energy usage types, industry characteristics, and other factors, and thus determine key monitoring indicators. For example, for a chemical company, key monitoring indicators include raw material consumption, energy consumption (such as electricity, natural gas, etc.), operating time and power of production equipment, conversion rate of specific chemical reactions, etc.; for manufacturing companies, key monitoring indicators may include raw material processing volume, equipment operating rate, energy consumption, etc. These indicators will serve as the focus of subsequent monitoring and data collection.
[0063] According to the determined key monitoring indicators, corresponding monitoring equipment and monitoring systems are deployed in various links related to the enterprise's carbon emission sources. For example, for energy consumption indicators, smart electricity meters, gas meters and other devices that can record energy usage in real time are installed, and the data is transmitted to a unified monitoring system through a network connection; for the operating parameters of production equipment, sensors such as temperature sensors, pressure sensors, speed sensors, etc. are installed on the equipment to collect the operating status data of the equipment, and these data are also transmitted to the monitoring system.
[0064] The monitoring equipment and system continuously collect data at a set frequency (such as every hour, every day, etc.), and transmit the collected raw data about each key monitoring indicator to the data processing center or server. In the data processing center, the raw data from different monitoring equipment and systems are integrated, and duplicate, erroneous or incomplete data are removed to ensure the accuracy and completeness of the data, so as to obtain the indicator data of the key monitoring indicators.
[0065] Step A2: If the indicator data reaches the preset threshold corresponding to the key monitoring indicator, the collection instruction is triggered.
[0066] Specifically, for each key monitoring indicator, the enterprise sets a reasonable preset threshold value based on its own carbon emission target, production plan and past historical data. For example, for energy consumption indicators, if the enterprise plans to control monthly electricity consumption within a certain range, then the corresponding preset threshold value for electricity consumption is set according to this target; for raw material consumption indicators, combined with factors such as product output and raw material utilization, preset threshold values for raw material consumption at different production stages are set. These thresholds will serve as the basis for determining whether it is necessary to further collect detailed carbon data.
[0067] In the data processing center, the indicator data of the key monitoring indicators collected in real time are compared with the corresponding preset thresholds. By writing a data comparison program or using data analysis software, the current data and preset thresholds of each key monitoring indicator are checked one by one. For example, when the power consumption data of a workshop collected in real time is compared with the preset power consumption threshold, if it is found that the current power consumption data has reached or exceeded the preset threshold, it means that there is an abnormal carbon emission situation, and further detailed data needs to be collected for analysis.
[0068] Once the data of a key monitoring indicator reaches the corresponding preset threshold, the control system of the data processing center will automatically trigger the collection instruction. This trigger mechanism can be implemented through software programming, such as setting a conditional judgment statement in the data comparison program. When the threshold condition is met, a collection instruction signal is sent to the module responsible for controlling the IoT device to notify it to prepare for the next step of detailed carbon data collection operation.
[0069] Step A3, based on the collection instructions, control the IoT device to collect the carbon emission sources of the enterprise to obtain collection data in multiple different dimensions.
[0070] Specifically, after receiving the collection instruction, we must first ensure that the IoT device is in normal working condition. For IoT devices that have been deployed in various links of the enterprise's carbon emission sources, such as various sensors and data collectors, we will check the device status, including the power of the device, network connection, sensor sensitivity, etc. If the device is found to have a fault or abnormality, we will repair or replace it in time to ensure that the device can accurately collect data.
[0071] According to the requirements of the collection instructions and the specific situation of the enterprise's carbon emission sources, set the collection parameters of the IoT equipment. For example, for sensor equipment, set the collection frequency (such as once a minute), collection accuracy (such as how many decimal places after the decimal point), collection range (such as how many degrees Celsius the temperature sensor's collection range is); for data collectors, set the data storage format, transmission protocol and other parameters. These collection parameters will determine the quality and type of the collected data.
[0072] According to the set collection parameters, the IoT device begins to collect data on the carbon emission sources of the enterprise. The data is collected from multiple different dimensions. For example, from the time dimension, the carbon emission source data of different time periods is continuously collected; from the spatial dimension, the carbon emission source data of different production workshops, different equipment, and different regions is collected; from the data type dimension, various types of data including temperature, pressure, flow, energy consumption, etc. are collected. Through this multi-dimensional collection method, the relevant data of the enterprise's carbon emission sources can be obtained comprehensively and meticulously, and the collected data of multiple different dimensions can be obtained.
[0073] Step A4, performing calculations based on the collected data in multiple different dimensions to obtain carbon data.
[0074] Specifically, the collected data of multiple different dimensions are first preprocessed. This includes cleaning the data to remove noise, erroneous data, and duplicate data; standardizing the data so that data from different sources and formats can be compared and calculated on the same scale. For example, for temperature data, if the collected temperature units are Celsius and Fahrenheit, they need to be uniformly converted to Celsius; for energy consumption data, if some data are in kilowatts and some are in megawatts, they need to be uniformly converted to the same unit.
[0075] According to the company's production process, energy use, and relevant theories and research results on carbon emissions, a carbon data calculation model suitable for the company can be established. This calculation model can be based on physical and chemical principles or statistical analysis methods. For example, for companies that use fossil fuels as their main energy source, a calculation model based on physical and chemical principles can be established based on factors such as the type of fuel, combustion efficiency, and carbon dioxide emissions generated; for complex production processes, a calculation model based on statistical analysis methods is needed. By analyzing a large amount of historical data, the relationship between different production links, different data types and carbon emissions can be found, and a calculation model can be established.
[0076] Substitute the pre-processed collected data of multiple different dimensions into the established calculation model for calculation. Calculate the data one by one according to the calculation method and formula specified in the calculation model. For example, in the calculation model based on physical and chemical principles, the carbon dioxide emissions generated are calculated according to the type of fuel, combustion efficiency and collected energy consumption data; in the calculation model based on statistical analysis methods, the overall carbon emissions of the enterprise are calculated according to the various data collected from different production links and the relationship established by historical data. In this way, calculations are performed based on collected data of multiple different dimensions, and finally carbon data is obtained.
[0077] Step S102: Generate a dynamic key based on the device information of the IoT device and the collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data.
[0078] In the embodiment of the present application, a dynamic key is generated based on the device information of the IoT device and the collection parameters corresponding to the carbon data, such as Figure 3 As shown, the following steps B1-B3 are included:
[0079] Step B1, obtaining the device model and device type of the IoT device.
[0080] Specifically, first, a detailed device information database is established in the enterprise's IoT device management system. This database requires the entry of relevant information for each IoT device when the device is initially connected to the network or deployed. For the device model, it is a specific identifier assigned by the device manufacturer to distinguish different versions or specifications of the same type of devices. During the device access process, the device model is accurately extracted through the identification information carried by the device itself or the content clearly recorded in the configuration file, and stored in the corresponding device record in the device information database. The device type is classified according to the functions and characteristics of the device in carbon emission monitoring and data collection. For example, it can be divided into sensor types (such as temperature sensors, pressure sensors, etc. for collecting various environmental data), data collectors (responsible for collecting and summarizing data from multiple sensors), controllers (used to control and adjust the operating status of other devices, indirectly affecting carbon emissions), etc. When deploying the device, the staff will clarify the device type based on the actual purpose and function of the device, and also enter it into the record related to the device in the device information database. In this way, when you need to obtain the device model and device type of an IoT device, you only need to query the established device information database according to the device's unique identifier (such as the device's MAC address, etc.) to quickly and accurately extract the device model and device type information of the corresponding device.
[0081] Step B2, obtaining the collection timestamp and data type corresponding to the carbon data.
[0082] Specifically, in the carbon emission data collection system of an enterprise, each collected carbon data will be assigned a collection timestamp. This collection timestamp is usually automatically generated by the data collection device or collection software at the moment of collection. It accurately records the specific time point of carbon data collection and can be in a common time format. When it is necessary to obtain the collection timestamp corresponding to the carbon data, the corresponding timestamp field can be directly found from the database table structure storing the carbon data, and the accurate collection timestamp corresponding to each piece of carbon data can be extracted from it. As for the data type, when the enterprise sets the key monitoring indicators of carbon emission sources and deploys relevant collection equipment, the data types collected by different collection equipment have been clarified. For example, some equipment collects temperature data, and its data type is "temperature"; some collect energy consumption data, and the data type is "energy consumption", etc. In the process of carbon data storage, a special data type field will also be set in the database table structure to record the specific data type of each piece of carbon data. Therefore, to obtain the data type corresponding to the carbon data, it is only necessary to query the corresponding data set from the database storing the carbon data according to the index or unique identifier of the data record, and then extract the accurate data type information from the data type field.
[0083] Step B3, generating a dynamic key based on the device model, device type, acquisition timestamp and data type.
[0084] Specifically, a dynamic key is generated based on the device model, device type, collection timestamp and data type, including: obtaining a code mapping table, wherein the code mapping table includes digital codes corresponding to a preset device model, a preset device type and a preset data type; obtaining a first digital code corresponding to the device model, a second digital code corresponding to the device type and a third digital code corresponding to the data type from the code mapping table; concatenating the first digital code, the second digital code, the third digital code and the timestamp to obtain an initial data sequence; operating the initial data sequence using a hash algorithm to obtain a hash code, and intercepting a code of a preset length from the hash code as an initial dynamic key; transforming part of the code in the initial dynamic key to obtain a dynamic key.
[0085] It should be noted that by obtaining the device model, device type, and collection timestamp and data type of the IoT device and generating dynamic keys, the encryption of carbon data is highly targeted and dynamic. The coding mapping table is used to assign digital codes to different device models, types, and data types, so that all kinds of information can participate in key generation in a standardized and digital form, which is not only convenient for unified management and processing, but also ensures that each device and corresponding data has a unique identifier for key construction. After splicing these codes and the collection timestamp into the initial data sequence, the hash code is obtained by hash algorithm operation and the preset length is intercepted as the initial dynamic key, which makes full use of the one-way and anti-collision characteristics of the hash algorithm to ensure the security and uniqueness of the key. The final dynamic key is obtained by transforming part of the code in the initial dynamic key, which further increases the complexity and randomness of the key, greatly improves the confidentiality and integrity of carbon data during transmission and storage, effectively prevents risks such as data leakage and tampering, and provides reliable protection for the safe processing of corporate carbon emission data.
[0086] Specifically, enterprises or relevant technical teams need to prepare a coding mapping table in advance based on the characteristics of IoT devices and carbon emission data involved in their business. The purpose of this table is to uniformly digitally encode different device models, device types and data types for subsequent standardized processing and calculation.
[0087] When constructing the coding mapping table, for the preset device models, the specific models of various IoT devices used by the enterprise should be listed one by one, such as device model A, device model B, etc., and then a unique digital code should be assigned to each device model, such as device model A corresponds to digital code 1001, device model B corresponds to 1002, etc. These codes can be assigned according to certain rules, such as the order of device launch, functional characteristics, etc., but it is necessary to ensure that each model has and only has one corresponding digital code to avoid confusion. Similarly, for the preset device types, according to the functional classification of the device in the entire carbon emission monitoring and data collection system, such as sensor type, data collector type, controller type, etc., each type of device is assigned a specific digital code. For example, the unified code of sensor type devices is 2001, the data collector type is 2002, the controller type is 2003, etc. For the preset data types, considering that the collected carbon data contains multiple types, such as temperature data, flow data, energy consumption data, etc., the corresponding digital code is also set for each data type. For example, the temperature data is coded as 3001, the flow data is coded as 3002, and the energy consumption data is coded as 3003, etc. Through such detailed coding settings, the construction of the coding mapping table is completed, which will serve as an important basis for subsequent data processing.
[0088] When a dynamic key needs to be generated, the device model, device type and data type of the currently involved IoT device and carbon data are determined, and their corresponding digital codes are obtained from the constructed coding mapping table.
[0089] Specifically, by querying the code mapping table, find the entry that fully matches the current device model and extract the corresponding first digital code. For example, if the current device model is the device model A mentioned above, then obtain its corresponding digital code 1001 from the code mapping table as the first digital code. Then, according to the same query method, find the record that matches the current device type from the code mapping table and obtain its corresponding second digital code. For example, if the current device type is a sensor type, then obtain its corresponding code 2001 as the second digital code. Finally, according to the data type of the collected carbon data, search and obtain the corresponding third digital code in the code mapping table again. Assuming that temperature data is collected, obtain 3001 as the third digital code from the code mapping table.
[0090] After obtaining the first digital code corresponding to the device model, the second digital code corresponding to the device type, and the third digital code corresponding to the data type, the next step is to concatenate these codes with the timestamp when the carbon data was collected to form an initial data sequence. The collection timestamp is usually in the form of a number or string representing a specific time point. Assume that the collection timestamp is expressed in seconds as 1698573000 (for example only). Concatenate the first digital code, the second digital code, the third digital code, and the collection timestamp in a certain order. For example, they can be arranged in the order of device model code, device type code, data type code, and collection timestamp to form an initial data sequence similar to [1001, 2001, 3001, 1698573000]. This initial data sequence will be used as input data for subsequent hash operations.
[0091] Select a hash algorithm such as SHA-256 (Secure Hash Algorithm 256-bit). The hash algorithm has the characteristics of one-way and collision resistance, and can convert the input data into a hash value of fixed length. Take the initial data sequence spliced previously as input and use the selected hash algorithm for operation. For example, after using SHA-256 to perform a hash operation on [1001, 2001, 3001, 1698573000], a 256-bit hash code will be obtained. Then, according to the requirements of the key length in the actual application scenario and the subsequent encryption operations, system compatibility and other factors, predetermine the length of the hash code to be intercepted as the length of the initial dynamic key. For example, considering the adaptability of the encryption algorithm to the key length and the efficiency of data transmission and storage, set the interception of 128 bits as the length of the initial dynamic key. Once the preset length is determined, the corresponding length of the code segment is intercepted from the generated hash code according to specific rules as the initial dynamic key.
[0092] Finally, the initial dynamic key is divided into multiple coding groups, and the algorithm corresponding to each coding group is obtained; the algorithm is used to replace the characters in the corresponding coding group, or the algorithm is used to shift the characters in the corresponding coding group to obtain the adjusted coding group; the adjusted coding group is reorganized to obtain the dynamic key.
[0093] Specifically, first, the initial dynamic key is split according to a pre-set rule. This rule can be determined based on factors such as the length of the key, the data type, or a specific encoding mode. For example, if the initial dynamic key is a 128-bit string (for the sake of convenience, it is assumed to be expressed in hexadecimal, such as: 3A5B7C9D1E2F4A6B8C9D0E1F2A3B4C5D6E7F8A9B), it can be split into groups of 16 bits, so that 8 encoding groups will be obtained, namely: [3A5B7C9D1E2F4A6B], [8C9D0E1F2A3B4C5D], [6E7F8A9B] (only the first 3 are shown here, and the complete segmentation should be 8), etc.
[0094] Next, the corresponding algorithm needs to be determined for each segmented code group. This is achieved based on a pre-designed algorithm mapping mechanism. This mechanism can associate code groups and algorithms based on a variety of factors, such as the position of the code group in the key, the data characteristics contained in the code group, or specific rules related to the system.
[0095] For example, for the first code group [3A5B7C9D1E2F4A6B], according to the algorithm mapping mechanism, it is determined that the corresponding algorithm is a character replacement algorithm based on XOR operation. For the second code group [8C9D0E1F2A3B4C5D], the corresponding algorithm is based on cyclic shift. This algorithm allocation method is to make the final generated dynamic key have higher randomness and security, and the codes of different parts are processed through different transformation methods.
[0096] Processing based on character replacement algorithm (taking XOR operation as an example): For those coding groups that determine the use of character replacement algorithm, such as the case based on XOR operation mentioned above, suppose there is a coding group [3A5B7C9D1E2F4A6B] and a predetermined XOR key (also in hexadecimal form, such as: 123456789ABCDEF0).
[0097] Perform an XOR operation on each character in the code group (each hexadecimal digit) and the corresponding character in the XOR key. Take the first character "3" in the code group as an example, and perform an XOR operation with the first character "1" in the XOR key: 3XOR 1=2 (hexadecimal operation). In the same way, perform XOR operations on other characters in the code group in turn to obtain the replaced code group. Assume that the new code group obtained after the complete operation is [28692A050F0B5A7B] (this is only an example result, the actual operation depends on the specific data).
[0098] Processing based on character shift algorithm (taking circular shift as an example): For the code group that determines to use the character shift algorithm, such as the previously mentioned code group based on circular shift [8C9D0E1F2A3B4C5D]. Assume that the set circular shift rule is to circularly shift 3 positions to the left. Then, the first character "8" in the code group is circularly shifted 3 positions to the left to become "C" (in the hexadecimal circular order), and the second character "C" is circularly shifted 3 positions to the left to become "F", and so on. All characters in the code group are processed according to the set circular shift rule to obtain the adjusted code group. Assume that the new code group obtained after the complete operation is [CFD03E4F5A6B7C8D] (this is only an example result, and the actual operation depends on the specific data).
[0099] After the corresponding algorithm processing is performed on each coding group to obtain the adjusted coding group, it is necessary to reorganize these adjusted coding groups in a certain order to form the final dynamic key. This reorganization order can be based on the original order of the coding groups in the initial dynamic key, or it can be determined according to other specific rules. For example, if the initial segmentation is to split each coding group in order from left to right, then the adjusted coding groups can also be spliced in order from left to right during the reorganization.
[0100] Assume that after the previous processing, 8 adjusted coding groups are obtained (in order to simplify the explanation, different coding groups are represented by symbols only, such as: coding group 1 is [28692A050F0B5A7B], coding group 2 is [CFD03E4F5A6B7C8D], etc.), and these coding groups are spliced together in sequence according to the determined reorganization order (here it is assumed to be the original order) to obtain the final dynamic key.
[0101] For example, the dynamic key obtained by sequentially splicing code group 1, code group 2, etc. is: 28692A050F0B5A7BCFD03E4F5A6B7C8D... (Other code groups that are subsequently spliced are omitted here, and all adjusted code groups should actually be fully spliced). Through such a reorganization operation, the final dynamic key is generated from the transformed code group. Compared with the initial dynamic key, the dynamic key has higher randomness and security, and can be used for subsequent encryption, decryption and other related operations.
[0102] It should be noted that dividing the initial dynamic key into multiple coding groups and determining the algorithms corresponding to each coding group increases the complexity and diversity of key generation. By using different algorithms to replace or shift the characters in the corresponding coding group to obtain the adjusted coding group, it not only effectively disrupts the original order and meaning of the characters, but also further blurs the original form of the key, greatly improving the confidentiality and security of the key. Finally, the adjusted coding group is reorganized to obtain the final dynamic key, which combines the transformation effects of the previous links, so that the generated dynamic key has a high degree of randomness and complexity, so that in the transmission and storage of carbon data, it can effectively prevent the data from being illegally obtained, tampered with or leaked, and effectively protect the security of corporate carbon emission data.
[0103] Step S103, sending the encrypted carbon data and the dynamic key to the blockchain node, and verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result.
[0104] In the embodiment of the present application, the encrypted carbon data and the dynamic key are verified by the blockchain node to obtain a verification result, such as Figure 4 As shown, the following steps C1-C5 are included:
[0105] Step C1, using a preset verification mechanism to extract the data source corresponding to the encrypted carbon data and the relevant characteristic information in the dynamic key.
[0106] Specifically, encrypted carbon data usually embeds some identification information during the generation process to indicate the source of the data. The preset verification mechanism will first identify the storage location and format of this identification information. For example, the header or specific field of the encrypted carbon data contains the unique identifier of the IoT device (such as MAC address, device number, etc.) and the relevant environmental information for collecting the data (such as the collection location, workshop, etc.). Through a specific decoding or parsing program, these key information that can clarify the source of the data are extracted from the encrypted data according to pre-set rules.
[0107] For dynamic keys, there is also some relevant characteristic information that can be used for verification. This information includes the hash values of some key parameters based on the key generation process, the length characteristics of the key, the characters or character combination rules at specific positions, etc. The preset verification mechanism will use the corresponding analysis tools and algorithms to analyze the dynamic key and extract the information that can reflect its generation characteristics. For example, if the dynamic key is generated by the device model, type, collection timestamp and data type, the verification mechanism will extract some coding features or hash features related to these parameters for subsequent comparison and verification with the records in the blockchain node.
[0108] Step C2, according to the preset consensus algorithm and the preset contract, query the existing authorized device list on the blockchain node. If the IoT device corresponding to the data source belongs to the authorized device list, use the key generation algorithm and historical key stored in the blockchain node.
[0109] Specifically, the preset consensus algorithm and preset contract stipulate various rules and operation procedures in the blockchain network. During the verification process, firstly, according to these rules, through the query interface provided by the blockchain node, the records matching the data source information extracted from the encrypted carbon data are searched in the existing authorized device list stored on the blockchain. This authorized device list is strictly reviewed and managed, and contains detailed information on the IoT devices that the enterprise allows to access and provide valid carbon data, such as device model, number, department, etc.
[0110] If the query result shows that the IoT device corresponding to the data source belongs to the authorized device list, it means that the device is qualified to provide legal carbon data. At this point, the relevant resources stored in the blockchain node can be further used for subsequent verification. Among them, the key generation algorithm stored in the blockchain node is a standard algorithm for generating dynamic keys, and its parameters and rules are fixed and known. The historical key is a record of valid dynamic keys generated in similar situations in the past. These records can be used as a reference to verify the rationality of the current dynamic key.
[0111] Step C3: Use the key generation algorithm and the historical key to verify whether the generation logic of the dynamic key is correct.
[0112] Specifically, the key generation algorithm obtained from the blockchain node is the core basis for verifying the dynamic key generation logic. The relevant feature information in the extracted dynamic key (such as that extracted in the previous step C1) is compared with the features that a virtual dynamic key should have when regenerating it according to the key generation algorithm. For example, if the key generation algorithm stipulates that the dynamic key is generated by performing a hash operation in a specific order according to the device model, device type, acquisition timestamp and data type, then in the same way, use these parameters extracted from the encrypted carbon data and the dynamic key to regenerate a temporary dynamic key through the algorithm, and compare its features one by one with the features of the actual dynamic key provided to check whether there are any differences, such as whether the hash values are consistent, whether the key parameter encodings are consistent, etc.
[0113] The historical key records the valid dynamic keys generated in the past under normal circumstances. By analyzing the similarities and differences between the current dynamic key and the historical key, we can further determine whether the generation logic is reasonable. For example, observe whether the length and character distribution pattern of the current dynamic key are consistent with the performance of the historical key under similar circumstances. If there are large differences and they cannot be reconciled by reasonable explanations, it indicates that there is a problem with the generation logic of the dynamic key.
[0114] Step C4: if the generation logic of the dynamic key is correct, the encrypted carbon data is decrypted to obtain the carbon data.
[0115] Specifically, after verification, it is determined that the generation logic of the dynamic key is correct, which means that the currently received encrypted carbon data and the dynamic key are matched and valid. This meets the basic conditions for decrypting the encrypted carbon data, because only the correctly generated dynamic key can accurately decrypt the encrypted carbon data.
[0116] Use the decryption algorithm corresponding to the encryption algorithm (usually in pairs with the encryption algorithm, such as the AES encryption algorithm in the symmetric encryption algorithm corresponds to the AES decryption algorithm), and use the correct dynamic key as the input parameter to decrypt the encrypted carbon data. The decryption algorithm will reverse the encrypted carbon data according to its internal mathematical operation rules and gradually restore the original carbon data. For example, if the encryption is performed by performing a specific transformation operation on the binary bits of the carbon data (such as XOR operation, shift operation, etc.), then the decryption will follow the opposite transformation rules and use the dynamic key to restore the encrypted carbon data to its original unencrypted state, thereby obtaining the carbon data.
[0117] Step C5, verify the carbon data based on the data specification on the blockchain node to obtain the verification result.
[0118] Specifically, the data specifications on the blockchain nodes are a set of pre-established standards for carbon data formats, value ranges, data integrity, etc. These specifications include what the units of carbon data should be (such as tons of carbon dioxide equivalent), whether the value ranges of different types of carbon data (such as direct carbon emissions, indirect carbon emissions, etc.) are reasonable (for example, the direct carbon emissions of a certain type of production link should not exceed a certain value), whether the data is complete (whether all necessary fields and information are included), etc.
[0119] Compare the decrypted carbon data with the data specifications on the blockchain node one by one. Check whether the unit of the carbon data meets the specification requirements, whether the value range is within a reasonable range, and whether it has complete information. For example, if the data specification stipulates that the unit of carbon data related to energy consumption in a certain production link is "tons of carbon dioxide equivalent / hour", then check whether the unit of the carbon data of that link obtained by decryption is consistent with it. If the data specification sets the value range of a certain type of carbon data between [0,100], check whether the value of the decrypted carbon data of this type is within this range. At the same time, check whether the carbon data contains necessary information such as collection time and data source.
[0120] Based on the above comparison results, the verification result is generated. If the carbon data conforms to the data specifications on the blockchain node in terms of format, value range, data integrity, etc., the verification result is "passed"; otherwise, if there is any non-compliance with the specifications, the verification result is "failed". This verification result will serve as an important basis for further processing of carbon data (such as using smart contract analysis, etc.).
[0121] Step S104: If the verification result is that the encrypted carbon data and the dynamic key verification are passed, a target smart contract matching the encrypted carbon data is selected based on multiple smart contracts deployed in the blockchain node, and the encrypted carbon data is analyzed using the target smart contract to obtain evaluation information.
[0122] In an embodiment of the present application, when the verification results show that the encrypted carbon data and the dynamic key have been verified, the next step is to select a target smart contract that matches the encrypted carbon data from the multiple smart contracts deployed in the blockchain node. First, the encrypted carbon data will be analyzed in detail to clarify the various key information it contains, such as data source, data type (carbon emission data generated by energy consumption, or carbon emission data for a specific link in the production process, etc.), collection timestamp, etc. Then, check the applicable conditions and rules set by each smart contract deployed in the blockchain node one by one. These smart contracts are given specific functions and processing logic for different situations when they are created. For example, some smart contracts may be specifically used to analyze carbon emission data generated by a certain type of specific production equipment. Its applicable conditions will clearly stipulate that the data type must be carbon emission data related to the equipment and the collection time must be within a specific time period. By carefully comparing the key information of the encrypted carbon data with the applicable conditions of each smart contract, we can find the smart contract that best matches the data type, collection time, data source, etc., and identify it as the target smart contract that matches the encrypted carbon data, so that we can use it to conduct more targeted analysis and processing of the encrypted carbon data in the future.
[0123] In the embodiment of the present application, the encrypted carbon data is analyzed using the target smart contract to obtain evaluation information, such as Figure 5 As shown, the following steps D1-D5 are included:
[0124] Step D1, extracting data extraction strategy and data analysis strategy from the target smart contract.
[0125] Specifically, the target smart contract is a program code deployed in the blockchain node specifically for processing encrypted carbon data, which contains a series of predefined rules and operation logic. Smart contracts are usually written in a certain programming language (such as Solidity and other programming languages suitable for blockchain), and their code structure is organized into different functions, variables, conditional statements and other parts.
[0126] In the code of the smart contract, it is clearly specified how to extract useful information from the received encrypted carbon data (here refers to the carbon data obtained after decryption in the previous step). This is the data extraction strategy. It involves determining which types of data to extract from which locations according to the specific format of the carbon data (such as a certain field order, data type tag, etc.). For example, if the carbon data is stored in JSON format, the data extraction strategy will specify the extraction of the value under a specific key-value pair as the key data element, such as extracting the value of "carbonEmissionValue" from the "emissionData" key.
[0127] At the same time, the smart contract will also define specific methods for further analysis of the extracted key data elements, namely the data analysis strategy. This includes the use of statistical analysis methods (such as mean, variance calculation, etc.), time series analysis (such as trend analysis, seasonal analysis, etc.) or correlation analysis. For example, the data analysis strategy stipulates that trend analysis should be performed on the extracted carbon emission data of different time periods to observe the changing trend of carbon emissions, or correlation analysis should be performed on carbon emissions and production data to determine the degree of correlation between the two.
[0128] Step D2, extracting key data elements from the carbon data obtained by encrypting the encrypted carbon data according to the data extraction strategy.
[0129] Specifically, first, you need to parse the carbon data according to its actual storage format. If the carbon data is stored in a database table structure, you need to understand the meaning of the fields in the table, the data types, and the relationship between them; if it is in other formats, such as XML or JSON, you also need to be familiar with its syntax structure and data organization. For example, for carbon data in JSON format, you need to know the meaning of each key and the type of the corresponding value.
[0130] According to the data extraction strategy extracted from the target smart contract, specific extraction operations are performed on the parsed carbon data. Assuming that the data extraction strategy stipulates that carbon emission information related to production equipment is to be extracted from the carbon data, then the identification field of the corresponding equipment (such as equipment number) is found from the carbon data, and then the carbon emissions, operating hours and other related data of the equipment in different time periods are extracted as key data elements. For another example, if the strategy requires the extraction of energy consumption data and its corresponding carbon emissions of a specific production link, the records of the relevant links are located from the carbon data, and the energy consumption values and carbon emissions values are extracted as key data elements.
[0131] Step D3, comparing the key data element with different types of data values to obtain a comparison result;
[0132] Specifically, the different types of data values mentioned here usually refer to some pre-set standard values, industry average values, target values set by the enterprise itself, etc. For example, for carbon emission data, there will be industry average carbon emission standard values stipulated by the country or region, and internal carbon emission target values set by the enterprise to achieve emission reduction targets, etc. These different types of data values will be used as references for comparison with key data elements.
[0133] Compare the key data elements extracted from the carbon data with these different types of data values one by one. For example, compare the actual carbon emissions (key data elements) of a production workshop with the industry average carbon emissions standard value to see whether it is higher or lower than the standard value; compare the carbon emissions corresponding to the energy consumption of the enterprise in a certain period of time with the target value set within the enterprise to check whether the target requirements are met. The comparison operation can use different methods according to the type of data and specific requirements, such as simple numerical comparison, percentage calculation, etc.
[0134] Based on the results of the comparison operation, the comparison results are generated. The comparison results can be described in simple words (such as "higher than the industry average", "lower than the enterprise target value", etc.), or expressed in more specific values (such as how many tons the actual carbon emissions are higher than the industry average, etc.). These comparison results will provide an important basis for the subsequent generation of evaluation information.
[0135] Step D4, analyzing the key data elements according to the data analysis strategy to obtain process parameters and correlation parameters.
[0136] Specifically, according to the data analysis strategy extracted from the target smart contract, specific analysis operations are performed on the extracted key data elements. For example, if the data analysis strategy stipulates that time series analysis is to be performed, the carbon emission data in the key data elements are arranged in chronological order, and then the time series analysis method (such as moving average method, exponential smoothing method, etc.) is used to analyze its change trend, and the process parameters of carbon emissions changing over time, such as the growth rate and fluctuation range of carbon emissions, are obtained.
[0137] The data analysis strategy also includes correlation analysis, so the carbon emission data in the key data elements is analyzed for correlation with other related data (such as production volume, energy consumption, etc.). The correlation coefficient (such as the Pearson correlation coefficient, etc.) is calculated to determine the degree of correlation between carbon emissions and other factors, and obtain the correlation parameter. For example, the Pearson correlation coefficient between carbon emissions and production volume is found to be 0.8 through calculation, which indicates that there is a strong correlation between the two. This coefficient is a correlation parameter.
[0138] As an example, (1) analyze process parameters through time series analysis (taking carbon emissions as an example). The trend analysis is as follows:
[0139] If the data has a clear time sequence, you can use the moving average method or exponential smoothing method. For moving average, select an appropriate window size (such as a 5-day moving average) and calculate the moving average at each time point to observe the short-term trend of carbon emissions. For exponential smoothing, determine the smoothing constant (such as α = 0.3), obtain the smoothed carbon emissions sequence, and analyze the long-term trend. You can also fit a trend line, such as using a linear regression model to fit the trend of carbon emissions over time. Assuming time is the independent variable and carbon emissions are the dependent variable, the slope of the fitted straight line equation is the trend parameter of carbon emissions, which represents the rate of change of carbon emissions per unit time.
[0140] The seasonality and cyclicality analysis is as follows:
[0141] Use seasonal decomposition methods (such as those based on additive or multiplicative models) to decompose carbon emissions data into trend, seasonal, and residual parts. For example, if it is found that carbon emissions fluctuate significantly in a specific season of each year (such as the winter heating period), the impact of seasonal factors on carbon emissions can be analyzed. The periodicity of the data is analyzed by the autocorrelation function (ACF) and partial autocorrelation function (PACF). If the ACF has a significant peak at a specific lag order, it may indicate the existence of fluctuations in the corresponding cycle. For example, finding that the ACF has a peak at a lag of 12 months may suggest that there is an annual cycle in carbon emissions.
[0142] The volatility analysis is as follows:
[0143] Calculate statistics such as the standard deviation and coefficient of variation of carbon emissions data. The standard deviation measures the dispersion of data around the mean, and the coefficient of variation (standard deviation divided by the mean) can be used to compare the fluctuations of data of different magnitudes. For example, calculate the standard deviation of carbon emissions for each month to assess the stability of carbon emissions.
[0144] Other process parameter analysis (taking production process related data as an example):
[0145] Equipment operation efficiency analysis: Calculate the equipment's output per unit time, i.e., production efficiency, based on the equipment's operating time and output. For example, if the equipment runs for 500 hours in a month and produces 10,000 pieces, the production efficiency is 20 pieces / hour. Observe the changes in production efficiency over time and analyze the stability and change trend of the equipment's operating status.
[0146] Energy efficiency analysis: Calculate the energy consumption per unit of output, such as electricity consumption per ton of product. If the electricity consumption per unit of output gradually increases over a period of time, it may indicate that the energy efficiency has decreased and further inspection of the equipment or production process is needed.
[0147] (2) Analyze correlation parameters, including correlation analysis, regression analysis, causal analysis, etc.
[0148] The correlation analysis is as follows:
[0149] Calculate the correlation coefficient: Use methods such as the Pearson correlation coefficient and the Spearman rank correlation coefficient to calculate the correlation between key data elements. For example, calculate the Pearson correlation coefficient between carbon emissions and energy consumption (such as electricity consumption). If the correlation coefficient is close to 1, it means that the two are strongly positively correlated, that is, the higher the electricity consumption, the higher the carbon emissions; if it is close to -1, it is a strong negative correlation; close to 0 means that the correlation is weak.
[0150] Draw a correlation matrix or heat map: Display the correlation coefficients between all key data elements in the form of a matrix or heat map to visually observe the relationship between different data elements. For example, you can quickly see the correlation between carbon emissions and multiple factors such as output, energy consumption, and equipment operating parameters.
[0151] The regression analysis is as follows:
[0152] Multiple linear regression (with carbon emissions as dependent variable): If the correlation analysis shows that carbon emissions are related to multiple factors (such as energy consumption, output, and ambient temperature), a multiple linear regression model can be established. For example, assuming that carbon emissions are related to electricity consumption, output, and ambient temperature, a model is established. The regression coefficients are estimated by the least squares method and other methods to analyze the impact of each independent variable on carbon emissions. For example, the impact of changes in unit electricity consumption on carbon emissions is expressed.
[0153] Model evaluation: Use statistical test methods to evaluate the significance and goodness of fit of the regression model. The test is used to test the significance of the entire model, that is, whether the independent variable has a significant impact on the dependent variable; the test is used to test whether the coefficient of each independent variable is significantly different from zero. At the same time, the coefficient of determination can be calculated to indicate the degree of fit of the model to the data. The closer it is to 1, the better the model fit.
[0154] The cause and effect analysis is as follows:
[0155] If the causal relationship between variables needs to be further determined, methods such as Granger causality test can be used. For example, test whether electricity consumption is the Granger cause of carbon emissions, that is, whether past electricity consumption data can help predict carbon emissions. If the test results show that electricity consumption is the Granger cause of carbon emissions, then when formulating emission reduction strategies, we can focus on optimizing the electricity use link.
[0156] Step D5, generating evaluation information based on the comparison result, the process line parameter and the correlation parameter.
[0157] Specifically, the comparison results, process parameters and correlation parameters are integrated. For example, the comparison results of carbon emissions with the industry average, the process parameters of carbon emissions over time (such as growth rate) and the correlation parameters between carbon emissions and production (such as correlation coefficient) are collected together to form a comprehensive data set.
[0158] Based on the integrated data set, evaluation information is generated. The evaluation information may include an overall evaluation of the company's carbon emissions (such as "the company's carbon emissions are at the average level of the industry, but the growth rate is fast and closely related to production output"), a specific evaluation of different production links or equipment (such as "the carbon emissions of a certain production equipment are higher than the industry average and are highly correlated with energy consumption"), and an evaluation of the company's emission reduction potential (such as "based on the current carbon emission trends and related factors, the company has a large emission reduction potential in optimizing the energy structure"). These evaluation information will provide important references for companies to understand their own carbon emissions and formulate emission reduction strategies.
[0159] It should be noted that extracting data extraction strategies and data analysis strategies from the target smart contract makes the entire process standardized and targeted, and the predefined rules of the smart contract ensure the consistency and accuracy of the processing process. Extracting key data elements from encrypted carbon data according to the data extraction strategy can accurately locate data that is valuable for evaluation, avoid interference from irrelevant information, and improve processing efficiency. Comparing key data elements and different types of data values to obtain comparison results can clearly show the difference between the company's carbon emissions and standard values, target values or other reference values, so that the company can clearly understand the position of its own emission level within a specific range. Analyzing key data elements according to the data analysis strategy to obtain process parameters and correlation parameters helps to gain a deep understanding of the dynamic trend of carbon emissions and the inherent connection with other related factors. Finally, based on the comparison results, process parameters and correlation parameters, evaluation information is generated to provide companies with comprehensive, in-depth and valuable carbon emission evaluation content, assisting companies in making accurate decisions, such as formulating emission reduction strategies, optimizing production processes, etc., to better deal with carbon emission-related issues and achieve sustainable development goals.
[0160] The embodiment of the present application first generates a dynamic key based on the device information of the IoT device and the collection parameters corresponding to the carbon data after obtaining the carbon data collected by the IoT device, and then uses the dynamic key to encrypt the carbon data to obtain encrypted carbon data. This process provides a strong encryption protection measure for the data, so that the carbon data has high confidentiality and integrity during transmission and storage, and effectively solves the problems of low data security and lack of effective encryption protection measures. Then, the encrypted carbon data and the dynamic key are sent to the blockchain node for verification, and the verification mechanism of the blockchain node is used to ensure that the data source is legal and the key generation logic is correct, further ensuring the security and reliability of the data. When the verification result is passed, based on the multiple smart contracts deployed in the blockchain node, the target smart contract matching the encrypted carbon data is selected according to the characteristics of the encrypted carbon data, and then the encrypted carbon data is analyzed using the target smart contract, realizing the intelligence and automation of the analysis means, and being able to deeply explore the value behind the data, such as carbon emission trends, and the correlation with various factors in the production process, so as to accurately evaluate the carbon emission level of the enterprise in the industry, making up for the lack of intelligence and automation of traditional analysis means.
[0161] In the embodiment of the present application, the construction process of the blockchain network is as follows: according to the scale of the enterprise, the amount of data processing, and the security requirements for carbon emission data management, appropriate hardware devices are selected as nodes. These devices should have stable network connections, sufficient storage capacity and computing power. At the same time, to determine the geographical distribution of nodes, nodes can be set up in different data centers or key departments within the enterprise to ensure distributed storage and high availability of data.
[0162] After determining the blockchain nodes, the steps to build a blockchain network are as follows: Initialize and configure each node, install blockchain-related software platforms and protocols, such as selecting a suitable blockchain underlying framework (such as Ethereum, Hyperledger, etc.). Generate a unique identity and key pair for each node for communication authentication and permission management between nodes. Establish a network connection between nodes, and enable nodes to communicate with each other by configuring network parameters (such as IP address, port number, etc.). Then, determine the consensus mechanism of the blockchain (such as proof of work, proof of equity, practical Byzantine fault tolerance, etc.), which will determine how nodes reach consensus on new data blocks. Next, create a genesis block to define the initial state of the blockchain, including information such as the initial carbon emission data structure and smart contract template. After that, as the IoT devices collect carbon data, the nodes begin to receive encrypted carbon data and dynamic keys, verify and store the data based on the consensus mechanism, add new data blocks to the blockchain, and gradually build a complete blockchain network, providing a reliable infrastructure for the subsequent processing and analysis of encrypted carbon data.
[0163] In this embodiment, a carbon data processing device based on blockchain is also provided, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also and is conceived.
[0164] This embodiment provides a carbon data processing device based on blockchain, such as Figure 6 As shown, including:
[0165] An acquisition module 601 is used to acquire carbon data collected by an IoT device on carbon emission sources of an enterprise;
[0166] A generation module 602 is used to generate a dynamic key based on the device information of the IoT device and the collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data;
[0167] The sending module 603 is used to send the encrypted carbon data and the dynamic key to the blockchain node, and the encrypted carbon data and the dynamic key are verified by the blockchain node to obtain a verification result;
[0168] The analysis module 604 is used to select a target smart contract that matches the encrypted carbon data based on multiple smart contracts deployed in the blockchain node if the verification result is that the encrypted carbon data and the dynamic key verification are passed, and use the target smart contract to analyze the encrypted carbon data to obtain evaluation information.
[0169] In an embodiment of the present application, an acquisition module 601 is used to obtain indicator data of key monitoring indicators of an enterprise's carbon emission sources; if the indicator data reaches a preset threshold corresponding to the key monitoring indicator, a collection instruction is triggered; based on the collection instruction, the Internet of Things device is controlled to collect data from the enterprise's carbon emission sources to obtain collected data of multiple different dimensions; calculations are performed based on the collected data of multiple different dimensions to obtain carbon data.
[0170] In an embodiment of the present application, generation module 602 is used to obtain the device model and device type of the Internet of Things device; obtain the collection timestamp and data type corresponding to the carbon data; and generate a dynamic key based on the device model, device type, collection timestamp and data type.
[0171] In an embodiment of the present application, a generation module 602 is used to obtain a coding mapping table, wherein the coding mapping table includes digital codes corresponding to a preset device model, a preset device type, and a preset data type, respectively; obtain a first digital code corresponding to the device model, a second digital code corresponding to the device type, and a third digital code corresponding to the data type from the coding mapping table; obtain an initial data sequence by concatenating the first digital code, the second digital code, the third digital code, and a timestamp; operate the initial data sequence using a hash algorithm to obtain a hash code, and extract a code of a preset length from the hash code as an initial dynamic key; transform part of the code in the initial dynamic key to obtain a dynamic key.
[0172] In an embodiment of the present application, generation module 602 is used to divide the initial dynamic key into multiple coding groups and obtain the algorithm corresponding to each coding group; use the algorithm to replace the characters in the corresponding coding group, or use the algorithm to shift the characters in the corresponding coding group to obtain an adjusted coding group; reorganize the adjusted coding group to obtain the dynamic key.
[0173] In an embodiment of the present application, the analysis module 604 is used to extract the data source corresponding to the encrypted carbon data and the relevant characteristic information in the dynamic key by using a preset verification mechanism; according to the preset consensus algorithm and the preset contract, query the existing authorized device list on the blockchain node, if the IoT device corresponding to the data source belongs to the authorized device list, then use the key generation algorithm and the historical key stored in the blockchain node; use the key generation algorithm and the historical key to verify whether the generation logic of the dynamic key is correct; if the generation logic of the dynamic key is correct, then decrypt the encrypted carbon data to obtain the carbon data; verify the carbon data based on the data specification on the blockchain node to obtain a verification result.
[0174] In an embodiment of the present application, the analysis module 604 is used to extract data extraction strategies and data analysis strategies from the target smart contract; extract key data elements from the carbon data obtained by encrypting the encrypted carbon data according to the data extraction strategy; compare the key data elements with different types of data values to obtain comparison results; analyze the key data elements according to the data analysis strategy to obtain procedural parameters and correlation parameters; and generate evaluation information based on the comparison results, procedural parameters and correlation parameters.
[0175] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common motherboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). The processor 10 can be a central processing unit, a network processor or a combination thereof. Among them, the processor 10 can further include a hardware chip. The above-mentioned hardware chip can be a dedicated integrated circuit, a programmable logic device or a combination thereof. The above-mentioned programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a general array logic or any combination thereof.
[0176] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0177] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0178] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0179] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0180] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0181] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A carbon data processing method based on blockchain, characterized in that: The method comprises: Obtain carbon data collected by IoT devices on corporate carbon emission sources; Generate a dynamic key based on the device information of the Internet of Things device and the collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data; Sending the encrypted carbon data and the dynamic key to a blockchain node, and verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result; If the verification result is that the encrypted carbon data and the dynamic key verification pass, a target smart contract matching the encrypted carbon data is selected based on multiple smart contracts deployed in the blockchain node, and the encrypted carbon data is analyzed using the target smart contract to obtain evaluation information.
2. The method according to claim 1, characterized in that The carbon data obtained by collecting carbon emission sources of enterprises through IoT devices includes: Obtaining indicator data of key monitoring indicators of the enterprise's carbon emission sources; If the indicator data reaches the preset threshold corresponding to the key monitoring indicator, a collection instruction is triggered; Based on the collection instruction, the Internet of Things device is controlled to collect the carbon emission sources of the enterprise to obtain collection data of multiple different dimensions; The carbon data is obtained by performing calculations based on collected data of multiple different dimensions.
3. The method according to claim 1, characterized in that The generating of a dynamic key based on the device information of the Internet of Things device and the collection parameters corresponding to the carbon data includes: Obtain the device model and device type of the IoT device; Obtaining a collection timestamp and data type corresponding to the carbon data; The dynamic key is generated based on the device model, the device type, the acquisition timestamp, and the data type.
4. The method according to claim 3, characterized in that The generating the dynamic key based on the device model, the device type, the acquisition timestamp, and the data type includes: Obtain a code mapping table, wherein the code mapping table includes digital codes corresponding to a preset device model, a preset device type, and a preset data type; Acquire from the code mapping table a first digital code corresponding to the device model, a second digital code corresponding to the device type, and a third digital code corresponding to the data type; Using the first digital code, the second digital code, the third digital code and the timestamp to concatenate, an initial data sequence is obtained; Using a hash algorithm to operate the initial data sequence to obtain a hash code, and extracting a code of a preset length from the hash code as an initial dynamic key; Part of the code in the initial dynamic key is transformed to obtain the dynamic key.
5. The method according to claim 4, characterized in that The step of transforming a part of the code in the initial dynamic key to obtain the dynamic key includes: Divide the initial dynamic key into multiple coding groups, and obtain the algorithm corresponding to each coding group; Using the algorithm to replace characters in the corresponding coding group, or using the algorithm to shift characters in the corresponding coding group to obtain an adjusted coding group; The adjusted code group is reorganized to obtain the dynamic key.
6. The method according to claim 1, characterized in that The step of verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result includes: Using a preset verification mechanism to extract the data source corresponding to the encrypted carbon data and the relevant characteristic information in the dynamic key; According to the preset consensus algorithm and the preset contract, query the existing authorized device list on the blockchain node, and if the IoT device corresponding to the data source belongs to the authorized device list, use the key generation algorithm and historical key stored in the blockchain node; Using the key generation algorithm and the historical key to verify whether the generation logic of the dynamic key is correct; If the generation logic of the dynamic key is correct, the encrypted carbon data is decrypted to obtain the carbon data; The carbon data is verified based on the data specification on the blockchain node to obtain the verification result.
7. The method according to claim 1, characterized in that The using of the target smart contract to analyze the encrypted carbon data to obtain evaluation information includes: Extracting a data extraction strategy and a data analysis strategy from the target smart contract; extracting key data elements from the carbon data obtained by encrypting the encrypted carbon data according to the data extraction strategy; Comparing the key data element with different types of data values to obtain a comparison result; Analyze the key data elements according to the data analysis strategy to obtain process parameters and correlation parameters; The evaluation information is generated based on the comparison result, the process line parameter and the relevance parameter.
8. A carbon data processing device based on blockchain, characterized in that: The device comprises: An acquisition module is used to obtain carbon data collected by IoT devices on carbon emission sources of enterprises; A generation module, used to generate a dynamic key based on device information of the Internet of Things device and collection parameters corresponding to the carbon data, and encrypt the carbon data using the dynamic key to obtain encrypted carbon data; A sending module, used for sending the encrypted carbon data and the dynamic key to a blockchain node, and verifying the encrypted carbon data and the dynamic key through the blockchain node to obtain a verification result; An analysis module is used to select a target smart contract that matches the encrypted carbon data based on multiple smart contracts deployed in the blockchain node if the verification result is encrypted carbon data and the dynamic key verification passes, and use the target smart contract to analyze the encrypted carbon data to obtain evaluation information.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-chain intelligent security gateway for application of Internet of Things and implementation method of multi-chain intelligent security gateway
CN112804310A
Coal-fired power plant carbon emission monitoring system and method based on Internet of Things and data double-layer processing technology
CN116760570A
Method and device for monitoring carbon emission based on Internet of Things technology and block chain technology
CN116962461A
Intelligent carbon meter system based on Internet of Things and block chain and used for iron and steel industry
CN117348563A
Supply full data encryption protection carbon asset management method and system based on block chain
CN117436111A
Cited By
Family education behavior evaluation method and system based on block chain technology
CN120744990A