Blockchain-based method and system for managing financial data of multiple tobacco stations

CN122692811APending Publication Date: 2026-09-04YUNNAN TOBACCO CORP QUJING BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610033582.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-12
Publication Date
2026-09-04

AI Technical Summary

Technical Problem

首先,现有技术中各烟站财务数据存储分散,数据孤岛现象严重,中心化存储系统容易出现单点故障,导致数据丢失或无法访问,数据安全性得不到有效保障

Benefits of technology

本发明实施例提供的基于区块链的多个烟站财务数据管理方法,通过智能合约对财务数据进行阈值比对,当数据异常时自动向管理终端发送预警信息,实现了财务数据的实时监控和异常预警,提高了财务风险管控的及时性和有效性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122692811A_ABST
    Figure CN122692811A_ABST
Patent Text Reader

Abstract

The application provides a blockchain-based financial data management method and system for multiple tobacco stations, relates to the technical fields of blockchain and financial data management, and comprises the following steps: receiving financial data uploaded by a tobacco station; obtaining a corresponding smart contract and comparing the same with a historical financial data threshold value; when the financial data exceeds a preset range, automatically sending an abnormal early warning; encapsulating the financial data as a blockchain transaction and generating a block to be added to a blockchain; receiving a data query request and performing hierarchical processing according to a preset desensitization rule, and returning financial data with different degrees of desensitization. The application realizes the safe storage, abnormal monitoring and hierarchical authorization query of the financial data of the tobacco station, and improves the security and credibility of data management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of blockchain and financial data management technology, and in particular to a blockchain-based method and system for managing financial data of multiple tobacco stations. Background Technology

[0002] With the rapid development of information technology, the tobacco industry, as a special sector, has gradually achieved informatization and systematization in its management. Traditionally, financial data management in the tobacco industry relied on independent recording and reporting by each tobacco station, with data stored in their respective financial systems or databases. Headquarters then accessed and aggregated the financial data from each station via network connections. While this management method improved the transparency and efficiency of financial data to some extent, its shortcomings have become apparent with the increase in data volume and management requirements.

[0003] The existing financial data management technology for tobacco stations has the following defects and shortcomings: First, in existing technologies, the financial data of each tobacco station is stored in a scattered manner, resulting in severe data silos. Centralized storage systems are prone to single points of failure, leading to data loss or inaccessibility, and data security cannot be effectively guaranteed. Furthermore, data cannot be effectively shared between tobacco stations, hindering the full realization of the overall data value.

[0004] Secondly, traditional financial data management lacks an effective anomaly monitoring mechanism. Anomalies in financial data often require manual review to be discovered, and real-time warnings are not possible. This leads to the inability to detect and handle financial risks in a timely manner, increasing the difficulty of risk management and affecting management efficiency.

[0005] Third, the existing financial data query and sharing mechanism of tobacco stations is imperfect and lacks data anonymization processing for different access subjects. This can easily lead to the leakage of sensitive information during the data query and sharing process, making it difficult to achieve a secure and controllable data sharing mechanism, which is not conducive to the in-depth exploration and application of data value in the tobacco industry. Summary of the Invention

[0006] This invention provides a method and system for managing financial data of multiple tobacco stations based on blockchain, which can solve the problems in the prior art.

[0007] A first aspect of the present invention, Provides a blockchain-based approach to managing the financial data of multiple tobacco stations, including: Receive financial data uploaded by multiple tobacco stations; The system obtains the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds. The financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The financial data is encapsulated into blockchain transactions, and the blockchain transactions are packaged into blocks based on a preset consensus algorithm. The blocks are added to the blockchain, and the data is synchronized across multiple nodes in the blockchain network. The system receives data query requests from multiple tobacco stations, retrieves the financial data from the blockchain according to the query requests, performs hierarchical desensitization processing on the retrieved financial data according to pre-set data desensitization rules, and returns financial data with different desensitization levels for data query requests of different security levels.

[0008] The process involves encapsulating the financial data into blockchain transactions, packaging these transactions into blocks based on a preset consensus algorithm, adding the blocks to the blockchain, and synchronizing the data across multiple nodes in the blockchain network. A transaction data structure is generated based on the financial data, and a digital signature is performed on the transaction data structure based on the elliptic curve digital signature algorithm to generate a blockchain transaction. The system obtains the transaction value magnitude, time urgency, and user credit score of the blockchain transactions. It calculates a magnitude score based on the transaction value magnitude, an urgency score based on the time urgency, and a credit score based on the user credit score. The system then performs a weighted sum of the magnitude score, urgency score, and credit score to obtain the transaction processing priority. The blockchain transactions are then sorted according to the processing priority. A dynamic block size adjustment mechanism is used to package the sorted blockchain transactions into blocks. The generated blocks are added to the blockchain, and data synchronization is performed among the nodes of the blockchain network.

[0009] The method further includes: A two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of malicious nodes that can be tolerated is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered to obtain the initial stake value and online time of each node. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated, and a block-producing node is selected according to the probability.

[0010] A two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of malicious nodes that can be tolerated is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered, where the initial stake value and online time of each node are obtained. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated. The selection of block-producing nodes based on the probability includes: Obtain the total number of nodes in the blockchain network, and calculate the tolerable malicious node number threshold based on the total number of nodes as the benchmark value for the first layer consensus verification. The malicious node number threshold is the integer part of one-third of the total number of nodes minus one. A pre-verification message is generated based on the block hash value, node identifier, timestamp, and digital signature and broadcast in the blockchain network. The number of nodes that vote in agreement on the pre-verification message is counted. When the number exceeds twice the tolerable number of malicious nodes plus one, the second layer of consensus verification is triggered. In the second-layer consensus verification, the initial equity value of each node is first calculated by weighting the pledge amount, historical transaction volume and credit score of each node. At the same time, the total online time and continuous online time of each node are obtained and weighted to calculate the online time influence factor. By multiplying the initial equity value of each node with the corresponding online time influence factor, the comprehensive weight reflecting the overall contribution of the node is obtained. Based on the comprehensive weight of each node, the proportion of the comprehensive weight of each node to the sum of the comprehensive weights of all nodes is calculated, and this proportion is used as the block production probability of the node. Then, a random number is generated. When the random number corresponding to the node is less than or equal to the block production probability, the node is determined as the final block production node.

