CN116074316A - Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain - Google Patents

Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain Download PDF

Info

Publication number
CN116074316A
CN116074316A CN202310072034.0A CN202310072034A CN116074316A CN 116074316 A CN116074316 A CN 116074316A CN 202310072034 A CN202310072034 A CN 202310072034A CN 116074316 A CN116074316 A CN 116074316A
Authority
CN
China
Prior art keywords
consensus
data
unit
network
computing unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310072034.0A
Other languages
Chinese (zh)
Inventor
李玄阔
李佳
任方明
曹彦格
刘士丰
郭俊涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianrui Group Information Technology Co ltd
Original Assignee
Tianrui Group Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianrui Group Information Technology Co ltd filed Critical Tianrui Group Information Technology Co ltd
Priority to CN202310072034.0A priority Critical patent/CN116074316A/en
Publication of CN116074316A publication Critical patent/CN116074316A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/80Management or planning
    • Y02P90/84Greenhouse gas [GHG] management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Storage Device Security (AREA)

Abstract

A tamper-resistant trusted carbon bank data processing method based on edge calculation and blockchain belongs to the field of data storage, and comprises the following steps of S1: collecting first data of enterprises, and establishing a plurality of intelligent contract groups; step S2: building a first consensus network to carry out consensus on first data to generate a first consensus block, a first node chain and a first verification chain; step S3: a second consensus network is built together, the second consensus network converts the first data into a first result, the first result is subjected to consensus, and a second consensus block, a second node chain and a second verification chain are generated; step S4: reconstructing a second consensus network, and calling intelligent contracts of a second calling sequence in the intelligent contract group to generate a third consensus block, a third node chain and a third verification chain; step S5: all the consensus blocks are sequentially connected to form a carbon emission data block chain; the invention ensures the credibility of the carbon emission data record by constructing consensus, nodes and verification block chains.

