Block chain-based electricity-coal secure transaction method and system
By adopting blockchain technology and asymmetric encryption technology in power coal transactions, the problems of low security, insufficient transparency, low transaction efficiency and high data management costs in power coal transactions are solved, and higher data security is achieved. Transaction transparency and efficiency.
Patent Information
- Application Number
- CN202411550779.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing coal trading system has problems such as low security, insufficient transparency, low transaction efficiency and high data management costs.
Adopt blockchain-based electric coal security transaction method, ensure data confidentiality and integrity through asymmetric encryption technology and digital signature technology, and use blockchain distributed storage technology to provide an additional layer of security to improve data immutability and transparency, and improve data management efficiency through keyword extraction models and data analysis models.
Effectively solve the problem of insufficient data security, reduce the risk of data leakage and tampering, improve the transparency and trust of transactions, simplify transaction processes, improve the efficiency of power coal transactions, and reduce the complexity of data management and cost.
Smart Images

Figure CN119477311A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of safe transaction of electric coal, and specifically relates to a safe transaction method and system of electric coal based on blockchain. Background Art
[0002] With the development of the global economy, energy demand continues to grow. As one of the important energy sources, coal occupies a pivotal position in power production. Power coal trading is a key link between coal suppliers and power plants. However, the existing power coal trading system has the following major problems:
[0003] 1) Low security: In the traditional coal-fired power transaction process, transaction information is easily tampered with or leaked, resulting in damage to the interests of both parties to the transaction. At the same time, due to the lack of an effective supervision mechanism, fraud in the transaction process is difficult to prevent.
[0004] 2) Lack of transparency: Information asymmetry is a common problem in the thermal coal trading process. The lack of transparency between suppliers and power plants makes it difficult for both parties to make the best decision during the transaction.
[0005] 3) Low transaction efficiency: The traditional coal-fired power transaction process is cumbersome and involves multiple links, such as contract signing, logistics arrangement, payment settlement, etc. These links often require a lot of manual operations and are inefficient.
[0006] 4) High data management costs: Power coal transactions involve a large amount of data, including supply information, demand information, price information, etc. The management and maintenance of this data requires a lot of manpower and material resources. Summary of the invention
[0007] In order to solve the problems of insufficient security and transparency, low transaction efficiency and high data management costs in the prior art, the present invention aims to provide a safe coal trading method and system based on blockchain.
[0008] The technical solution adopted by the present invention is:
[0009] A method for safe trading of electric coal based on blockchain, comprising the following steps:
[0010] Based on the trusted institution, key generation and identity authentication are performed according to the collected basic information of all suppliers and all power plants, and the first public-private key pair and first signature data of each power coal supplier terminal, as well as the second public-private key pair and second signature data of each power plant terminal are obtained;
[0011] Based on the electric coal supplier terminal, the real-time electric coal supply data is encrypted and signed according to the first private key and the first signature data in the first public-private key pair, the encrypted real-time electric coal supply data and the first real-time signature data are obtained, and uploaded to the cloud data center;
[0012] Based on the cloud data center, the first signature data is signature verified. After the signature verification is passed, the encrypted real-time coal supply data is decrypted according to the first public key in the corresponding first public-private key pair to obtain the decrypted real-time coal supply data;
[0013] Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. After the legitimacy verification is passed, the keyword extraction model and data analysis model are used to generate the real-time coal supply information of the decrypted real-time coal supply data, and the blockchain network is used to distribute the decrypted real-time coal supply data and real-time coal supply information.
[0014] Based on the power plant terminal, the real-time coal demand information is encrypted and signed according to the second private key and the second signature data in the second public-private key pair, the encrypted real-time coal demand information and the second real-time signature data are obtained, and uploaded to the cloud data center;
[0015] Based on the cloud data center, the second signature data is signature verified. After the signature verification is passed, the encrypted real-time coal demand information is decrypted according to the second public key in the corresponding second public-private key pair to obtain the decrypted real-time coal demand information;
[0016] Based on the cloud data center, according to the decrypted real-time coal demand information, the corresponding target real-time coal supply information is retrieved from a number of real-time coal supply information, and according to the target real-time coal supply information, the corresponding target decrypted real-time coal supply data is extracted from the blockchain network;
[0017] Based on the cloud data center, the corresponding real-time coal security transaction data is generated according to the decrypted real-time coal demand information and the target decrypted real-time coal supply data. The blockchain network is used to distribute the real-time coal security transaction data and return the real-time transaction success signal to the corresponding power plant terminal and coal supplier terminal.
[0018] Furthermore, based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. After the legitimacy verification is passed, the keyword extraction model and the data analysis model are used to generate real-time coal supply information of the decrypted real-time coal supply data, and the blockchain network is used to perform distributed storage of the decrypted real-time coal supply data and the real-time coal supply information, including the following steps:
[0019] Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. If there is a verification failure item, the legitimacy verification fails, the corresponding decrypted real-time coal supply data is deleted, and the data upload step is ended. Otherwise, the legitimacy verification passes and proceeds to the next step.
[0020] After the legitimacy verification is passed, a keyword extraction model is used to extract several real-time coal supply keywords from the decrypted real-time coal supply data;
[0021] Use the data analysis model to analyze the decrypted real-time coal supply data and obtain real-time data analysis results;
[0022] According to a number of real-time coal supply keywords and real-time data analysis results, real-time coal supply information of decrypted real-time coal supply data is generated;
[0023] According to the copy mechanism, the decrypted real-time coal supply data is sharded to obtain a number of real-time coal supply data shards including the copy data shards, and the real-time coal supply information is used as the first search tag of each real-time coal supply data shard;
[0024] Using a blockchain network, a number of real-time coal supply data slices with a first search tag are distributedly stored, and the first storage location and the first search tag of each real-time coal supply data slice are stored in a distributed ledger.
[0025] Furthermore, legality verification includes data format verification, data content verification, integrity verification, timestamp verification, regulatory compliance verification, data quality verification, supply chain verification, and third-party verification in sequence.
[0026] Furthermore, the keyword extraction model is constructed based on the TF-IDF-CI algorithm.
[0027] Furthermore, the data analysis model is built based on the RF-Attention-BiLSTM algorithm.
[0028] Further, using a blockchain network, a plurality of real-time coal supply data shards provided with a first search tag are distributedly stored, and a first storage location and a first search tag of each real-time coal supply data shard are stored in a distributed ledger, including the following steps:
[0029] Using a hierarchical mechanism, several nodes in the blockchain network are divided into consensus nodes to obtain a consensus layer composed of several consensus nodes, and the remaining nodes are divided into storage nodes to obtain a storage layer composed of several storage nodes;
[0030] Allocate the real-time coal supply data shards provided with the first search tag to the storage nodes of the storage layer, obtain the first storage location, create a corresponding first real-time storage request, and send the first real-time storage request to the consensus layer;
[0031] The consensus node that receives the first real-time storage request is used as the master node, and consensus is reached on the first real-time storage request based on the master node and using a consensus algorithm;
[0032] After the consensus is successful, the real-time coal supply data slice is encrypted according to the first public key in the corresponding first public-private key pair to obtain the encrypted real-time coal supply data slice, and the encrypted real-time coal supply data slice with the first search tag is locally stored using the allocated storage node;
[0033] All real-time coal supply data shards with the first search tag are traversed until all real-time coal supply data shards are distributedly stored, and the first storage locations and corresponding first search tags of all real-time coal supply data shards are stored in the distributed ledger.
[0034] Further, based on the cloud data center, according to the decrypted real-time coal demand information, the corresponding target real-time coal supply information is retrieved from the plurality of real-time coal supply information, and according to the target real-time coal supply information, the corresponding target decrypted real-time coal supply data is extracted from the blockchain network, including the following steps:
[0035] Based on the cloud data center, a keyword extraction model is used to extract several real-time coal demand keywords from the decrypted real-time coal demand information;
[0036] Obtain the Euclidean distance between several real-time coal demand keywords and each first search tag in the distributed ledger, and use the real-time coal supply information of the first search tag with the closest Euclidean distance as the corresponding target real-time coal supply information;
[0037] According to the target first storage location corresponding to the target real-time coal supply information in the distributed ledger, extract the corresponding encrypted real-time coal supply data fragments of several targets;
[0038] Decrypting the target encrypted real-time coal supply data slices according to the corresponding first public key to obtain a plurality of target decrypted real-time coal supply data slices;
[0039] The real-time coal supply data after decryption of several targets are reorganized to obtain the corresponding real-time coal supply data after decryption of the targets.
[0040] Furthermore, based on the cloud data center, the corresponding real-time coal security transaction data is generated according to the decrypted real-time coal demand information and the target decrypted real-time coal supply data, and the real-time coal security transaction data is distributedly stored using the blockchain network, and a real-time transaction success signal is returned to the corresponding power plant terminal and coal supplier terminal, including the following steps:
[0041] Based on the cloud data center, according to a number of real-time coal demand keywords of the decrypted real-time coal demand information and a number of target real-time coal supply keywords of the target decrypted real-time coal supply data, corresponding real-time coal security transaction data is generated;
[0042] According to the replica mechanism, the real-time electric coal safety transaction data is sharded to obtain a number of real-time electric coal safety transaction data shards including the replica data shards, and a number of real-time electric coal demand keywords are used as the second search tag of each real-time electric coal safety transaction data shard;
[0043] Using the blockchain network, a number of real-time electric coal safety transaction data shards with second search tags are distributedly stored, and the second storage location and the second search tag of each real-time electric coal safety transaction data shard are stored in the distributed ledger.
[0044] Further, using a blockchain network, a plurality of real-time electric coal safety transaction data shards provided with a second search tag are distributedly stored, and the second storage location and the second search tag of each real-time electric coal safety transaction data shard are stored in a distributed ledger, including the following steps:
[0045] Allocate the real-time coal safety transaction data shards provided with the second search tag to the storage nodes of the storage layer, obtain the second storage location, create a corresponding second real-time storage request, and send the second real-time storage request to the consensus layer;
[0046] The consensus node that receives the second real-time storage request is used as the master node, and consensus is reached on the second real-time storage request based on the master node and using a consensus algorithm;
[0047] After the consensus is successful, the real-time electric coal safety transaction data shard is encrypted according to the corresponding first public key and the second public key to obtain the encrypted real-time electric coal safety transaction data shard, and the real-time electric coal safety transaction data shard with the second search tag is locally stored using the allocated storage node;
[0048] Traverse all real-time electric coal safety transaction data shards set with second search tags until all real-time electric coal safety transaction data shards are distributedly stored, and store the second storage locations and corresponding second search tags of all real-time electric coal safety transaction data shards in the distributed ledger.
[0049] A block chain-based electric coal safety transaction system is used to implement an electric coal safety transaction method. The system includes a cloud data center, a trusted institution, a plurality of electric coal supplier terminals, and a plurality of power plant terminals. Each electric coal supplier terminal and each power plant terminal are respectively connected to the cloud data center and the trusted institution for communication, and the trusted institution is connected to the cloud data center for communication;
[0050] The cloud data center includes a model building unit, a signature verification and decryption unit, a legitimacy verification unit, a distributed storage unit, a target data retrieval unit, and a power coal security transaction unit.
[0051] The beneficial effects of the present invention are:
[0052] The invention provides a method and system for safe transaction of electric coal based on blockchain, which adopts asymmetric encryption technology and digital signature technology to ensure the confidentiality and integrity of data during transmission, effectively solves the problem of insufficient data security in traditional methods, and prevents the risk of data leakage and tampering; through the distributed storage technology of decentralized, tamper-proof and highly transparent blockchain, an additional security layer is provided for data storage, ensuring that data cannot be tampered with and the source of data can be traced; compared with traditional centralized storage, distributed storage reduces the risk of single point failure and improves the reliability and robustness of data storage; the public ledger feature of blockchain makes the electric coal transaction process transparent to all participants, solves the problem of information asymmetry, and enhances the trust between the two parties to the transaction; keyword extraction model and data analysis model are used to improve the efficiency of data management, and cloud management is used to effectively manage and maintain data related to electric coal transactions, which reduces the complexity and cost of data management, simplifies the transaction process, reduces manual intervention, and greatly improves the efficiency of electric coal transactions.
[0053] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of the method for safe trading of electric coal based on blockchain in the present invention.
[0055] Figure 2 It is a structural block diagram of the electric coal safety transaction system based on blockchain in the present invention. DETAILED DESCRIPTION
[0056] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments.
[0057] Embodiment 1:
[0058] like Figure 1 As shown, this embodiment provides a method for safe transaction of electric coal based on blockchain, comprising the following steps:
[0059] S1: Based on the trusted institution, key generation and identity authentication are performed according to the collected basic information of all suppliers and all power plants, and the first public-private key pair and first signature data of each power coal supplier terminal, as well as the second public-private key pair and second signature data of each power plant terminal are obtained, including the following steps:
[0060] S1-1: Generate keys based on a trusted institution to obtain initial keys and public parameters;
[0061] The formula is:
[0062] GP={g,g 1 ,g a ,e(g,g) a ,H 1 ,H 2 ,H 3 ,H 4 ,H 5 ,H 6}
[0063] PK={g,g 1 ,g a ,e(g,g) a ,H u}
[0064] MSK = {g a ,a}
[0065] Where GP is the public parameter; MSK is the master key; PK is the initial key; a is the integer domain Z p Random number; H 1 , H 2 , H 3 , H 4 , H 5 , H 6 , H u Both are target hash functions; g, g 1 , g a are all random numbers generated by generators in the cyclic group G; e(g,g) a is a bilinear map of random numbers g;
[0066] S1-2: Generate a key based on the initial key, public parameters and basic information of the supplier to obtain the first public-private key pair {PK u1 ,SK u1};
[0067] The formula is:
[0068] SK u1 = {MSK, Vu1 ,K=g a g ab ,L u1 =g b ,(K' u1 =H 3 (V u1 ) b )}
[0069]
[0070] In the formula, SK u1 is the first private key of the coal supplier terminal u1; b is the integer domain Z p Random number; L u1 , K' u1 H is the private key parameter of the coal supplier terminal u1; 3 is the target hash function of the public parameter GP; u1 is the terminal indication of the power coal supplier; MSK is the master key; PK is the initial key; PK u1 is the first public key of the coal supplier terminal u; g b , g a , g ab V is a random number generated by a generator in the cyclic group G; u1 The supplier attribute information of the power coal supplier terminal u1 in the supplier basic information;
[0071] S1-3: According to the first public-private key pair of the power coal supplier terminal and the basic information of the supplier, the identity is registered to obtain the first signature information {K u1 ,KID u1};
[0072] The formula is:
[0073]
[0074] Where k′ is a random number; K u1 Registration parameters for the coal supplier terminal u; KID u1 The registration ID of the coal supplier terminal u1; KID u1 and the corresponding K u1 The first signature information {K u1 ,KID u1}; H 1 Hash function for the target hash; ID u The supplier device ID of the thermal coal supplier terminal u1 in the supplier basic information; is the prime order; P is the base point of the prime domain; mod(*) is the remainder function;
[0075] S1-4: sending the first private key and the first signature information in the first public-private key pair to the corresponding electric coal supplier terminal, and publishing the first public key in the first public-private key pair to the cloud data center;
[0076] S1-5: Generate a key based on the initial key, public parameters and basic information of the power plant to obtain the second public-private key pair {PK u2 ,SK u2}; Among them, SK u2 is the second private key of the power plant terminal u2, PK u2 is the second public key of the power plant terminal u2, and u2 is the power plant terminal indicator;
[0077] S1-6: According to the second public-private key pair of the power plant terminal and the basic information of the supplier, the identity is registered to obtain the second signature information {K u2 ,KID u2}; where K u2 Registration parameters for power plant terminal u2; KID u2 It is the registration ID of the power plant terminal u2;
[0078] S1-7: Send the second private key and the second signature information in the second public-private key pair to the corresponding power plant terminal, and publish the second public key in the second public-private key pair to the cloud data center;
[0079] S2: Based on the electric coal supplier terminal, the real-time electric coal supply data is encrypted and signed according to the first private key and the first signature data in the first public-private key pair, the encrypted real-time electric coal supply data and the first real-time signature data are obtained, and uploaded to the cloud data center;
[0080] The formula is:
[0081] M u1 =E(SK u1 ,m u1 )
[0082] Where M u1 is the encrypted real-time coal supply data; E(*) is the asymmetric encryption function; m u Provide real-time coal supply data;
[0083]
[0084] Where r' is a random number; the first real-time signature data is {ID u1 ,γ'={K u1 ,R u1 ,M u1 ,B u1}}; R u1 ,Bu1 ,γ' are the signature parameters of the coal supplier terminal u1;
[0085] Real-time coal supply data includes information such as suppliers’ real-time coal prices, real-time coal supply, real-time coal types, real-time coal transportation methods, real-time coal supply chains, and real-time coal trading accounts;
[0086] S3: Based on the cloud data center, the first signature data is signature verified. After the signature verification is passed, the encrypted real-time coal supply data is decrypted according to the first public key in the corresponding first public-private key pair to obtain the decrypted real-time coal supply data;
[0087] The formula is:
[0088] β u1 B u1 P=β u1 H 2 (R u1 ,ID u1 ,M u1 ,K u1 )R u1 +β u1 K u1 +β u1 H 1 (ID u1 ,K u1 )PK u1
[0089] If the left formula is equal to the right formula, the signature verification is successful;
[0090] m u1 =E - (PK u1 ,M u1 )
[0091] In the formula, m u1 Decrypted real-time coal supply data; E - (*) is an asymmetric decryption function;
[0092] S4: Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. After the legitimacy verification is passed, the keyword extraction model and the data analysis model are used to generate real-time coal supply information of the decrypted real-time coal supply data, and the blockchain network is used to perform distributed storage of the decrypted real-time coal supply data and the real-time coal supply information, including the following steps:
[0093] S4-1: Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. If there is a verification failure item, the legitimacy verification fails, and the corresponding decrypted real-time coal supply data is deleted, and the data upload step ends. Otherwise, the legitimacy verification passes and proceeds to the next step;
[0094] Legality verification includes data format verification, data content verification, integrity verification, timestamp verification, regulatory compliance verification, data quality verification, supply chain verification, and third-party verification in sequence;
[0095] Data format verification includes: Structural verification: checking whether the data conforms to predefined format standards, such as XML, JSON or other specific formats; Field integrity: verifying whether all necessary fields in the data are complete and not missing;
[0096] Data content verification includes: Range check: confirm whether the data value is within a reasonable range, such as the supply volume and quality indicators of power coal; Logical consistency: check whether the data content is logically consistent, for example, the supply volume should not be less than zero;
[0097] The integrity verification includes: obtaining a first data hash value of the real-time power coal supply data at the power coal supplier terminal, and obtaining a second data hash value of the decrypted real-time power coal supply data at the cloud data center. If the first data hash value is consistent with the second data hash value, the integrity verification is passed;
[0098] Timestamp verification includes: Timeliness check: ensuring that the timestamp of the data is current. For real-time data, the timestamp should be within an acceptable time range; Time consistency: verifying whether the timestamp of the data is synchronized with the time of the cloud data center;
[0099] Regulatory compliance verification includes: Compliance check: Verify whether the data meets the requirements according to relevant industry regulations and laws and regulations; License and certificate verification: Confirm whether the supplier's license and certificate are valid and whether it is allowed to supply power coal;
[0100] Data quality verification includes: duplication check: check whether there are duplicate records in the data; outlier detection: use statistical methods or machine learning models to detect outliers in the data;
[0101] Supply chain verification includes: Source tracking: verifying whether the source of thermal coal is traceable and whether it meets the legality requirements of the supply chain; Contract consistency: confirming whether the supply data is consistent with the contract terms signed with the supplier
[0102] Third-party verification includes: Audit evidence: Introducing a third-party auditing agency to verify the data and provide additional evidence of legitimacy; Cross-validation: Cross-validating with other trusted data sources to confirm the accuracy of the data;
[0103] Through these steps, the cloud data center can ensure the legitimacy of real-time coal supply data, thereby supporting the power plant terminal's decision-making on coal procurement and ensuring the stability and security of energy supply;
[0104] S4-2: After the legitimacy verification is passed, a keyword extraction model based on the Term Frequency-Inverse Document Frequency-Class Information (TF-IDF-CI) algorithm is used to extract several real-time coal supply keywords from the decrypted real-time coal supply data, including the following steps:
[0105] S4-2-1: Use the keyword extraction model to obtain the inter-class discrete factors and intra-class discrete factors of the characteristic words in the decrypted real-time coal supply data. The formula is:
[0106]
[0107] In the formula, CI ac is the inter-class discrete factor; Characteristic word The standard deviation of Characteristic word categories; |C| is the total number of categories; for In category The frequency of occurrence in for The frequency of occurrence in each category; k* is the category indicator; j* is the feature word indicator;
[0108]
[0109] In the formula, CI ic is the discrete factor within the class; For Category Commonly seen in The standard deviation of To include Category The number of strings; for The number of strings;
[0110] S4-2-2: Obtain the word frequency and reverse text frequency of the characteristic words in the decrypted real-time coal supply data;
[0111] S4-2-3: Obtain the weight of each feature word according to the inter-class discrete factor, intra-class discrete factor, word frequency and reverse text frequency of the feature word. The formula is:
[0112]
[0113] In the formula, TF-IDF-CI is the feature word The weight of TF is the feature word The word frequency of IDF is the feature word The inverse text frequency of CI is the characteristic word Discrete factors, including intra-class discrete factors CI ic and the inter-class discrete factor CI ac ;
[0114] S4-2-4: Sort by weight of the feature words, select the first n' feature words as the real-time power coal supply keyword group KEYWORD = {keyword 1 、keyword 2 、...、...、keyword n’};
[0115] S4-3: Using a data analysis model based on the Random Forest (RF)-Attention-Bi-directional Long Short-Term Memory (BiLSTM) algorithm, the decrypted real-time coal supply data is analyzed to obtain real-time data analysis results, including the following steps:
[0116] S4-3-1: Use the RF structure trained in the data analysis model to extract the feature contribution of several real-time candidate features in the decrypted real-time coal supply data;
[0117] The formula is:
[0118]
[0119] In the formula, is the feature contribution of the j'th real-time candidate feature; is the feature contribution of the j'th real-time candidate feature in the i'th tree of the random forest; i' is the CART tree indicator; j' is the real-time candidate feature indicator; n is the total number of CARTs;
[0120]
[0121] In the formula, GI m GI l , GI r" is the Gini index of the CART tree node m, node l and node r" of the random forest; p mk"is the proportion of category k" in CART tree node m; K is the total number of categories; m, l, r" are node indicators; k" is the category indicator;
[0122] S4-3-2: normalizing the feature contributions of several real-time candidate features to obtain corresponding normalized feature contributions;
[0123] The formula is:
[0124]
[0125] In the formula, VIM j' is the contribution of the feature after normalization; J is the total number of real-time candidate features;
[0126] S4-3-3: Generate feature selection standard values for several real-time candidate features based on the normalized feature contribution;
[0127] The formula is:
[0128]
[0129] In the formula, CFC j' The feature selection standard value for the j'th real-time candidate feature; VIM j" is the normalized feature contribution of the j'th real-time candidate feature; j' is the indicator of the candidate feature;
[0130] S4-3-4: sort the real-time candidate features in descending order according to the feature selection standard value, and select the first M real-time candidate features as real-time key features to obtain M real-time key features, where M is the total number of real-time key features;
[0131] S4-3-5: According to the preset attention weights set by the Attention mechanism, the M real-time key features are concatenated to obtain the first real-time concatenated feature;
[0132] S4-3-6: According to the first real-time splicing feature, use the BiLSTM network to perform data analysis to obtain real-time data analysis results;
[0133] S4-4: generating real-time coal supply information of decrypted real-time coal supply data according to a number of real-time coal supply keywords and real-time data analysis results;
[0134] S4-5: According to the replica mechanism, the decrypted real-time coal supply data is segmented to obtain a plurality of real-time coal supply data segments including the replica data segment, and the real-time coal supply information is used as the first search tag of each real-time coal supply data segment;
[0135] S4-6: Using a blockchain network, performing distributed storage on a plurality of real-time coal supply data slices provided with a first search tag, and storing a first storage location and a first search tag of each real-time coal supply data slice in a distributed ledger, using a blockchain network, performing distributed storage on a plurality of real-time coal supply data slices provided with a first search tag, and storing a first storage location and a first search tag of each real-time coal supply data slice in a distributed ledger, comprising the following steps:
[0136] S4-6-1: Using a layered mechanism, several nodes in the blockchain network are divided into consensus nodes to obtain a consensus layer composed of several consensus nodes, and the remaining several nodes are divided into storage nodes to obtain a storage layer composed of several storage nodes, including the following steps:
[0137] S4-6-1-1: Based on the cloud data center, initialize all nodes in the blockchain storage network to obtain several initialized nodes;
[0138] S4-6-1-2: Use the reward mechanism to obtain the real-time honor values of several initialized nodes participating in the consensus process, and use the top N initialized nodes as consensus nodes, and the remaining initialized nodes as storage nodes, where N is the total number of consensus nodes;
[0139] The formula for real-time reputation value is:
[0140]
[0141] In the formula, C i is the real-time reputation value of node i; i is the node indicator; is the initial reputation value of each node; α 1 is the weight of the reward mechanism; R(i) is the single reward value of the node; α 2 is the weight of the penalty mechanism; P(i) is the single penalty value of the node;
[0142]
[0143] Where ε is the number of times node i successfully participates in consensus; e is a natural constant;
[0144]
[0145] In the formula, bad i is the number of times that node i has consensus failures or other malicious behaviors; B is the threshold for the number of penalty triggers;
[0146] S4-6-1-3: Several consensus nodes constitute a consensus layer, and several storage nodes constitute a storage layer;
[0147] S4-6-2: Allocate the real-time coal supply data shards provided with the first search tag to the storage nodes of the storage layer, obtain the first storage location, create a corresponding first real-time storage request, and send the first real-time storage request to the consensus layer;
[0148] S4-6-3: The consensus node that receives the first real-time storage request is used as the master node, and consensus is reached on the first real-time storage request based on the master node and using a consensus algorithm;
[0149] S4-6-4: After the consensus is successful, the real-time coal supply data shard is encrypted according to the first public key in the corresponding first public-private key pair to obtain the encrypted real-time coal supply data shard, and the encrypted real-time coal supply data shard with the first search tag is locally stored using the allocated storage node;
[0150] S4-6-5: traverse all real-time coal supply data shards set with the first search tag until all real-time coal supply data shards are distributedly stored, and store the first storage locations and corresponding first search tags of all real-time coal supply data shards in the distributed ledger;
[0151] S5: Based on the power plant terminal, the real-time coal demand information is encrypted and signed according to the second private key and the second signature data in the second public-private key pair, the encrypted real-time coal demand information and the second real-time signature data are obtained, and uploaded to the cloud data center;
[0152] The formula is:
[0153] M u2 =E(SK u2 ,m u2 )
[0154] Where M u2 is the encrypted real-time coal demand information; E(*) is the asymmetric encryption function; m u Real-time coal demand information;
[0155]
[0156] Where r' is a random number; the second real-time signature data is {ID u2 ,γ"={K u2 ,R u2 ,M u2 ,B u2}}; R u2 ,B u2 ,γ" are the signature parameters of the power plant terminal u2;
[0157] Real-time coal demand information includes real-time purchase price of power plants, real-time coal purchase volume, real-time coal demand type, real-time coal transportation method, real-time purchase requirement information, and real-time coal trading account information;
[0158] S6: Based on the cloud data center, the second signature data is signature verified. After the signature verification is passed, the encrypted real-time coal demand information is decrypted according to the second public key in the corresponding second public-private key pair to obtain the decrypted real-time coal demand information;
[0159] The formula is:
[0160] β u2 B u2 P=β u2 H 2 (R u2 ,ID u2 ,M u2 ,K u2 )R u2 +β u2 K u2 +β u2 H 1 (ID u2 ,K u2 )PK u2
[0161] If the left formula is equal to the right formula, the signature verification is successful;
[0162] m u2 =E - (PK u2 ,M u2 )
[0163] In the formula, m u1 The real-time coal demand information after decryption; E - (*) is an asymmetric decryption function;
[0164] S7: Based on the cloud data center, according to the decrypted real-time coal demand information, the corresponding target real-time coal supply information is retrieved from a number of real-time coal supply information, and according to the target real-time coal supply information, the corresponding target decrypted real-time coal supply data is extracted from the blockchain network, including the following steps:
[0165] S7-1: Based on the cloud data center, a keyword extraction model is used to extract several real-time coal demand keywords of the decrypted real-time coal demand information;
[0166] S7-2: Obtain the Euclidean distance between a number of real-time coal demand keywords and each first search tag in the distributed ledger, and use the real-time coal supply information of the first search tag with the closest Euclidean distance as the corresponding target real-time coal supply information;
[0167] S7-3: extracting corresponding encrypted real-time coal supply data fragments of a plurality of targets according to the target first storage location corresponding to the target real-time coal supply information in the distributed ledger;
[0168] S7-4: decrypting the target encrypted real-time coal supply data slices according to the corresponding first public key to obtain a number of target decrypted real-time coal supply data slices;
[0169] S7-5: reorganizing a number of target decrypted real-time coal supply data fragments to obtain corresponding target decrypted real-time coal supply data;
[0170] S8: Based on the cloud data center, the corresponding real-time coal security transaction data is generated according to the decrypted real-time coal demand information and the target decrypted real-time coal supply data, and the real-time coal security transaction data is distributedly stored using the blockchain network, and a real-time transaction success signal is returned to the corresponding power plant terminal and coal supplier terminal, including the following steps:
[0171] S8-1: Based on the cloud data center, according to a number of real-time coal demand keywords of the decrypted real-time coal demand information and a number of target real-time coal supply keywords of the target decrypted real-time coal supply data, corresponding real-time coal security transaction data is generated;
[0172] Real-time coal safety transaction data includes real-time transaction price of successful transactions, real-time coal transaction volume, real-time coal transaction type, real-time scheduled coal transportation method, real-time requirement fulfillment information, and real-time coal transaction transfer time;
[0173] S8-2: According to the replica mechanism, the real-time electric coal safety transaction data is sharded to obtain a number of real-time electric coal safety transaction data shards including the replica data shards, and a number of real-time electric coal demand keywords are used as the second search tag of each real-time electric coal safety transaction data shard;
[0174] S8-3: Using the blockchain network, a plurality of real-time coal safety transaction data shards with second search tags are distributedly stored, and the second storage location and second search tag of each real-time coal safety transaction data shard are stored in a distributed ledger, including the following steps:
[0175] S8-3-1: Allocate the real-time coal safety transaction data shards provided with the second search tag to the storage nodes of the storage layer, obtain the second storage location, create a corresponding second real-time storage request, and send the second real-time storage request to the consensus layer;
[0176] S8-3-2: The consensus node that receives the second real-time storage request is used as the master node, and consensus is reached on the second real-time storage request based on the master node and using a consensus algorithm;
[0177] S8-3-3: After consensus is successful, the real-time electric coal safety transaction data shard is encrypted according to the corresponding first public key and the second public key to obtain the encrypted real-time electric coal safety transaction data shard, and the real-time electric coal safety transaction data shard with the second retrieval tag is locally stored using the allocated storage node;
[0178] The formula is:
[0179] M u1u2 =E(PK u1 |PK u2 ,m u1u2 )
[0180] Where M u1u2 Sharding for encrypted real-time coal security transaction data; u1u2 Sharding for real-time coal safety transaction data; PK u1 |PK u2 A mixed key consisting of a first public key and a second public key, generally obtained by concatenating the first public key and the second public key;
[0181] S8-3-4: Traverse all real-time electric coal safety transaction data shards set with the second search tag until all real-time electric coal safety transaction data shards are distributedly stored, and store the second storage locations and corresponding second search tags of all real-time electric coal safety transaction data shards in the distributed ledger.
[0182] Embodiment 2:
[0183] like Figure 2 As shown, this embodiment provides a blockchain-based electric coal security transaction system for implementing an electric coal security transaction method. The system includes a cloud data center, a trusted institution, several electric coal supplier terminals, and several power plant terminals. Each electric coal supplier terminal and each power plant terminal are respectively connected to the cloud data center and the trusted institution for communication, and the trusted institution is connected to the cloud data center for communication;
[0184] The trusted institution is used to perform key generation and identity authentication based on the collected basic information of all suppliers and all power plants, and obtain the first public-private key pair and first signature data of each power coal supplier terminal, and the second public-private key pair and second signature data of each power plant terminal;
[0185] The electric coal supplier terminal is used to encrypt and sign the real-time electric coal supply data according to the first private key and the first signature data in the first public-private key pair, obtain the encrypted real-time electric coal supply data and the first real-time signature data, and upload them to the cloud data center;
[0186] The power plant terminal is used to encrypt and sign the real-time coal demand information according to the second private key and the second signature data in the second public-private key pair, obtain the encrypted real-time coal demand information and the second real-time signature data, and upload them to the cloud data center;
[0187] The cloud data center includes a model building unit, a signature verification and decryption unit, a legitimacy verification unit, a distributed storage unit, a target data retrieval unit, and a power coal security transaction unit;
[0188] A model building unit, used to build a keyword extraction model and a data analysis model;
[0189] The signature verification and decryption unit is used to perform signature verification on the first signature data. After the signature verification is passed, the encrypted real-time coal supply data is decrypted according to the first public key in the corresponding first public-private key pair to obtain the decrypted real-time coal supply data; the second signature data is signature verified. After the signature verification is passed, the encrypted real-time coal demand information is decrypted according to the second public key in the corresponding second public-private key pair to obtain the decrypted real-time coal demand information;
[0190] A legality verification unit is used to verify the legality of the decrypted real-time coal supply data. After the legality verification is passed, a keyword extraction model and a data analysis model are used to generate real-time coal supply information of the decrypted real-time coal supply data;
[0191] A distributed storage unit is used to use the blockchain network to perform distributed storage of the decrypted real-time coal supply data and real-time coal supply information; use the blockchain network to perform distributed storage of the real-time coal security transaction data, and return a real-time transaction success signal to the corresponding power plant terminal and coal supplier terminal;
[0192] A target data retrieval unit is used to retrieve corresponding target real-time coal supply information from a number of real-time coal supply information according to the decrypted real-time coal demand information, and extract corresponding target decrypted real-time coal supply data from the blockchain network according to the target real-time coal supply information;
[0193] The electric coal safety transaction unit is used to generate corresponding real-time electric coal safety transaction data according to the decrypted real-time electric coal demand information and the target decrypted real-time electric coal supply data.
[0194] The invention provides a method and system for safe transaction of electric coal based on blockchain, which adopts asymmetric encryption technology and digital signature technology to ensure the confidentiality and integrity of data during transmission, effectively solves the problem of insufficient data security in traditional methods, and prevents the risk of data leakage and tampering; through the distributed storage technology of decentralized, tamper-proof and highly transparent blockchain, an additional security layer is provided for data storage, ensuring that data cannot be tampered with and the source of data can be traced; compared with traditional centralized storage, distributed storage reduces the risk of single point failure and improves the reliability and robustness of data storage; the public ledger feature of blockchain makes the electric coal transaction process transparent to all participants, solves the problem of information asymmetry, and enhances the trust between the two parties to the transaction; keyword extraction model and data analysis model are used to improve the efficiency of data management, and cloud management is used to effectively manage and maintain data related to electric coal transactions, which reduces the complexity and cost of data management, simplifies the transaction process, reduces manual intervention, and greatly improves the efficiency of electric coal transactions.
[0195] The present invention is not limited to the above optional implementations, and anyone can derive other various forms of products under the enlightenment of the present invention. The above specific implementations should not be understood as limiting the scope of protection of the present invention. The scope of protection of the present invention should be based on the definition in the claims, and the description can be used to interpret the claims.
Claims
1. A method for safe trading of electric coal based on blockchain, characterized by: The steps include: Based on the trusted institution, key generation and identity authentication are performed according to the collected basic information of all suppliers and all power plants, and the first public-private key pair and first signature data of each power coal supplier terminal, as well as the second public-private key pair and second signature data of each power plant terminal are obtained; Based on the electric coal supplier terminal, the real-time electric coal supply data is encrypted and signed according to the first private key and the first signature data in the first public-private key pair, the encrypted real-time electric coal supply data and the first real-time signature data are obtained, and uploaded to the cloud data center; Based on the cloud data center, the first signature data is signature verified. After the signature verification is passed, the encrypted real-time coal supply data is decrypted according to the first public key in the corresponding first public-private key pair to obtain the decrypted real-time coal supply data; Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. After the legitimacy verification is passed, the keyword extraction model and data analysis model are used to generate the real-time coal supply information of the decrypted real-time coal supply data, and the blockchain network is used to distribute the decrypted real-time coal supply data and real-time coal supply information. Based on the power plant terminal, the real-time coal demand information is encrypted and signed according to the second private key and the second signature data in the second public-private key pair, the encrypted real-time coal demand information and the second real-time signature data are obtained, and uploaded to the cloud data center; Based on the cloud data center, the second signature data is signature verified. After the signature verification is passed, the encrypted real-time coal demand information is decrypted according to the second public key in the corresponding second public-private key pair to obtain the decrypted real-time coal demand information; Based on the cloud data center, according to the decrypted real-time coal demand information, the corresponding target real-time coal supply information is retrieved from a number of real-time coal supply information, and according to the target real-time coal supply information, the corresponding target decrypted real-time coal supply data is extracted from the blockchain network; Based on the cloud data center, the corresponding real-time coal security transaction data is generated according to the decrypted real-time coal demand information and the target decrypted real-time coal supply data. The blockchain network is used to distribute the real-time coal security transaction data and return the real-time transaction success signal to the corresponding power plant terminal and coal supplier terminal.
2. A method for safe coal trading based on blockchain according to claim 1, characterized in that: Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. After the legitimacy verification is passed, the keyword extraction model and the data analysis model are used to generate the real-time coal supply information of the decrypted real-time coal supply data, and the blockchain network is used to perform distributed storage of the decrypted real-time coal supply data and the real-time coal supply information, including the following steps: Based on the cloud data center, the decrypted real-time coal supply data is verified for legitimacy. If there is a verification failure item, the legitimacy verification fails, the corresponding decrypted real-time coal supply data is deleted, and the data upload step is ended. Otherwise, the legitimacy verification passes and proceeds to the next step. After the legitimacy verification is passed, a keyword extraction model is used to extract several real-time coal supply keywords from the decrypted real-time coal supply data; Use the data analysis model to analyze the decrypted real-time coal supply data and obtain real-time data analysis results; According to a number of real-time coal supply keywords and real-time data analysis results, real-time coal supply information of decrypted real-time coal supply data is generated; According to the copy mechanism, the decrypted real-time coal supply data is sharded to obtain a number of real-time coal supply data shards including the copy data shards, and the real-time coal supply information is used as the first search tag of each real-time coal supply data shard; Using a blockchain network, a number of real-time coal supply data slices with a first search tag are distributedly stored, and the first storage location and the first search tag of each real-time coal supply data slice are stored in a distributed ledger.
3. A method for safe transaction of electric coal based on blockchain according to claim 2, characterized in that: The legality verification includes data format verification, data content verification, integrity verification, timestamp verification, regulatory compliance verification, data quality verification, supply chain verification and third-party verification performed in sequence.
4. A method for safe coal trading based on blockchain according to claim 2, characterized in that: The keyword extraction model is constructed based on the TF-IDF-CI algorithm.
5. According to a blockchain-based method for safe coal trading according to claim 2, it is characterized by: The data analysis model is built based on the RF-Attention-BiLSTM algorithm.
6. A method for safe transaction of electric coal based on blockchain according to claim 2, characterized in that: Using a blockchain network, a plurality of real-time coal supply data shards provided with a first search tag are distributedly stored, and a first storage location and a first search tag of each real-time coal supply data shard are stored in a distributed ledger, including the following steps: Using a hierarchical mechanism, several nodes in the blockchain network are divided into consensus nodes to obtain a consensus layer composed of several consensus nodes, and the remaining nodes are divided into storage nodes to obtain a storage layer composed of several storage nodes; Allocate the real-time coal supply data shards provided with the first search tag to the storage nodes of the storage layer, obtain the first storage location, create a corresponding first real-time storage request, and send the first real-time storage request to the consensus layer; The consensus node that receives the first real-time storage request is used as the master node, and consensus is reached on the first real-time storage request based on the master node and using a consensus algorithm; After the consensus is successful, the real-time coal supply data slice is encrypted according to the first public key in the corresponding first public-private key pair to obtain the encrypted real-time coal supply data slice, and the encrypted real-time coal supply data slice with the first search tag is locally stored using the allocated storage node; All real-time coal supply data shards with the first search tag are traversed until all real-time coal supply data shards are distributedly stored, and the first storage locations and corresponding first search tags of all real-time coal supply data shards are stored in the distributed ledger.
7. A method for safe transaction of electric coal based on blockchain according to claim 6, characterized in that: Based on the cloud data center, according to the decrypted real-time coal demand information, the corresponding target real-time coal supply information is retrieved from a number of real-time coal supply information, and according to the target real-time coal supply information, the corresponding target decrypted real-time coal supply data is extracted in the blockchain network, including the following steps: Based on the cloud data center, a keyword extraction model is used to extract several real-time coal demand keywords from the decrypted real-time coal demand information; Obtain the Euclidean distance between several real-time coal demand keywords and each first search tag in the distributed ledger, and use the real-time coal supply information of the first search tag with the closest Euclidean distance as the corresponding target real-time coal supply information; According to the target first storage location corresponding to the target real-time coal supply information in the distributed ledger, extract the corresponding encrypted real-time coal supply data fragments of several targets; Decrypting the target encrypted real-time coal supply data slices according to the corresponding first public key to obtain a plurality of target decrypted real-time coal supply data slices; The real-time coal supply data after decryption of several targets are reorganized to obtain the corresponding real-time coal supply data after decryption of the targets.
8. A method for safe transaction of electric coal based on blockchain according to claim 6, characterized in that: Based on the cloud data center, the corresponding real-time coal security transaction data is generated according to the decrypted real-time coal demand information and the target decrypted real-time coal supply data. The blockchain network is used to store the real-time coal security transaction data in a distributed manner, and a real-time transaction success signal is returned to the corresponding power plant terminal and coal supplier terminal, including the following steps: Based on the cloud data center, according to a number of real-time coal demand keywords of the decrypted real-time coal demand information and a number of target real-time coal supply keywords of the target decrypted real-time coal supply data, corresponding real-time coal security transaction data is generated; According to the replica mechanism, the real-time electric coal safety transaction data is sharded to obtain a number of real-time electric coal safety transaction data shards including the replica data shards, and a number of real-time electric coal demand keywords are used as the second search tag of each real-time electric coal safety transaction data shard; Using the blockchain network, a number of real-time electric coal safety transaction data shards with second search tags are distributedly stored, and the second storage location and the second search tag of each real-time electric coal safety transaction data shard are stored in the distributed ledger.
9. A method for safe transaction of electric coal based on blockchain according to claim 8, characterized in that: Using a blockchain network, a plurality of real-time coal-fired safety transaction data shards provided with a second search tag are distributedly stored, and the second storage location and the second search tag of each real-time coal-fired safety transaction data shard are stored in a distributed ledger, including the following steps: Allocate the real-time coal safety transaction data shards provided with the second search tag to the storage nodes of the storage layer, obtain the second storage location, create a corresponding second real-time storage request, and send the second real-time storage request to the consensus layer; The consensus node that receives the second real-time storage request is used as the master node, and consensus is reached on the second real-time storage request based on the master node and using a consensus algorithm; After the consensus is successful, the real-time electric coal safety transaction data shard is encrypted according to the corresponding first public key and the second public key to obtain the encrypted real-time electric coal safety transaction data shard, and the real-time electric coal safety transaction data shard with the second search tag is locally stored using the allocated storage node; Traverse all real-time electric coal safety transaction data shards set with second search tags until all real-time electric coal safety transaction data shards are distributedly stored, and store the second storage locations and corresponding second search tags of all real-time electric coal safety transaction data shards in the distributed ledger.
10. A power coal safety transaction system based on blockchain, used to implement the power coal safety transaction method as described in any one of claims 1 to 9, characterized in that: The system includes a cloud data center, a trusted institution, several coal supplier terminals and several power plant terminals, each of the coal supplier terminals and each of the power plant terminals are respectively connected to the cloud data center and the trusted institution, and the trusted institution is connected to the cloud data center; The cloud data center includes a model building unit, a signature verification and decryption unit, a legality verification unit, a distributed storage unit, a target data retrieval unit and a power coal safety transaction unit.
Citation Information
Cited By
Block chain data management system and method based on privacy calculation
CN120086892A
Jewelry transaction data secure storage method and system based on block chain
CN120104698A
A blockchain-based method and system for secure storage of jewelry transaction data
CN120104698B