[0011] The system receives data query requests from multiple tobacco stations, retrieves the financial data from the blockchain according to the query requests, and performs hierarchical desensitization processing on the retrieved financial data according to pre-set data desensitization rules. For data query requests of different security levels, it returns financial data with different degrees of desensitization, including: Receive a data query request, the data query request including the identity information of the querying subject, the permission level information, and the query content information; Obtain the historical behavior credit score and identity authentication level score of the query subject, and use the sum of the product of the historical behavior credit score and the first preset weight and the product of the identity authentication level score and the second preset weight as the identity credibility. The sensitivity of the fields in the query content information is calculated using the information entropy calculation method to obtain the field sensitivity. The query content is divided into different sensitivity levels based on the field sensitivity, and the desensitization processing strategy for different fields is determined based on the sensitivity level. Based on the identity credibility, the permission level information, and the sensitivity level, calculate the security score of the data query request, and determine the de-identification processing level based on the security score; The financial data corresponding to the query content is obtained from the blockchain. Based on the desensitization processing strategy and the desensitization processing level, the numerical data in the financial data is desensitized using a random perturbation coefficient, and the character data in the financial data is desensitized using a replacement matrix, thereby achieving differentiated desensitization processing.

[0012] The sensitivity of the fields in the query content information is calculated using the information entropy calculation method to obtain field sensitivity. Based on the field sensitivity, the query content is divided into different sensitivity levels, and desensitization strategies for different fields are determined based on these sensitivity levels, including: By statistically analyzing the frequency of occurrence of different values ​​in each field to be evaluated, the ratio of the frequency of occurrence of each value to the total frequency of the field is calculated to obtain the probability of the value. The opposite of the product of the probability of the value and the logarithm of the probability of the value are summed to obtain the field information entropy, which represents the information content of the field. Obtain the business value score that reflects the importance of a field, and calculate the direct sensitivity by weighting the field information entropy and the business value score. At the same time, calculate the correlation strength between fields, and combine the direct sensitivity score that represents the sensitivity of the field itself with the indirect sensitivity score that represents the influence of the correlation by weighting to obtain the comprehensive sensitivity score that fully reflects the sensitivity of the field. Based on the comprehensive sensitivity, the fields are divided into sensitivity levels, multi-level sensitivity thresholds are set and compared with the comprehensive sensitivity to determine the sensitivity level of each field. At the same time, sensitivity deviation is calculated based on historical evaluation data, and the multi-level sensitivity thresholds are adaptively adjusted using the sensitivity deviation. For fields with different sensitivity levels, the desensitization intensity is obtained by calculating the ratio of the overall sensitivity to the maximum sensitivity and multiplying the ratio by the desensitization base. The corresponding desensitization processing strategy is then selected based on the desensitization intensity.

[0013] A second aspect of this invention provides a blockchain-based financial data management system for multiple tobacco stations, comprising: The first unit is used to receive financial data uploaded by multiple tobacco stations; The second unit is used to obtain the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds, and the financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The third unit is used to encapsulate the financial data into blockchain transactions, package the blockchain transactions into blocks based on a preset consensus algorithm, add the blocks to the blockchain, and synchronize the data among multiple nodes in the blockchain network. The fourth unit is used to receive data query requests from the multiple tobacco stations, obtain the financial data from the blockchain according to the query request, and perform hierarchical desensitization processing on the obtained financial data according to the pre-set data desensitization rules, and return the financial data with different desensitization degrees for data query requests with different security levels.

[0014] A third aspect of the present invention, An electronic device is provided, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0015] Fourth aspect of the embodiments of the present invention, A computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0016] The beneficial effects of this application are as follows: The blockchain-based financial data management method for multiple tobacco stations provided in this invention uses smart contracts to perform threshold comparisons on financial data. When data is abnormal, it automatically sends early warning information to the management terminal, realizing real-time monitoring and early warning of anomalies in financial data, and improving the timeliness and effectiveness of financial risk control.

[0017] By encapsulating financial data into blockchain transactions and adding them to the blockchain, the decentralized, immutable, and traceable characteristics of the blockchain are utilized to ensure the security and credibility of financial data from multiple tobacco stations, effectively preventing malicious tampering of financial data and enhancing the authenticity and reliability of the data.

[0018] Based on pre-set data anonymization rules, financial data is subjected to hierarchical anonymization processing. Different levels of anonymization are returned for query requests with different security levels. This satisfies data query needs while protecting sensitive information, realizes secure sharing of financial data and differentiated authorized access, and improves the security and flexibility of the system. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a blockchain-based method for managing financial data of multiple tobacco stations, as described in an embodiment of the present invention. Figure 2 A bar chart comparing the overall performance of the two-layer consensus mechanism implemented in this invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] The technical solution of the present invention will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes will not be repeated in some embodiments.

[0022] Figure 1 This is a flowchart illustrating a blockchain-based method for managing financial data at multiple tobacco stations, as described in an embodiment of the present invention. Figure 1 As shown, the method includes: Receive financial data uploaded by multiple tobacco stations; The system obtains the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds. The financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The financial data is encapsulated into blockchain transactions, and the blockchain transactions are packaged into blocks based on a preset consensus algorithm. The blocks are added to the blockchain, and the data is synchronized across multiple nodes in the blockchain network. The system receives data query requests from multiple tobacco stations, retrieves the financial data from the blockchain according to the query requests, performs hierarchical desensitization processing on the retrieved financial data according to pre-set data desensitization rules, and returns financial data with different desensitization levels for data query requests of different security levels.

[0023] In one optional implementation, the financial data is encapsulated into blockchain transactions, and the blockchain transactions are packaged into blocks based on a preset consensus algorithm. The blocks are then added to the blockchain, and data synchronization is performed across multiple nodes in the blockchain network, including: A transaction data structure is generated based on the financial data, and a digital signature is performed on the transaction data structure based on the elliptic curve digital signature algorithm to generate a blockchain transaction. The system obtains the transaction value magnitude, time urgency, and user credit score of the blockchain transactions. It calculates a magnitude score based on the transaction value magnitude, an urgency score based on the time urgency, and a credit score based on the user credit score. The system then performs a weighted sum of the magnitude score, urgency score, and credit score to obtain the transaction processing priority. The blockchain transactions are then sorted according to the processing priority. A dynamic block size adjustment mechanism is used to package the sorted blockchain transactions into blocks. The generated blocks are added to the blockchain, and data synchronization is performed among the nodes of the blockchain network.