Description

Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain
Technical Field
The invention belongs to the field of data storage, and particularly relates to a tamper-resistant trusted carbon bank data processing method based on edge calculation and blockchain.
Background
The blockchain technology is a data storage technology, and the blockchain has the characteristics of decentralization and non-tampering, so that the data stored in the blockchain is quite safe.
Currently, carbon verification of enterprises is mainly carried out in an online and offline combination mode, the process is simply described as that the enterprises report carbon emission data of the previous year autonomously through an environment information platform, the authenticity of the carbon emission data is verified through a carbon verification system, and the verification result is verified through manual verification; however, both the process of checking by the carbon checking system and the process of verifying by manual checking may occur, and after the occurrence of the fraud, it is difficult for the related personnel to check the data, so how to accurately and reliably record the carbon emission data of the enterprise by combining with the blockchain technology is a technical problem to be solved in the current field.
Disclosure of Invention
In order to solve the problems, the invention provides a tamper-proof trusted carbon bank data processing method based on edge calculation and blockchain, which solves the problems in the background technology.
In order to achieve the above-mentioned object, the present invention provides a tamper-resistant trusted carbon black data processing method based on edge computation and blockchain, comprising:
Step S1: the method comprises the steps that a data collection unit collects first data of an enterprise, a contract management unit establishes a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, and the intelligent contract groups are used for converting the first data into second data;
step S2: the data collection unit sends first data to the consensus unit, the consensus unit selects an intelligent contract group based on the data type of the first data and builds a first consensus network, the first consensus network comprises a plurality of edge calculation units, the first consensus network performs consensus on the first data, if the first data passes the consensus, the first consensus network generates a first consensus block, a first node block and a first verification block, the first consensus block comprises consensus information of the first data, the first node block comprises the edge calculation unit information, the first verification block comprises consensus information of the edge calculation unit on the first data, a first node chain is built based on the first node block, and the first verification block builds a first verification chain and is respectively connected with the first consensus block;
step S3: the second consensus network comprises a plurality of edge computing units, the contract management unit sends intelligent contracts of a first calling sequence in an intelligent contract group to the second consensus network, each edge computing unit in the second consensus network converts first data into a first result based on the intelligent contracts, the second consensus network performs consensus on the first result, if the first result passes through the consensus, the second consensus network generates a second consensus block, a second node block and a second verification block, the second consensus block comprises consensus information on the first result, the second node block comprises the edge computing unit information, the second verification block comprises consensus information on the first result by the edge computing unit, a second node chain is built based on the second node block, and the second verification block is connected with the second consensus block respectively;
Step S4: the consensus unit rebuilds the second consensus network, calls intelligent contracts of a second calling sequence in the intelligent contract group, generates a third consensus block, a third node chain and a third verification chain based on the step S3, and after the third node chain and the third verification chain are respectively connected with the third consensus block, the consensus unit continues to rebuild the second consensus network until the calling of all intelligent contracts in the intelligent contract group is completed;
step S5: the consensus unit stops building the consensus network, connects all the consensus blocks in turn based on the generation order, and builds the carbon emission data block chain.
Further, the consensus unit builds a consensus network comprising the steps of:
acquiring the number of all edge computing units in a current network, randomly extracting a first number of edge computing units in an idle state to form a consensus network when the consensus units need to form the consensus network, wherein each edge computing unit can only be positioned in one consensus network at the same time, and extracting the edge computing unit with the smallest current residual task amount to participate in the consensus network when the edge computing unit in the idle state in the network does not reach the first number, wherein the residual task amount is calculated based on a first formula, and the first formula is as follows: α=m-M, where M is the total amount of consensus network that the edge computing unit needs to participate in, and M is the amount of participation tasks that the edge computing unit has completed in the total amount of consensus network;
If the edge computing unit meeting the second formula exists in the network, changing the extraction mode for extracting the edge computing unit when the consensus network is built, wherein the second formula is as follows: beta=m max -M min Wherein beta is a first threshold, M max For the maximum value of the total amount of the consensus network which is required to participate in each edge computing unit, M min Calculating the minimum value of the total amount of the consensus network to be participated in for each edge calculation unit;
dividing the edge computing units in the network into n first subgroups, wherein the difference value of the total amount of the edge computing units which are positioned in the same subgroup and need to participate in the consensus network is smaller than a second threshold value, calculating the task processing rate of the edge computing units in the same subgroup, and calculating the task processing rate based on a third formula, wherein the third formula is as follows:
Figure SMS_1
subdividing the same group of inner edge computing units to a second group, wherein the task processing rate difference value of the inner edge computing units is smaller than a third threshold valueAn inner part;
the consensus unit locates the first subgroup with the smallest total average value of the consensus network, and extracts the edge computing unit in the second subgroup with the highest average value of the task processing rate from the first subgroup to construct the consensus network.
Further, the edge calculation unit transfers data including the steps of:
The consensus unit selects one edge computing unit in each consensus network to define as a first computing unit, the rest edge computing units are defined as second computing units, a data sending unit sends first data to all the edge computing units in the network, and the edge computing units outside the first consensus network discard the first data after the consensus unit selects the edge computing units to build the first consensus network;
the first computing unit and the second computing unit in the second consensus network split the first data in turn to generate a plurality of sub-data, after the new second consensus network is built, the second consensus network sends the sub-data to the first computing unit in the newly built second consensus network, the first computing unit merges the sub-data, and the first computing unit sends the merging result to each second computing unit.
Further, generating the consensus block and generating the verification block comprises the steps of:
each computing unit calculates first data based on a first intelligent contract to generate a first result, each second computing unit sends a first result of a second self to the first computing unit, the first computing unit compares the received first result with the first result calculated by the first computing unit, if the comparison is passed, the first computing unit generates a second consensus block and sends consensus information to each second computing unit, each second computing unit verifies the consensus information, and if the verification is passed, each second computing unit generates a second verification block based on the verification result.
Further, establishing the second node block includes the steps of:
the first computing unit sends verification passing information to the second computing unit, and the first computing unit and the second computing unit generate node information blocks, wherein each node information block comprises information of all edge computing units in the second consensus network.
The invention also provides a tamper-proof trusted carbon bank data processing system based on the edge calculation and the blockchain, which is used for realizing the tamper-proof trusted carbon bank data processing method based on the edge calculation and the blockchain, and comprises the following steps:
the data collection unit is used for collecting first data of enterprises, wherein the first data is basic data for calculating carbon emission data of the enterprises, and the data collection unit is also used for sending the first data to the consensus unit;
the contract management unit is used for establishing a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, each intelligent contract is about a preset calculation program, after data are input into the intelligent contracts in the previous sequence, the intelligent contracts calculate the intelligent contracts, the calculation result is used as input data of the intelligent contracts in the next sequence, the intelligent contract groups are used for converting first data into second data, and the second data are carbon emission data of enterprises;
The system comprises a consensus unit, a first recognition unit and a second recognition unit, wherein the consensus unit is used for constructing the first consensus network and the second consensus network, selecting an intelligent contract group based on the data type of first data, and sequentially connecting the consensus blocks generated by the first consensus network and the second consensus network to construct a carbon emission data block chain;
and the edge calculation unit is used for collecting first data acquired by the enterprise site and calculating the first data into second data based on the intelligent contract rule.
The invention also provides a computer storage medium which stores program instructions, wherein the program instructions control equipment where the computer storage medium is located to execute the tamper-proof trusted carbon data processing method based on edge calculation and blockchain.
The invention also provides a processor for running a program, wherein the program runs to execute the tamper-proof trusted carbon bank data processing method based on the edge calculation and the blockchain.
Compared with the prior art, the invention has the following beneficial effects:
1. according to the invention, the edge calculating unit is arranged to calculate the carbon emission data, and the edge calculating unit is close to the data end, so that the data can be rapidly processed; furthermore, the process of converting the basic data into the carbon emission data is divided into a plurality of sub-processes and is distributed to different edge computing units for computing, so that the computing load is dispersed, the balanced use of the edge computing units is ensured, and the operation load of a single edge computing unit is greatly reduced.
2. According to the invention, the carbon emission data of enterprises are recorded by constructing the carbon emission data blockchain, and in the process of constructing the blockchain, a first consensus network is firstly constructed to consensus the original data, so that fraud of the original data is avoided, on the basis, the consensus result of each time of data can be recorded by constructing the consensus blockchain, the consensus result of each edge computing node participating in consensus on the data can be recorded by constructing the verification blockchain, and all node information participating in the current consensus can be recorded by constructing the node blockchain; by constructing the consensus block chain, the node block chain and the verification block chain, the invention not only realizes the record of all processing procedures of the carbon emission data, but also ensures the credibility of the record of the carbon emission data in the same industry.
Drawings
FIG. 1 is a flow chart of steps of a method for processing tamper-resistant trusted carbon black data based on edge computation and blockchain of the present invention;
FIG. 2 is a schematic diagram of a carbon emission data blockchain of the present invention;
fig. 3 is a schematic diagram of the division of the first subgroup and the second subgroup of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
It will be understood that the terms "first," "second," and the like, as used herein, may be used to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another element. For example, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
As shown in fig. 1, the tamper-resistant trusted carbon data processing method based on edge calculation and blockchain comprises the following steps:
step S1: the method comprises the steps that a data collection unit collects first data of an enterprise, a contract management unit establishes a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, and the intelligent contract groups are used for converting the first data into second data;
specifically, the carbon dioxide data directly discharged by the enterprises can be directly obtained through the on-site setting sensor, and the indirectly discharged data, such as the energy consumption, need to be converted through a special formula, so that the intelligent combination is about a group of calculation programs for converting the collected basic data of the carbon discharge of the enterprises into the carbon discharge data; in this embodiment, each of the smart contract groups includes a plurality of smart contracts, the smart contract groups are used to convert the first data into the second data, each of the smart contracts in the smart contract groups performs only a part of computation, after the edge computation calls the first smart contract, the edge computation unit computes the first data based on the computation rule of the first calling order smart contract, after the edge computation calls the second order smart contract, the edge computation unit calls the computation result of the first smart contract as input data, and the process is repeated until the edge computation unit outputs the second data.
Step S2: the data collection unit sends first data to the consensus unit, the consensus unit selects an intelligent contract group based on the data type of the first data, the consensus unit builds a first consensus network based on a consensus request, the first consensus network comprises a plurality of edge calculation units, the first consensus network performs consensus on the first data, if the first data passes through the consensus, the first consensus network generates a first consensus block, a first node block and a first verification block, the first consensus block comprises consensus information of the first data, the first node block comprises edge calculation unit information, the first verification block comprises consensus information of the edge calculation unit on the first data, a first node chain is built based on the first node block, and the first verification block builds a first verification chain and is respectively connected with the first consensus block;
after receiving the first data, the consensus unit firstly judges the data type of the first data, so as to select a proper calculation mode, namely, a proper intelligent contract group; then, the consensus unit builds a first consensus network, the first consensus network comprises a plurality of edge computing units, the edge computing units consensus the consistency of the first data received by the edge computing units, if the consensus passes, the second data received by each edge computing unit is the same, if the consensus does not pass, the data collecting unit or one edge computing unit is fraudulent, and the data collecting unit is required to resend the first data.
As shown in fig. 2, when the first consensus network passes the consensus of the first data, the first consensus network generates a first consensus block a 0 First consensus block A 0 Comprises a consensus result of a consensus network on first data, and a first consensus block A 0 Adding a head block as a blockchain to the blockchain stored by each edge computing unit; each edge computing unit generates a first verification block A 1 And a first node block A 2 First verification block A 1 Includes edge calculation of the verification result of the second data, each edge calculation generating the first verification block A 1 Sequentially connected as a first verification chain, a first node block A 2 Comprises the self information of an edge computing unit, and each edge computing unit generates a first node block A 2 A first verification block A which is connected in sequence as a first node chain and is positioned at the head part of the first verification chain 1 First node block A with first node chain at head 2 Includes a first consensus block A 0 Is used to generate the hash value of (a).
Step S3: the method comprises the steps that a second consensus network is built by a consensus unit, the second consensus network comprises a plurality of edge computing units, a contract management unit sends intelligent contracts of a first calling sequence in an intelligent contract group to the second consensus network, each edge computing unit in the second consensus network converts first data into first results based on the intelligent contracts, the first results are subjected to consensus by the second consensus network, if the first results pass the consensus, a second consensus block, a second node block and a second verification block are generated by the second consensus network, the second consensus block comprises consensus information of the first results, the second node block comprises edge computing unit information, the second verification block comprises consensus information of the edge computing unit on the first results, a second node chain is built based on the second node block, and the second verification block is built by the second verification block and is connected with the second consensus block respectively;
With continued reference to fig. 2, when the first consensus network consensus is completed, the edge computing unit is reselected to build a second consensus network, and after the second consensus network is built, the consensus unit breaks down the first consensus network, and when the consensus unit builds, the edge computing units participating in the first consensus network are screened out, so that the process of converting the same first data into the second data by the same edge computing unit is prevented from participating in twice, and the risk of fraud is further reduced.
Each edge computing unit converts the first data into a first result based on the intelligent contract of the first calling sequence, the second consensus network performs consensus on the first result, and if the first result passes the consensus, the second consensus network generates a second consensus block B 0 Second consensus block B 0 A consensus result comprising a consensus network for the first result; each edge computing unit generates a second verification block B 1 And a second node block B 2 Second verification block B 1 Includes edge calculation of the result of the self-verification of the second data, each edge calculation generating a second verification block B 1 Sequentially connected as a second verification chain, a second node block B 2 Includes the self information of the edge computing unit, and the self generated second node block B 2 The second verification chain is positioned at a second verification block B of the head part 1 Second node block B with second node chain at head 2 Comprises a second consensus block B 0 Is used to generate the hash value of (a).
Step S4: the consensus unit rebuilds a second consensus network, calls intelligent contracts of a second calling sequence in the intelligent contract group, generates a third consensus block, a third node chain and a third verification chain based on the step S3, and after the third node chain and the third verification chain are respectively connected with the third consensus block, the consensus unit continues to rebuild the second consensus network until the calling of all intelligent contracts in the intelligent contract group is completed;
as above, the third common block C is generated in step S4 0 Third verification block C 1 And a third node block C 2 Each edge calculates a third verification block C to be generated by itself 1 Sequentially connected into a third verification chain and a third node block C 2 A third verification block C which is connected in sequence as a third node chain and is positioned at the head part of the third verification chain 1 Third node block C with third node chain at head 2 Includes a second consensus block C 0 Hash value of (a)
Step S5: the consensus unit stops building the consensus network, connects all the consensus blocks in turn based on the generation order, and builds the carbon emission data block chain.
Continuing to refer to FIG. 2, a first consensus block A 0 Second consensus block B 0 And a third consensus block C 0 Sequentially connected as a carbon emission data block chain, and a second consensus block B 0 Sum bagIncludes a first consensus block A 0 A third consensus block C 0 Comprises a second consensus block B 0 Is used to generate the hash value of (a).
According to the invention, the edge calculating unit is arranged to calculate the carbon emission data, and the edge calculating unit is close to the data end, so that the data can be rapidly processed; furthermore, the process of converting the basic data into the carbon emission data is divided into a plurality of sub-processes and is distributed to different edge computing units for computing, so that the computing load is dispersed, the balanced use of the edge computing units is ensured, and the operation load of a single edge computing unit is greatly reduced.
According to the invention, the carbon emission data of enterprises are recorded by constructing the carbon emission data blockchain, and in the process of constructing the blockchain, a first consensus network is firstly constructed to consensus the original data, so that fraud of the original data is avoided, on the basis, the consensus result of each time of data can be recorded by constructing the consensus blockchain, the consensus result of each edge computing node participating in consensus on the data can be recorded by constructing the verification blockchain, and all node information participating in the current consensus can be recorded by constructing the node blockchain; connecting the verification block chain and the node block chain with the corresponding consensus blocks, so that node records participating in the consensus and the consensus result of each node can be quickly found according to the consensus blocks; the invention constructs the consensus block chain, the node block chain and the verification block chain, thereby not only realizing the record of all processing procedures of the carbon emission data, but also ensuring the credibility of the record of the carbon emission data in the same industry, and realizing the record of different data by the three block chains.
In practical applications, if one edge computing unit participates in multiple consensus network tasks at the same time, when the edge computing unit is allocated to more consensus network tasks, the edge computing unit needs to process multiple tasks at the same time, so that the overall processing speed of the edge computing unit may be reduced, for example, the edge computing unit needs to take 1s to process a single consensus network task, and if ten consensus network tasks are processed at the same time, the processing time of each consensus network task may need to be 3s, so the invention proposes the following method for constructing the consensus network of tasks:
acquiring the number of all edge computing units in a current network, randomly extracting a first number of edge computing units in an idle state to form a consensus network when the consensus network needs to be formed by the consensus units, wherein each edge computing unit can only be positioned in one consensus network at the same time, if the number of edge computing units in the idle state in the network does not reach the first number, the consensus unit extracts the edge computing unit with the minimum current residual task amount to participate in the consensus network, the residual task amount is calculated based on a first formula, and the first formula is as follows: α=m-M, where M is the total amount of consensus network that the edge computing unit needs to participate in, and M is the amount of participation tasks that the edge computing unit has completed in the total amount of consensus network;
Specifically, each edge computing unit only participates in the construction of one consensus network at a time, so when the consensus network is required to be constructed (hereinafter referred to as a consensus network task), the first number of edge computing units in an idle state are randomly extracted to construct the consensus network, and the edge computing units in the idle state do not necessarily participate in other consensus network tasks; however, when the occurrence speed of the network task is greater than the data calculation speed of the edge computing unit, for example, when the edge computing unit participates in one network task, two network tasks appear in the network, and the state of the edge computing unit in the idle state does not exist in the network necessarily occurs in the construction mode, and if the idle edge computing unit in the network is waited to execute construction of the network again, the state of the edge computing unit in the network needs to be monitored in real time by the consensus unit, so that the operation burden of the consensus unit is increased.
When the number of the edge computing units in the idle state in the network does not reach the first number, a processing queue of each edge computing unit is built, wherein the processing queue comprises the consensus network tasks which the edge computing unit needs to participate in and the consensus network tasks which have completed participation, and the sum of the consensus network tasks is the total amount of the consensus network tasks which the edge computing unit participates in; the method comprises the steps that a processing queue is constructed to distribute the construction tasks of the consensus network in the network in advance, so that an edge computing unit sequentially participates in the construction of the consensus network according to the processing queue, and monitoring through the consensus unit is not needed; in this embodiment, when a new consensus network building task occurs, the edge computing unit to be selected is determined by a first formula, where the first formula indicates that the edge computing unit with the smallest task remaining in the processing queue to be processed, i.e., the edge computing unit that reaches the idle state at the fastest speed, is to be selected.
If there is an edge computing unit satisfying a second formula in the network, then changing an extraction mode of extracting the edge computing unit when the consensus network is built, wherein the second formula is: beta=m max -M min Wherein beta is a first threshold, M max For the maximum value of the total amount of the consensus network to be participated in each edge computing unit, M min Calculating the minimum value of the total amount of the consensus network to be participated in for each edge;
dividing edge computing units in a network into n first subgroups, wherein the difference value of the total amount of the edge computing units in the same group, which is needed to participate in the consensus network, is smaller than a second threshold value, calculating the task processing rate of the edge computing units in the same group, wherein the task processing rate is calculated based on a third formula, and the third formula is as follows:
Figure SMS_2
dividing the task processing rate difference value of the edge computing units in the same group into a second subgroup again, wherein the task processing rate difference value is smaller than a third threshold value;
the consensus unit locates the first subgroup with the smallest total average value of the consensus network, and extracts the edge computing units in the second subgroup with the highest average value of the task processing rate from the first subgroup to form the consensus network.
When an edge computing unit satisfying the second formula appears in the network, a larger gap appears between the total amount of the consensus network tasks of the processing queues of the two edge computing units, which may be caused by a faster computing speed of one edge processing unit, so that the one edge processing unit can process the consensus network task in a short time, however, if the consensus network task is always distributed to the edge computing unit, the edge computing unit may appear in most of carbon emission data block chains, and as a result, each edge computing unit cannot uniformly participate in the consensus network task.
In order to avoid this, when edge computing units meeting a second formula appear in the network, dividing the edge computing units in the network into n first subgroups, wherein the difference value of the total amount of the shared network needed to participate in the edge computing units in the same subgroup is smaller than a second threshold value, as shown in fig. 3, dividing the edge computing units in fig. 3a into a form shown in a 3b diagram, in fig. 3b, the total amount of the shared network tasks participated in the edge computing units in each first subgroup is close, continuing to split the first subgroup into a second subgroup, as shown in fig. 3c, the difference value of the task processing rates of the edge computing units in the second subgroup is smaller than a third threshold value, the edge computing units in the same second subgroup have the same task processing rate, as shown in a shaded part in fig. 3c, the shaded part represents the amount of the shared network tasks which the edge computing units have already processed, and the blank part represents the amount of the shared network tasks which still need to process, and at this time, the shared network tasks are distributed to the second subgroup with the maximum average value of the task processing rate, namely the third subgroup in fig. 3 c; it should be noted that the amount of edge calculation units constituting the consensus network need not be exactly the same each time; this allocation has the advantage of increasing the number of tasks of the edge computing unit with a smaller total number of consensus network tasks, and also of enabling the allocated consensus network tasks to be performed in a shorter time.
The consensus unit selects one edge computing unit in each consensus network to define as a first computing unit, the rest edge computing units are defined as second computing units, the data transmitting unit transmits first data to all edge computing units in the network, and the edge computing units outside the first consensus network discard the first data after the consensus unit selects the edge computing units to construct the first consensus network;
as shown in fig. 2, the block generated by the first computing unit is at a position closest to the common blockchain, and the block generated by the second computing unit is connected behind the block generated by the first computing unit; the data transmitting unit transmits the first data to all edge computing units in the network, and compared with the mode that the data transmitting unit transmits the first data to the first computing unit, the first computing unit transmits the first data to the second computing unit, so that the data transmission process is reduced, the first computing unit is prevented from changing the first data, and fraudulent behaviors are avoided.
The first computing unit and the second computing unit in the second consensus network split the first data in turn to generate a plurality of sub-data, after the new second consensus network is built, the second consensus network sends the sub-data to the first computing unit in the newly built second consensus network, the first computing unit merges the sub-data, and the first computing unit sends the merging result to each second computing unit.
Specifically, a data splitting program is arranged in each edge computing unit, when an old second consensus network sends data to a new second consensus network, one second computing unit in the consensus network splits the data into first sub-data and second sub-data, the second computing unit reserves the first sub-data, the second sub-data is sent to the next second computing unit, the second computing unit receiving the second sub-data splits the second sub-data into third sub-data and fourth sub-data, reserves the third sub-data, and sends the fourth sub-data to the next second computing unit, and the process is repeated until a receiver of the sub-data is the first computing unit; then the first computing unit and the second computing unit send the sub-data stored by the first computing unit and the second computing unit to the first computing unit newly constructing the second consensus network, the first computing unit restores each sub-data to complete data, and if a certain sub-data is changed in transmission, the first computing unit cannot restore each sub-data to complete data.
The data sent between the consensus networks are split into a plurality of sub-data in the mode, and the sub-data need to be built again after reaching the purpose, if a certain sub-data is intercepted and modified, the target consensus network cannot combine the sub-data into complete data, so that the condition that the data is intercepted and modified in the transmission process can be avoided.
Each computing unit calculates first data based on a first intelligent contract to generate a first result, each second computing unit sends a first result of a second self to the first computing unit, the first computing unit compares the received first result with the first result calculated by the first computing unit, if the comparison is passed, the first computing unit generates a second consensus block and sends consensus information to each second computing unit, each second computing unit verifies the consensus information, and if the verification is passed, each second computing unit generates a second verification block based on the verification result.
Specifically, each second calculation unit sends a first result generated by itself to the first calculation unit, the first calculation unit compares the first result calculated by itself with the first result of each second calculation unit, if the first result is the same as the first result, the calculation results of all calculation units are identical, namely consensus is achieved on the first result, and at the moment, the first calculation unit generates a second consensus block based on the consensus result; the first computing unit sends the consensus result to each second computing unit, the consensus result comprises the computing result of the first computing unit, each second computing unit verifies the consensus result, and if the verification is passed, a second verification block comprising the verification result is generated.
The first computing unit sends verification passing information to the second computing unit, the first computing unit and the second computing unit generate node information blocks, and each node information block comprises information of all edge computing units in the second consensus network.
Before the consensus is carried out, the nodes in the consensus network can be verified through the method, so that the phenomenon that the unselected edge computing units in the consensus network are used as the consensus nodes to influence the credibility of the consensus result or certain edge computing units are absent in the consensus network, and the situation that the consensus nodes are absent in the consensus network is avoided.
The invention also provides a tamper-proof trusted carbon bank data processing system based on the edge calculation and the blockchain, which is used for realizing the tamper-proof trusted carbon bank data processing method based on the edge calculation and the blockchain, and comprises the following steps:
The data collection unit is used for collecting first data of enterprises, wherein the first data is basic data for calculating carbon emission data of the enterprises, and the data collection unit is also used for sending the first data to the consensus unit;
the contract management unit is used for establishing a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, each intelligent contract is about a preset calculation program, after data are input into the intelligent contracts in the previous sequence, the intelligent contracts calculate the intelligent contracts, the calculation result is used as input data of the intelligent contracts in the next sequence, the intelligent contract groups are used for converting first data into second data, and the second data are carbon emission data of enterprises;
the system comprises a consensus unit, a carbon emission data block chain and a control unit, wherein the consensus unit is used for constructing a first consensus network and a second consensus network, selecting an intelligent contract group based on the data type of first data, and sequentially connecting the consensus blocks generated by the first consensus network and the second consensus network to construct the carbon emission data block chain;
and the edge calculation unit is used for collecting first data acquired by the enterprise site and calculating the first data into second data based on the intelligent contract rule.
The invention also provides a computer storage medium which stores program instructions, wherein the equipment where the computer storage medium is located is controlled to execute the above tamper-proof trusted carbon bank data processing method based on edge calculation and blockchain when the program instructions run.
The invention also provides a processor, which is used for running a program, wherein the method for processing the tamper-proof trusted carbon bank data based on the edge calculation and the blockchain is executed when the program runs.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in various embodiments may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the sub-steps or stages of other steps or other steps.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of computer programs, which may be stored on a non-transitory computer readable storage medium, and which, when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
The technical features of the above embodiments may be arbitrarily combined, and for brevity, all of the possible combinations of the technical features of the above embodiments are not described, however, they should be considered as the scope of the description of the present specification as long as there is no contradiction between the combinations of the technical features.
The foregoing examples have been presented to illustrate only a few embodiments of the invention and are described in more detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, and alternatives falling within the spirit and principles of the invention.