[0024] This invention provides a method embodiment for encapsulating financial data into blockchain transactions and generating blocks based on a consensus algorithm. In this embodiment, the system first receives financial data, which may be a company's daily income and expenditure details, financial statements, or transaction records. This financial data typically includes elements such as information of the transacting parties, transaction amount, transaction time, and transaction type.

[0025] The system generates a transaction data structure based on the received financial data. This transaction data structure consists of two parts: a transaction header and a transaction body. The transaction header contains metadata information such as version number, timestamp, input count, and output count. The transaction body contains detailed transaction information, such as the payer's address, payee's address, transaction amount, and additional transaction information. For example, for a payment transaction of 10,000 yuan, the system will set the payer's address to "0x7F9A23CD456EFG", the payee's address to "0x8E2B34DE567HIJ", the transaction amount to 10,000 yuan, and record the purpose of the transaction as "raw material procurement" in the additional transaction information.

[0026] After generating the transaction data structure, the system digitally signs the transaction data structure based on the Elliptic Curve Digital Signature Algorithm (ECDSA). During the signing process, the system first uses the SHA-256 hash algorithm to calculate the hash value of the transaction data structure, and then uses the private key of the transaction initiator to sign the hash value. Assuming the hash value of the transaction data structure is "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b", the signature value obtained after signing with the private key can be "304402205f7f3eb8a18d3d70d87581e11f5d58ad52d9647020eae55321ddd6369995bf9102200cf37b41c5ec202313781029a6797b878ab2aa8a8a2a045d751e02ebc4e99d16". After signing, the system adds the signature value to the transaction data structure, forming a complete blockchain transaction.

[0027] After generating a blockchain transaction, the system needs to obtain the transaction's key attributes to calculate its processing priority. The system first obtains the transaction's magnitude, i.e., the size of the transaction amount. For the aforementioned transaction of 10,000 yuan, its magnitude is 10,000. The system calculates a magnitude score according to preset magnitude scoring rules. For example, when the transaction amount is between 1 and 1,000 yuan, the magnitude score is 1 point; between 1,001 and 10,000 yuan, the magnitude score is 2 points; between 10,001 and 100,000 yuan, the magnitude score is 3 points; and exceeding 100,000 yuan, the magnitude score is 4 points. Therefore, this 10,000 yuan transaction has a magnitude score of 2 points.

[0028] The system also acquires the time urgency of a transaction, i.e., how urgently the transaction needs to be processed. Time urgency is determined based on the difference between the transaction's set deadline and the current time. For example, if the deadline is 2 hours after the current time, the system considers it a high-urgency transaction; if the deadline is 24 hours after the current time, it's considered a medium-urgency transaction; and if the deadline exceeds 24 hours after the current time, it's considered a low-urgency transaction. The system calculates an urgency score according to urgency scoring rules. For example, a high-urgency transaction scores 3 points, a medium-urgency transaction scores 2 points, and a low-urgency transaction scores 1 point. Assuming the transaction's deadline is 10 hours after the current time, it falls under the medium-urgency category and has an urgency score of 2 points.

[0029] Simultaneously, the system acquires the user's credit score, i.e., the credit rating of the transaction initiator. User credit score is comprehensively assessed based on factors such as historical transaction records, account activity, and history of credit defaults. The system calculates the credit score according to user credit scoring rules. For example, a user with extremely high credit scores 5 points, a user with high credit scores 4 points, a user with medium credit scores 3 points, a user with low credit scores 2 points, and a user with extremely low credit scores 1 point. Assuming the transaction initiator has a historical transaction success rate of 98% and no default records, the system assesses them as a user with high credit, with a credit score of 4 points.

[0030] The system calculates transaction processing priority based on a weighted sum of magnitude score, urgency score, and credit score. Assuming the weights for magnitude score, urgency score, and credit score are 0.3, 0.5, and 0.2 respectively, the processing priority of this transaction is: 2 × 0.3 + 2 × 0.5 + 4 × 0.2 = 0.6 + 1.0 + 0.8 = 2.4. The system then sorts all pending blockchain transactions according to their calculated processing priorities, placing higher-priority transactions first.

[0031] After sorting, the system uses a dynamic block size adjustment mechanism to package the sorted blockchain transactions into blocks. This mechanism dynamically adjusts the block size based on factors such as the current network state, transaction processing speed, and the number of transactions waiting to be processed in the mempool. For example, when the network is congested, the system can adjust the block size to 2MB to accommodate more transactions; when the network is idle, the block size can be adjusted to 1MB to reduce resource consumption. The system packages transactions with higher priority first, until the current block size limit is reached or all transactions are packaged.

[0032] The system adds the generated block to the blockchain. The addition process includes updating the latest block hash value, updating the block height, and updating the blockchain's state database. After addition is complete, the system synchronizes data among the nodes in the blockchain network. The synchronization process uses a P2P network communication protocol, where each node broadcasts the newly generated block to other nodes it is connected to. Nodes receiving the new block verify its validity, including verifying the block hash value, transaction signature, and transaction content. Once verification is successful, the node adds the block to its respective blockchain replica, thus ensuring data consistency across the entire blockchain network.

[0033] In one optional implementation, the method further includes: A two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of malicious nodes that can be tolerated is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered to obtain the initial stake value and online time of each node. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated, and a block-producing node is selected according to the probability.

[0034] This invention provides a blockchain network method based on a two-layer consensus mechanism. The method includes constructing a two-layer consensus mechanism, performing practical Byzantine fault-tolerant pre-verification through the first-layer consensus mechanism, and dynamically selecting block-producing nodes based on stake value and online duration in the second-layer consensus.

[0035] In this embodiment, the method first calculates the total number of nodes in the blockchain network. A node in a blockchain network refers to each computing device participating in the operation of the blockchain network; each node can independently verify transaction and block information. For example, in a blockchain network consisting of 100 nodes, the total number of nodes is 100.

[0036] Based on system security requirements, this method sets a threshold for the number of tolerable malicious nodes. A malicious node is defined as a node capable of attacking the network or submitting erroneous information. According to Byzantine fault tolerance theory, the number of malicious nodes a system can tolerate typically does not exceed one-third of the total number of nodes. For example, in a network with 100 nodes, the threshold for the number of tolerable malicious nodes can be set to 33.

[0037] In the first-layer consensus mechanism, this method performs Practical Byzantine Fault Tolerance (PBFT) pre-verification. The PBFT pre-verification process includes a request phase, a pre-preparation phase, a preparation phase, and a confirmation phase. When the blockchain network receives a new transaction request, the master node broadcasts the received transaction request to all nodes and assigns a sequence number to the transaction request, forming a pre-preparation message which is sent to all other nodes. Upon receiving the pre-preparation message, other nodes verify the message's legitimacy, including verifying the validity of the digital signature, the sequence number, and the message digest. After successful verification, the node enters the preparation phase, broadcasting the preparation message to all nodes in the network.

[0038] When a node receives more than 2f preparation messages (where f is the maximum tolerable number of malicious nodes) and the view number, sequence number, and request digest of these messages all match its own preparation message, the node confirms the completion of the preparation phase and enters the confirmation phase, broadcasting a confirmation message to all nodes. When a node receives at least 2f+1 confirmation messages (including its own confirmation message) and the view number, sequence number, and request digest of these messages are all consistent, the transaction is confirmed as valid by that node.

[0039] For example, in a network of 100 nodes, pre-verification is considered successful after receiving confirmation messages from at least 67 nodes (2f+1, where f=33). Through the first-layer PBFT pre-verification, the system ensures the consistency and tamper-proof nature of transaction requests, laying the foundation for the second-layer consensus.

[0040] After the first-layer consensus mechanism is completed, the method collects pre-verification success information from each node. The system maintains a list of pre-verification results, recording whether each node has passed pre-verification and related information such as verification timestamp and node identifier. Only nodes that have passed pre-verification can participate in the second-layer consensus.

[0041] Before entering the second layer of consensus, this method obtains the initial stake value and online time of each pre-verified node. The initial stake value refers to the size of a node's stake in the system, which can be the number of tokens staked, the account balance, or its contribution, etc. Online time refers to the length of time a node continuously participates in network operation, usually measured in hours or days.

[0042] For example, node A has an initial equity value of 100 units and an online duration of 10 days; node B has an initial equity value of 80 units and an online duration of 15 days; and node C has an initial equity value of 120 units and an online duration of 8 days. The system records this information for subsequent calculations.

[0043] This method calculates the probability of each node being selected as a block-producing node based on the proportion of the product of a node's initial stake value and its online duration to the sum of all such products. The specific calculation steps are as follows: For each node that passes pre-verification, calculate the product of its initial stake value and its online duration; calculate the sum of the products of all nodes; the probability of each node being selected as a block-producing node is equal to that node's product value divided by the total product value.

[0044] Taking the three nodes mentioned above as examples, the product of node A is 100 × 10 = 1000, the product of node B is 80 × 15 = 1200, and the product of node C is 120 × 8 = 960. The total product is 1000 + 1200 + 960 = 3160. Therefore, the probability that node A is selected as a block-producing node is 1000 / 3160 ≈ 31.65%, the probability that node B is selected is 1200 / 3160 ≈ 37.97%, and the probability that node C is selected is 960 / 3160 ≈ 30.38%.

[0045] Based on the calculated probabilities, this method uses a random number generation algorithm to select the block-producing node. The system generates a random number between 0 and 1, and determines the block-producing node based on the probability range of which node the random number falls into. For example, if the random number is 0.25, then node A will be selected as the block-producing node; if the random number is 0.35, then node B will be selected as the block-producing node; and if the random number is 0.85, then node C will be selected as the block-producing node.

[0046] The selected block-producing node has the right to create a new block in the current round, package the transactions, and broadcast it to other nodes in the network. Other nodes verify the validity of the block, including the legality of the transactions and the correctness of the block structure. After successful verification, the node adds the block to its local blockchain.

[0047] This two-layer consensus mechanism leverages PBFT's high fault tolerance for malicious nodes while employing a probabilistic selection mechanism based on stake and online duration to achieve fair and efficient block-producing node selection, thereby improving the security, reliability, and efficiency of the blockchain network. This method is particularly suitable for consortium blockchains or private blockchain environments, effectively resisting various consensus attacks and incentivizing nodes to participate stably in network operation over the long term.

[0048] In one optional implementation, a two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of tolerable malicious nodes is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered to obtain the initial stake value and online time of each node. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated. The selection of block-producing nodes based on the probability includes: Obtain the total number of nodes in the blockchain network, and calculate the tolerable malicious node number threshold based on the total number of nodes as the benchmark value for the first layer consensus verification. The malicious node number threshold is the integer part of one-third of the total number of nodes minus one. A pre-verification message is generated based on the block hash value, node identifier, timestamp, and digital signature and broadcast in the blockchain network. The number of nodes that vote in agreement on the pre-verification message is counted. When the number exceeds twice the tolerable number of malicious nodes plus one, the second layer of consensus verification is triggered. In the second-layer consensus verification, the initial equity value of each node is first calculated by weighting the pledge amount, historical transaction volume and credit score of each node. At the same time, the total online time and continuous online time of each node are obtained and weighted to calculate the online time influence factor. By multiplying the initial equity value of each node with the corresponding online time influence factor, the comprehensive weight reflecting the overall contribution of the node is obtained. Based on the comprehensive weight of each node, the proportion of the comprehensive weight of each node to the sum of the comprehensive weights of all nodes is calculated, and this proportion is used as the block production probability of the node. Then, a random number is generated. When the random number corresponding to the node is less than or equal to the block production probability, the node is determined as the final block production node.

[0049] This invention provides a blockchain node selection method based on a two-layer consensus mechanism, which achieves efficient and secure blockchain consensus by combining Byzantine fault tolerance mechanism and proof-of-stake mechanism.