Claims (8)

1. The tamper-resistant trusted carbon bank data processing method based on edge calculation and blockchain is characterized by comprising the following steps of:
Step S1: the method comprises the steps that a data collection unit collects first data of an enterprise, a contract management unit establishes a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, and the intelligent contract groups are used for converting the first data into second data;
step S2: the data collection unit sends first data to the consensus unit, the consensus unit selects an intelligent contract group based on the data type of the first data and builds a first consensus network, the first consensus network comprises a plurality of edge calculation units, the first consensus network performs consensus on the first data, if the first data passes the consensus, the first consensus network generates a first consensus block, a first node block and a first verification block, the first consensus block comprises consensus information of the first data, the first node block comprises the edge calculation unit information, the first verification block comprises consensus information of the edge calculation unit on the first data, a first node chain is built based on the first node block, and the first verification block builds a first verification chain and is respectively connected with the first consensus block;
step S3: the second consensus network comprises a plurality of edge computing units, the contract management unit sends intelligent contracts of a first calling sequence in an intelligent contract group to the second consensus network, each edge computing unit in the second consensus network converts first data into a first result based on the intelligent contracts, the second consensus network performs consensus on the first result, if the first result passes through the consensus, the second consensus network generates a second consensus block, a second node block and a second verification block, the second consensus block comprises consensus information on the first result, the second node block comprises the edge computing unit information, the second verification block comprises consensus information on the first result by the edge computing unit, a second node chain is built based on the second node block, and the second verification block is connected with the second consensus block respectively;
Step S4: the consensus unit rebuilds the second consensus network, calls intelligent contracts of a second calling sequence in the intelligent contract group, generates a third consensus block, a third node chain and a third verification chain based on the step S3, and after the third node chain and the third verification chain are respectively connected with the third consensus block, the consensus unit continues to rebuild the second consensus network until the calling of all intelligent contracts in the intelligent contract group is completed;
step S5: the consensus unit stops building the consensus network, connects all the consensus blocks in turn based on the generation order, and builds the carbon emission data block chain.
2. The method for processing the tamper-resistant trusted carbon black data based on edge computation and blockchain according to claim 1, wherein the consensus unit builds a consensus network comprising the following steps:
acquiring the number of all edge computing units in a current network, randomly extracting a first number of edge computing units in an idle state to form a consensus network when the consensus units need to form the consensus network, wherein each edge computing unit can only be positioned in one consensus network at the same time, and extracting the edge computing unit with the smallest current residual task amount to participate in the consensus network when the edge computing unit in the idle state in the network does not reach the first number, wherein the residual task amount is calculated based on a first formula, and the first formula is as follows: α=m-M, where M is the total amount of consensus network that the edge computing unit needs to participate in, and M is the amount of participation tasks that the edge computing unit has completed in the total amount of consensus network;
If the edge computing unit meeting the second formula exists in the network, changing the extraction mode for extracting the edge computing unit when the consensus network is built, wherein the second formula is as follows: beta=m max -M min Wherein beta is a first threshold, M max For the maximum value of the total amount of the consensus network which is required to participate in each edge computing unit, M min Calculating the minimum value of the total amount of the consensus network to be participated in for each edge calculation unit;
dividing the edge computing units in the network into n first subgroups, wherein the difference value of the total amount of the edge computing units which are in the same group and need to participate in the consensus network is smaller than a second threshold value, calculating the task processing rate of the edge computing units in the same group, and calculating the task processing rate based on a third formula, wherein the third formula is as follows:
Figure FDA0004065026060000021
dividing the task processing rate difference value of the edge computing units in the same group into a second subgroup again, wherein the task processing rate difference value of the edge computing units in the same group is smaller than a third threshold value;
the consensus unit locates the first subgroup with the smallest total average value of the consensus network, and extracts the edge computing unit in the second subgroup with the highest average value of the task processing rate from the first subgroup to construct the consensus network.
3. The tamper-resistant trusted carbon black data processing method based on edge computation and blockchain as in claim 1, wherein the edge computation unit transfers data comprising the steps of:
The consensus unit selects one edge computing unit in each consensus network to define as a first computing unit, the rest edge computing units are defined as second computing units, a data sending unit sends first data to all the edge computing units in the network, and the edge computing units outside the first consensus network discard the first data after the consensus unit selects the edge computing units to build the first consensus network;
the first computing unit and the second computing unit in the second consensus network split the first data in turn to generate a plurality of sub-data, after the new second consensus network is built, the second consensus network sends the sub-data to the first computing unit in the newly built second consensus network, the first computing unit merges the sub-data, and the first computing unit sends the merging result to each second computing unit.
4. The method for processing the tamper-resistant trusted carbon black data based on edge computation and blockchain of claim 3, wherein generating the consensus block and generating the verification block comprises the steps of:
each computing unit calculates first data based on a first intelligent contract to generate a first result, each second computing unit sends a first result of a second self to the first computing unit, the first computing unit compares the received first result with the first result calculated by the first computing unit, if the comparison is passed, the first computing unit generates a second consensus block and sends consensus information to each second computing unit, each second computing unit verifies the consensus information, and if the verification is passed, each second computing unit generates a second verification block based on the verification result.
5. The method for processing the tamper-resistant trusted carbon black data based on edge computation and blockchain of claim 4, wherein establishing the second node block comprises the steps of:
the first computing unit sends verification passing information to the second computing unit, and the first computing unit and the second computing unit generate node information blocks, wherein each node information block comprises information of all edge computing units in the second consensus network.
6. A tamper-resistant trusted carbon black data processing system based on edge computation and blockchain for implementing the tamper-resistant trusted carbon black data processing method based on edge computation and blockchain of any of claims 1-5, comprising:
the data collection unit is used for collecting first data of enterprises, wherein the first data is basic data for calculating carbon emission data of the enterprises, and the data collection unit is also used for sending the first data to the consensus unit;
The contract management unit is used for establishing a plurality of intelligent contract groups, each intelligent contract group comprises a plurality of intelligent contracts with calling sequences, each intelligent contract is about a preset calculation program, after data are input into the intelligent contracts in the previous sequence, the intelligent contracts calculate the intelligent contracts, the calculation result is used as input data of the intelligent contracts in the next sequence, the intelligent contract groups are used for converting first data into second data, and the second data are carbon emission data of enterprises;
the system comprises a consensus unit, a first recognition unit and a second recognition unit, wherein the consensus unit is used for constructing the first consensus network and the second consensus network, selecting an intelligent contract group based on the data type of first data, and sequentially connecting the consensus blocks generated by the first consensus network and the second consensus network to construct a carbon emission data block chain;
and the edge calculation unit is used for collecting first data acquired by the enterprise site and calculating the first data into second data based on the intelligent contract rule.
7. A computer storage medium storing program instructions, wherein the program instructions, when executed, control a device in which the computer storage medium is located to perform the edge computing and blockchain based tamper-resistant trusted carbon data processing method of any of claims 1-5.
8. A processor for running a program, wherein the program when run performs the edge computing and blockchain based tamper-resistant trusted carbon black data processing method of any of claims 1-5.
CN202310072034.0A 2023-02-07 2023-02-07 Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain Pending CN116074316A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310072034.0A CN116074316A (en) 2023-02-07 2023-02-07 Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310072034.0A CN116074316A (en) 2023-02-07 2023-02-07 Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain

Publications (1)

Publication Number Publication Date
CN116074316A true CN116074316A (en) 2023-05-05

Family

ID=86176523

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310072034.0A Pending CN116074316A (en) 2023-02-07 2023-02-07 Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain

Country Status (1)

Country Link
CN (1) CN116074316A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116933886A (en) * 2023-09-12 2023-10-24 苏州浪潮智能科技有限公司 Quantum computing execution method, quantum computing execution system, electronic equipment and storage medium
CN117114542A (en) * 2023-07-25 2023-11-24 淮阴工学院 Cold chain logistics carbon emission data monitoring method and device based on block chain and edge calculation
CN117294482A (en) * 2023-09-14 2023-12-26 广电运通集团股份有限公司 Data verification method and device based on multiparty security privacy calculation

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117114542A (en) * 2023-07-25 2023-11-24 淮阴工学院 Cold chain logistics carbon emission data monitoring method and device based on block chain and edge calculation
CN116933886A (en) * 2023-09-12 2023-10-24 苏州浪潮智能科技有限公司 Quantum computing execution method, quantum computing execution system, electronic equipment and storage medium
CN116933886B (en) * 2023-09-12 2024-01-23 苏州浪潮智能科技有限公司 Quantum computing execution method, quantum computing execution system, electronic equipment and storage medium
CN117294482A (en) * 2023-09-14 2023-12-26 广电运通集团股份有限公司 Data verification method and device based on multiparty security privacy calculation