[0050] During the blockchain network startup phase, the system first counts the total number of nodes in the current blockchain network. Assuming there are 100 nodes participating in maintenance, based on the practical Byzantine fault tolerance theory, the system calculates the threshold for the number of malicious nodes that can be tolerated. Specifically, the calculation is as follows: subtract one from the total number of nodes, and take one-third of the integer part of (100-1) / 3, which gives 33. This means that in this blockchain network, the system can tolerate a maximum of 33 malicious nodes without affecting the overall consensus security.

[0051] When a new block needs to be generated, the system enters the first-level consensus verification phase. Node A, as a candidate block producer, constructs a pre-verification message based on the hash value of the previous block "0x8a7d...3b21", its own node identifier "Node_A_12345", the current timestamp "1678234560", and the digital signature "0xef71...9c42" generated using its private key. The pre-verification message contains these four items and is broadcast to all nodes in the blockchain network via the P2P network.

[0052] After receiving the pre-verification message, other nodes verify its legitimacy, including checking if the timestamp is within a reasonable range (usually allowing a difference of no more than 10 minutes from local time), verifying if the digital signature matches node A's public key, and confirming if the previous block hash is correct. Once verification is successful, each node broadcasts its agreement vote to the network. The system continuously counts the number of agreement votes. When the number reaches 67 (twice 33 plus 1), it indicates that more than two-thirds of the nodes approve the pre-verification message, the first layer of consensus is achieved, and the second layer of consensus verification is triggered.

[0053] In the second-layer consensus verification, the system first calculates the initial stake value of each node. Taking node B as an example, it has staked 500 tokens, has 1200 historical transactions, and a credit score of 95 (out of 100). The system uses a weighted calculation method, setting the staked amount weight to 0.5, the historical transaction volume weight to 0.3, and the credit score weight to 0.2. The initial stake value of node B is calculated as: 500 × 0.5 + 1200 × 0.3 + 95 × 0.2 = 250 + 360 + 19 = 629.

[0054] Simultaneously, the system acquires the online duration data of node B, including a total online duration of 720 hours and the most recent continuous online duration of 168 hours. The system sets the weight of total online duration to 0.6 and the weight of continuous online duration to 0.4, calculating the online duration influence factor of node B as: 720 × 0.6 + 168 × 0.4 = 432 + 67.2 = 499.2.

[0055] Multiplying node B's initial stake of 629 by the online duration impact factor of 499.2, we obtain node B's overall weight as: 629 × 499.2 = 313,996.8. The system performs the same calculation on all nodes. Assuming the total overall weight of all nodes in the blockchain network is 10,000,000, then node B's probability of producing a block is 313,996.8 ÷ 10,000,000 = 0.0314, or approximately 3.14% of the probability of being selected as a block-producing node.

[0056] In the final stage of determining the block-producing node, the system generates a random number between 0 and 1 for each node. Assuming node B's random number is 0.0295, which is less than its block production probability of 0.0314, node B is determined as the block-producing node for this round. If multiple nodes have random numbers less than their respective block production probabilities, the node with the smallest random number is selected as the block-producing node.

[0057] To ensure the fairness of random number generation, the system employs Verifiable Random Function (VRF) technology, using the hash value of the previous block combined with the current timestamp as a seed to generate random numbers. Each node can independently verify the correctness of the random number generation process.

[0058] After being successfully selected as a block-producing node, Node B is responsible for collecting transactions, packaging blocks, calculating new block hashes, and broadcasting the new blocks to the network. Other nodes, upon receiving the new blocks, verify their content and validity. If the verification is successful, they add the new blocks to their local blockchains.

[0059] Through this two-layer consensus mechanism, the system utilizes a practical Byzantine fault-tolerant algorithm to ensure rapid pre-verification at the first layer, while employing a comprehensive weighted probabilistic selection mechanism to achieve more decentralized and fair node selection. This effectively prevents a single node from controlling block production rights for an extended period, enhancing the system's security and decentralization. Simultaneously, the introduction of an online duration factor incentivizes nodes to maintain a stable online state, improving the stability and reliability of the entire blockchain network.

[0060] Figure 2 A bar chart comparing the overall performance of the two-layer consensus mechanism implemented in this invention: This chart visually compares the performance of three blockchain consensus mechanisms across five key performance indicators: traditional PBFT consensus, stake-based PoS consensus, and the proposed two-layer consensus mechanism. The chart clearly shows that the proposed two-layer consensus mechanism has a significant advantage in most performance metrics. In terms of transaction throughput, the two-layer consensus mechanism achieves 96.8%, higher than PBFT's 83.5% and PoS's 92.1%; in terms of consensus efficiency, the two-layer consensus mechanism achieves 91.3%, also outperforming the other two mechanisms; and in terms of system reliability, it reaches a high level of 94.7%. Particularly noteworthy is its fault tolerance rate, which reaches 35.6%, not only better than PoS's 25.1% but also slightly higher than PBFT's 33.3%, indicating a stronger ability to resist malicious node attacks. These performance advantages stem from the innovative design of the two-layer consensus mechanism: the first layer uses PBFT pre-verification to ensure transaction consistency and tamper-proofing, while the second layer dynamically selects block-producing nodes based on a comprehensive evaluation of node stake and online time. This design retains PBFT's high fault tolerance while addressing the shortcomings of traditional consensus mechanisms in terms of efficiency and resource utilization, providing a safer and more efficient consensus solution for blockchain systems, especially consortium blockchains or private blockchain environments.

[0061] In one optional implementation, data query requests from the plurality of tobacco stations are received, financial data is obtained from the blockchain according to the query requests, and the obtained financial data is subjected to hierarchical desensitization processing according to pre-set data desensitization rules. The financial data with different desensitization levels is returned for data query requests of different security levels, including: Receive a data query request, the data query request including the identity information of the querying subject, the permission level information, and the query content information; Obtain the historical behavior credit score and identity authentication level score of the query subject, and use the sum of the product of the historical behavior credit score and the first preset weight and the product of the identity authentication level score and the second preset weight as the identity credibility. The sensitivity of the fields in the query content information is calculated using the information entropy calculation method to obtain the field sensitivity. The query content is divided into different sensitivity levels based on the field sensitivity, and the desensitization processing strategy for different fields is determined based on the sensitivity level. Based on the identity credibility, the permission level information, and the sensitivity level, calculate the security score of the data query request, and determine the de-identification processing level based on the security score; The financial data corresponding to the query content is obtained from the blockchain. Based on the desensitization processing strategy and the desensitization processing level, the numerical data in the financial data is desensitized using a random perturbation coefficient, and the character data in the financial data is desensitized using a replacement matrix, thereby achieving differentiated desensitization processing.

[0062] When receiving data query requests, the system receives HTTP or HTTPS requests from the tobacco station via a network interface. The request message contains JSON-formatted query subject identity information (such as account ID, digital certificate, etc.), permission level information (such as administrator level 1-5), and query content information (such as the financial data fields to be queried and filter conditions). For example, a typical request might include: "Query Subject ID: 10086", "Permission Level: 3", "Query Content: Sales, Cost, and Profit Margin Data (January 2022 to December 2023)".

[0063] When the system obtains the historical behavior credit score and identity authentication level score of a querying entity, it first extracts the entity's operation records for the past six months from the user behavior database, including indicators such as login frequency, query behavior compliance, and data usage legality. The historical behavior credit score is then calculated using preset scoring rules, ranging from 0 to 100. For example, if the querying entity has had no abnormal logins in the past six months and all data usage is compliant, it can obtain a historical behavior credit score of 95. Simultaneously, the system extracts the querying entity's identity authentication level score from the identity authentication system. This score is based on the strictness and completeness of identity authentication and also ranges from 0 to 100. If the querying entity has completed multi-factor authentication, facial recognition, and enterprise real-name authentication, it can obtain an identity authentication level score of 90.

[0064] The system calculates the identity credibility by multiplying the historical behavioral credit score by a first preset weight (e.g., 0.6) and then adding the identity authentication level score by a second preset weight (e.g., 0.4). In the example above, the identity credibility is 95 × 0.6 + 90 × 0.4 = 93. This identity credibility will be one of the key factors in determining the subsequent anonymization level.

[0065] When calculating the sensitivity of query content, the system uses the information entropy calculation method. For each requested field, the system analyzes its distribution characteristics, scarcity, and relevance within the entire dataset. For example, for the "profit margin" field, the system calculates indicators such as the numerical distribution and the proportion of unique values ​​to obtain a sensitivity score. The system then categorizes fields into different sensitivity levels based on preset sensitivity score ranges: 0-30 points for low sensitivity, 31-70 points for medium sensitivity, and 71-100 points for high sensitivity. For each sensitivity level, a corresponding de-identification strategy is determined, such as mild de-identification for low sensitivity, moderate de-identification for medium sensitivity, and high de-identification or complete masking for high sensitivity.

[0066] When calculating the security score for a data query request, the system considers three factors: identity credibility, permission level information, and the sensitivity level of the query content. The security score is calculated by multiplying the identity credibility score by the permission level coefficient and then dividing by the sensitivity level coefficient. For example, if the identity credibility score is 93, the permission level is level 3 (corresponding to a coefficient of 1.2), and the average sensitivity level of the query content is medium (corresponding to a coefficient of 1.5), then the security score is 93 × 1.2 ÷ 1.5 = 74.4. The system determines the anonymization level based on the security score range: 0-50 points indicate full anonymization (displaying very little data or none), 51-80 points indicate partial anonymization (displaying some processed data), and 81-100 points indicate mild anonymization (displaying most data, with a small amount of sensitive data processed).

[0067] When retrieving financial data from the blockchain, the system uses smart contracts via the blockchain node's API to query relevant transaction records and obtain the corresponding financial data. The system ensures the consistency and trustworthiness of the blockchain data, guaranteeing the reliability of the data source through digital signature verification and consensus mechanisms.

[0068] When anonymizing the acquired financial data, the system employs differentiated strategies for different data types. For numerical data (such as sales revenue and costs), a random perturbation coefficient is used for anonymization, which involves multiplying the original value by a random coefficient within a specific range. For example, if the original sales revenue is 1,000,000 yuan and the anonymization level is partial anonymization, the system can generate a random coefficient of 1.02 within the range of 0.95-1.05 to adjust the displayed value to 1,020,000 yuan, maintaining the data trend while hiding the precise value. For character data (such as customer names and transaction notes), a replacement matrix is ​​used for anonymization, replacing sensitive characters according to preset character mapping rules. For example, the company name "Excellent Trading Co., Ltd." is replaced with "Excellent*Trading*Co., Ltd.", or completely replaced with codes such as "Customer A".

[0069] Through the above implementation methods, the system can achieve differentiated anonymization of financial data based on the identity characteristics, permission levels, and sensitivity of the query content of different query subjects. This ensures data security while meeting the business needs of different tobacco stations for financial data queries, and enables secure sharing of blockchain financial data.

[0070] In one optional implementation, an information entropy calculation method is used to calculate the sensitivity of the fields of the query content information to obtain field sensitivity. Based on the field sensitivity, the query content is divided into different sensitivity levels, and desensitization strategies for different fields are determined based on the sensitivity levels, including: By statistically analyzing the frequency of occurrence of different values ​​in each field to be evaluated, the ratio of the frequency of occurrence of each value to the total frequency of the field is calculated to obtain the probability of the value. The opposite of the product of the probability of the value and the logarithm of the probability of the value are summed to obtain the field information entropy, which represents the information content of the field. Obtain the business value score that reflects the importance of a field, and calculate the direct sensitivity by weighting the field information entropy and the business value score. At the same time, calculate the correlation strength between fields, and combine the direct sensitivity score that represents the sensitivity of the field itself with the indirect sensitivity score that represents the influence of the correlation by weighting to obtain the comprehensive sensitivity score that fully reflects the sensitivity of the field. Based on the comprehensive sensitivity, the fields are divided into sensitivity levels, multi-level sensitivity thresholds are set and compared with the comprehensive sensitivity to determine the sensitivity level of each field. At the same time, sensitivity deviation is calculated based on historical evaluation data, and the multi-level sensitivity thresholds are adaptively adjusted using the sensitivity deviation. For fields with different sensitivity levels, the desensitization intensity is obtained by calculating the ratio of the overall sensitivity to the maximum sensitivity and multiplying the ratio by the desensitization base. The corresponding desensitization processing strategy is then selected based on the desensitization intensity.

[0071] For each field to be evaluated, the system counts the frequency of different values. For example, in the occupation field, "teacher" appears 50 times, "engineer" appears 30 times, and "doctor" appears 20 times. The probability of each value is obtained by calculating its proportion in the total frequency. For example, the probability of "teacher" is 0.5, "engineer" is 0.3, and "doctor" is 0.2. The negative value of the product of each probability and its logarithm is then summed to obtain the field's information entropy. If the information entropy of the occupation field is calculated to be 1.03, it indicates the amount of information or the degree of uncertainty in that field.

[0072] Simultaneously, the system acquires an importance score reflecting the business value of each field. For example, in a financial risk control scenario, the business value score for a user's income field could be 0.8, for an age field 0.5, and for an occupation field 0.6. The direct sensitivity is obtained by weighting the field's information entropy and business value score. Taking the income field as an example, its information entropy is 1.25, its business value score is 0.8, and the weighted result is a direct sensitivity score of 1.0.

[0073] The system also calculates the correlation strength between fields. By analyzing the relationships between fields, it assesses the risk that a leak in one field could lead to the leakage of information in other fields. For example, the correlation strength between the occupation and income fields is 0.6, indicating that a leak of occupation information could lead to a high probability that income information could be inferred. Based on the correlation strength between fields, the system calculates the indirect sensitivity of each field to other fields. The indirect sensitivity of the income field to the occupation field is 0.75, and the indirect sensitivity to the age field is 0.4.

[0074] The overall sensitivity is obtained by weighting the direct sensitivity, which represents the sensitivity of the field itself, and the indirect sensitivity, which represents the influence of association. Assuming the weight of direct sensitivity is 0.7 and the weight of indirect sensitivity is 0.3, the overall sensitivity of the income field is calculated as 1.0 × 0.7 + (0.75 + 0.4) × 0.3 = 1.035.

[0075] Based on the calculated overall sensitivity, the system sets multiple sensitivity thresholds and compares them to determine the sensitivity level of each field. For example, the sensitivity thresholds can be set as: low sensitivity level (0-0.5), medium sensitivity level (0.5-1.0), high sensitivity level (1.0-1.5), and very high sensitivity level (>1.5). According to these thresholds, the income field (sensitivity 1.035) is classified as high sensitivity, the occupation field (sensitivity 0.85) as medium sensitivity, and the age field (sensitivity 0.45) as low sensitivity.

[0076] The system also calculates sensitivity bias based on historical assessment data. By comparing the predicted sensitivity in historical assessments with the sensitivity reported in actual operation, the system can identify whether the sensitivity of certain fields is overestimated or underestimated. For example, historical data shows that the assessment sensitivity of the age field is on average 10% lower than the actual sensitivity. The system will use this bias to adjust the sensitivity threshold, changing the low sensitivity level threshold for the age field from 0.5 to 0.45.

[0077] For fields with predefined sensitivity levels, the system calculates the desensitization strength to determine the appropriate desensitization strategy. The desensitization strength is calculated by multiplying the field's overall sensitivity by the system's maximum set sensitivity, and then by the desensitization baseline. Assuming a maximum sensitivity of 2.0 and a desensitization baseline of 10, the desensitization strength for the income field would be (1.035 ÷ 2.0) × 10 = 5.175.

[0078] Based on the anonymization intensity, the system selects the corresponding anonymization strategy. Anonymization intensities 1-3 employ a data generalization strategy, such as converting a specific age into an age range; intensities 3-6 employ a partial masking strategy, such as replacing the middle four digits of a phone number with asterisks; intensities 6-8 employ a complete replacement strategy, such as replacing the actual income value with an income level; and intensities 8-10 employ a data deletion strategy, directly removing the data from the field. For the income field (anonymization intensity 5.175), the system selects a partial masking strategy, replacing the first half of the specific income number with asterisks.

[0079] Using the methods described above, the system can intelligently assess the sensitivity of data and automatically select appropriate de-identification strategies based on the sensitivity level, ensuring data usability while protecting user privacy. This method is particularly suitable for industries such as finance, healthcare, and e-commerce, which involve large amounts of sensitive personal information, effectively preventing data breaches while meeting data analysis and business needs.

[0080] This invention relates to a blockchain-based financial data management system for multiple tobacco stations, the system comprising: The first unit is used to receive financial data uploaded by multiple tobacco stations; The second unit is used to obtain the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds, and the financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The third unit is used to encapsulate the financial data into blockchain transactions, package the blockchain transactions into blocks based on a preset consensus algorithm, add the blocks to the blockchain, and synchronize the data among multiple nodes in the blockchain network. The fourth unit is used to receive data query requests from the multiple tobacco stations, obtain the financial data from the blockchain according to the query request, and perform hierarchical desensitization processing on the obtained financial data according to the pre-set data desensitization rules, and return the financial data with different desensitization degrees for data query requests with different security levels.

[0081] A third aspect of the present invention provides an electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0082] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0083] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for managing financial data of multiple tobacco stations based on blockchain, characterized in that, include: Receive financial data uploaded by multiple tobacco stations; The system obtains the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds. The financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The financial data is encapsulated into blockchain transactions, and the blockchain transactions are packaged into blocks based on a preset consensus algorithm. The blocks are added to the blockchain, and the data is synchronized across multiple nodes in the blockchain network. The system receives data query requests from multiple tobacco stations, retrieves the financial data from the blockchain according to the query requests, performs hierarchical desensitization processing on the retrieved financial data according to pre-set data desensitization rules, and returns financial data with different desensitization levels for data query requests of different security levels.

2. The method according to claim 1, characterized in that, The process involves encapsulating the financial data into blockchain transactions, packaging these transactions into blocks based on a preset consensus algorithm, adding the blocks to the blockchain, and synchronizing the data across multiple nodes in the blockchain network. A transaction data structure is generated based on the financial data, and a digital signature is performed on the transaction data structure based on the elliptic curve digital signature algorithm to generate a blockchain transaction. The system obtains the transaction value magnitude, time urgency, and user credit score of the blockchain transactions. It calculates a magnitude score based on the transaction value magnitude, an urgency score based on the time urgency, and a credit score based on the user credit score. The system then performs a weighted sum of the magnitude score, urgency score, and credit score to obtain the transaction processing priority. The blockchain transactions are then sorted according to the processing priority. A dynamic block size adjustment mechanism is used to package the sorted blockchain transactions into blocks. The generated blocks are added to the blockchain, and data synchronization is performed among the nodes of the blockchain network.

3. The method according to claim 2, characterized in that, The method further includes: A two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of malicious nodes that can be tolerated is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered to obtain the initial stake value and online time of each node. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated, and a block-producing node is selected according to the probability.

4. The method according to claim 3, characterized in that, A two-layer consensus mechanism is constructed: the total number of nodes in the blockchain network is calculated, a threshold for the number of malicious nodes that can be tolerated is set, and a practical Byzantine fault-tolerant pre-verification is performed through the first-layer consensus mechanism. After collecting the pre-verification pass information of the nodes, the second-layer consensus is entered, where the initial stake value and online time of each node are obtained. Based on the proportion of the product of the initial stake value and the online time to the sum of all products, the probability of each node being selected as a block-producing node is calculated. The selection of block-producing nodes based on the probability includes: Obtain the total number of nodes in the blockchain network, and calculate the tolerable malicious node number threshold based on the total number of nodes as the benchmark value for the first layer consensus verification. The malicious node number threshold is the integer part of one-third of the total number of nodes minus one. A pre-verification message is generated based on the block hash value, node identifier, timestamp, and digital signature and broadcast in the blockchain network. The number of nodes that vote in agreement on the pre-verification message is counted. When the number exceeds twice the tolerable number of malicious nodes plus one, the second layer of consensus verification is triggered. In the second-layer consensus verification, the initial equity value of each node is first calculated by weighting the pledge amount, historical transaction volume and credit score of each node. At the same time, the total online time and continuous online time of each node are obtained and weighted to calculate the online time influence factor. By multiplying the initial equity value of each node with the corresponding online time influence factor, the comprehensive weight reflecting the overall contribution of the node is obtained. Based on the comprehensive weight of each node, the proportion of the comprehensive weight of each node to the sum of the comprehensive weights of all nodes is calculated, and this proportion is used as the block production probability of the node. Then, a random number is generated. When the random number corresponding to the node is less than or equal to the block production probability, the node is determined as the final block production node.

5. The method according to claim 1, characterized in that, The system receives data query requests from multiple tobacco stations, retrieves the financial data from the blockchain according to the query requests, and performs hierarchical desensitization processing on the retrieved financial data according to pre-set data desensitization rules. For data query requests of different security levels, it returns financial data with different degrees of desensitization, including: Receive a data query request, the data query request including the identity information of the querying subject, the permission level information, and the query content information; Obtain the historical behavior credit score and identity authentication level score of the query subject, and use the sum of the product of the historical behavior credit score and the first preset weight and the product of the identity authentication level score and the second preset weight as the identity credibility. The sensitivity of the fields in the query content information is calculated using the information entropy calculation method to obtain the field sensitivity. The query content is divided into different sensitivity levels based on the field sensitivity, and the desensitization processing strategy for different fields is determined based on the sensitivity level. Based on the identity credibility, the permission level information, and the sensitivity level, calculate the security score of the data query request, and determine the de-identification processing level based on the security score; The financial data corresponding to the query content is obtained from the blockchain. Based on the desensitization processing strategy and the desensitization processing level, the numerical data in the financial data is desensitized using a random perturbation coefficient, and the character data in the financial data is desensitized using a replacement matrix, thereby achieving differentiated desensitization processing.

6. The method according to claim 5, characterized in that, The sensitivity of the fields in the query content information is calculated using the information entropy calculation method to obtain field sensitivity. Based on the field sensitivity, the query content is divided into different sensitivity levels, and desensitization strategies for different fields are determined based on these sensitivity levels, including: By statistically analyzing the frequency of occurrence of different values ​​in each field to be evaluated, the ratio of the frequency of occurrence of each value to the total frequency of the field is calculated to obtain the probability of the value. The opposite of the product of the probability of the value and the logarithm of the probability of the value are summed to obtain the field information entropy, which represents the information content of the field. Obtain the business value score that reflects the importance of a field, and calculate the direct sensitivity by weighting the field information entropy and the business value score. At the same time, calculate the correlation strength between fields, and combine the direct sensitivity score that represents the sensitivity of the field itself with the indirect sensitivity score that represents the influence of the correlation by weighting to obtain the comprehensive sensitivity score that fully reflects the sensitivity of the field. Based on the comprehensive sensitivity, the fields are divided into sensitivity levels, multi-level sensitivity thresholds are set and compared with the comprehensive sensitivity to determine the sensitivity level of each field. At the same time, sensitivity deviation is calculated based on historical evaluation data, and the multi-level sensitivity thresholds are adaptively adjusted using the sensitivity deviation. For fields with different sensitivity levels, the desensitization intensity is obtained by calculating the ratio of the overall sensitivity to the maximum sensitivity and multiplying the ratio by the desensitization base. The corresponding desensitization processing strategy is then selected based on the desensitization intensity.

7. A blockchain-based financial data management system for multiple tobacco stations, used to implement the method as described in any one of claims 1-6, characterized in that, include: The first unit is used to receive financial data uploaded by multiple tobacco stations; The second unit is used to obtain the smart contracts corresponding to each of the multiple tobacco stations. The smart contracts set historical financial data thresholds, and the financial data is compared with the corresponding historical financial data thresholds. When the financial data exceeds the preset range of the historical financial data thresholds, an abnormal warning message is automatically sent to the system management terminal. The third unit is used to encapsulate the financial data into blockchain transactions, package the blockchain transactions into blocks based on a preset consensus algorithm, add the blocks to the blockchain, and synchronize the data among multiple nodes in the blockchain network. The fourth unit is used to receive data query requests from the multiple tobacco stations, obtain the financial data from the blockchain according to the query request, and perform hierarchical desensitization processing on the obtained financial data according to the pre-set data desensitization rules, and return the financial data with different desensitization degrees for data query requests with different security levels.

8. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 6.