Similar Documents

Publication Publication Date Title
CN116074316A (en) Tamper-resistant trusted carbon data processing method based on edge calculation and blockchain
CN109361664B (en) Block chain based data verification method, system and computer readable storage medium
CN111026578B (en) Intelligent contract security detection method based on prophetic machine
JP7340628B2 (en) Blockchain-based service information processing method, device and readable storage medium
CN110865927B (en) Block chain call link abnormity detection method and device and computer equipment
CN110955226B (en) Equipment failure prediction method and device, computer equipment and storage medium
CN112435126B (en) Account identification method and device, computer equipment and storage medium
KR20230060461A (en) Apparatus and Method for Managing Trust-Based Delegation Consensus of Blockchain Network using Deep Reinforcement Learning
CN110892675B (en) Method and apparatus for monitoring block chains
CN110490594A (en) Business data processing method, device, computer equipment and storage medium
KR102441087B1 (en) Method and Apparatus for Proof of Delivery in a Trustless Network
CN109542602B (en) Block chain-based distributed task processing method, device and system
CN114881349A (en) Big data analysis-based early warning method and storage medium
CN112487091B (en) Method and device for determining block chain consensus node
CN113052329A (en) Method and device for jointly updating service model
CN113723956A (en) Abnormity monitoring method, device, equipment and storage medium
Prieto-Rumeau et al. Discounted continuous-time controlled Markov chains: convergence of control models
CN115174129A (en) Abnormal node detection method and device, computer equipment and storage medium
CN111783487B (en) Fault early warning method and device for card reader equipment
CN110263106B (en) Collaborative public opinion fraud detection method and device
CN112085599A (en) Method, device, storage medium and computing device for processing block chain transaction input
CN113010579B (en) Data processing method, device, equipment and storage medium
CN114116853B (en) Data security analysis method and device based on time sequence association analysis
CN112686567B (en) Abnormal operation and maintenance operation processing method and device, computer equipment and storage medium
CN113988867A (en) Fraud detection method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination