A blockchain account optimization method for blockchain evidence storage

Through the blockchain account management method, the account queue model and rate management are used to solve the problems of low concurrency and certificate deposit failure in the traditional blockchain certificate deposit method, improve the transaction success rate and account management efficiency, and ensure data storage. certification reliability and security.

CN114119018BActive Publication Date: 2024-10-29SSE INFORMATION NETWORK LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111358416.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2024-10-29
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

The traditional blockchain certificate deposit method requires multiple threads and accounts to increase the number of concurrencies when large amounts of data are uploaded to the chain. Due to the transaction consensus mechanism and anti-attack mechanism of the blockchain system, unreasonable account usage can easily lead to certificate deposit failures. , resulting in low certificate storage efficiency and low success rate.

Method used

Design a blockchain account management method by setting up genesis accounts and ordinary accounts, using idle account queue and busy account queue models, limiting the number of account uses and busy times, ensuring the uniqueness of transactions signed by each account, and according to the zone The blockchain rate change selects the on-chain time to avoid transaction consensus failure.

Benefits of technology

Significantly improves the success rate of transaction consensus in high-concurrency data storage scenarios, realizes account sharing and unified management, avoids the risk of private key leakage, ensures the uniqueness and continuity of transactions, and reduces the risk of rising rates Certificate storage failure problem.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119018B_ABST
    Figure CN114119018B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of blockchain, and in particular to a blockchain account optimization method for blockchain evidence storage. A first security key is set to encrypt a genesis account and store it in an account management system, and a second security key is set to encrypt a common account and store it in the account management system. After the account management system is initialized, a plurality of common accounts are generated and encrypted and stored in the system, and enter an idle account queue. The method has the advantages of realizing account sharing and unified account management; and ensuring uniqueness and continuity of legal transactions signed by each account through the sequence attribute of the account, thereby avoiding the problem of double spending.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain account optimization method for blockchain evidence storage. Background Art

[0002] In recent years, with the support of a series of policies, new-generation information technologies such as blockchain have accelerated their development and have extended to multiple fields such as digital finance, the Internet of Things, intelligent manufacturing, supply chain management, and digital asset trading.

[0003] Blockchain is a new application model of a series of computer technologies. Blockchain is essentially a decentralized database that builds a "decentralized" trust mechanism with rigorous mathematical solutions. It is also a distributed ledger that cannot be tampered with or forged, which is protected by encryption algorithms.

[0004] Blockchain technology can enable numerous entities of different sizes and without a trust basis to have an equal status and collaborate through transparent rules. Blockchain technology has the potential to reconstruct the infrastructure of human economic and social activities.

[0005] Blockchain technology is currently developing rapidly in my country and is trying to integrate with all walks of life. Making full use of blockchain, big data and other technical means to improve the government data resource system and realize the interconnection and interoperability of government information resources across levels, regions, systems, departments and businesses can reduce repeated data entry and avoid the "two skins" of data and business, which will help create a convenient, efficient, fair, competitive, stable and transparent business environment. Using blockchain technology to explore innovations in digital economic models and achieve effective docking of supply and demand in various industries to provide services will help accelerate the transition from old to new drivers and promote high-quality economic development.

[0006] Based on the tamper-proof nature of blockchain, blockchain data storage has been widely recognized and applied in all walks of life. Blockchain data storage is to store data on the blockchain to achieve the purpose of tamper-proof, traceable, and trustworthy data sources. Data can be in any file format such as text, video, audio, and pictures.

[0007] In order to achieve fast transactions, in general, the chain and the off-chain work together, and the file and the hash value are separated. Only the hash value of the file is saved on the chain, and the original file is saved off the chain. As long as the hash value of the file is calculated and compared with the hash value on the chain, it is known whether the file has been tampered with.

[0008] The traditional evidence storage method has the following shortcomings: 1. Blockchain data evidence storage requires blockchain accounts to submit blockchain transactions to complete. When a large amount of data is uploaded to the chain for evidence storage, multiple threads and multiple accounts are required to increase the concurrency of the chain and improve the efficiency of the chain; 2. Due to the special transaction consensus mechanism and protection mechanism against double-spending attacks and denial of service attacks in the blockchain system, unreasonable use of accounts can easily lead to the failure of consensus after the transaction is uploaded to the chain, resulting in evidence storage failure. Summary of the invention

[0009] The present invention provides a blockchain account management method for blockchain evidence storage, which can manage accounts in batches and significantly improve the transaction consensus success rate in a high-concurrency data evidence storage scenario.

[0010] In order to achieve the above purpose, a blockchain account optimization method for blockchain evidence storage is designed, which is characterized by the following specific method:

[0011] S1. Set the first security key to encrypt the Genesis account and store it in the account management system, and set the second security key to encrypt the ordinary account and store it in the account management system;

[0012] S2. After the account management system is initialized, it generates several ordinary accounts and stores them in the system after encryption, and enters the idle account queue. The maximum number of uses of ordinary accounts is set. Each ordinary account generates a transaction number that increases by 1. When the account usage reaches the set maximum number of uses, it enters the account recovery pool and no longer improves the on-chain signature service. A new ordinary account is regenerated by the creation account and added to the idle account queue. The maximum busy time of the ordinary account is set. The maximum busy time is the time difference from the completion of the signature of the ordinary account to the monitoring of the return of the public key of the ordinary account. If the maximum busy time is exceeded, the account return is considered to have failed. The account management system forcibly releases the ordinary account from the busy account queue to the idle account queue. The account management system starts the scheduled task online to regularly update the queue of ordinary accounts whose status needs to be updated, and sets the update scheduled task interval;

[0013] S3. When several evidence storage systems need to store evidence on the chain, the evidence data is input into the account management system. The account management system performs a queue operation on the first common account in the idle account queue, signs the evidence data with the account private key, returns the account public key and the signed data, and puts the common account into the busy account queue;

[0014] S4. After the evidence storage system receives the signed transaction, it needs to submit the transaction to the chain successfully within the maximum busy time of the account and return the account public key to the account management system. The account management system will increase the queue of the ordinary account by 1, dequeue it from the busy account queue, and add it to the last position of the idle account queue.

[0015] The management method of the present invention also has the following preferred technical solutions:

[0016] 1. Step S3 is as follows: before acquiring the account, the account management system determines whether there is an idle account in the idle account queue. If the idle account is empty, an exception indicating that the account is busy is returned.

[0017] 2. Step S2 also includes setting a maximum on-chain rate for ordinary accounts. In step S3, the account management system calculates the size of the evidence data and obtains the on-chain rate value required for on-chain under the current blockchain state before obtaining the account. If it is greater than the maximum on-chain rate, an exception of increased on-chain rate is returned.

[0018] 3. Step S4 is as follows:

[0019] S41. After the evidence storage system obtains the signed transaction, if it fails to submit the transaction to the chain successfully after the maximum busy time of the account, that is, if the account public key is not returned within the maximum busy time of the account, the account management system will retain the existing queue of the account and forcibly dequeue it from the busy account and return it to the idle account queue, marking the account status as needing to be updated;

[0020] S42. Before the update timer task is triggered, if the evidence storage system polls the signature of the account whose usage status is to be updated, and the transaction is successfully submitted to the chain within the maximum busy time of the account and the account public key is returned, then the account management system will return the account from the busy account queue to the idle queue and cancel the status of needing to be updated. At this time, if the transaction in step S41 is submitted to the chain, it will prompt that the transaction failed to be evidenced;

[0021] S43. The update scheduled task performs an account queue update operation every set time, that is, the account management system polls all accounts that need to be updated, obtains the latest queues of these accounts from the latest blockchain ledger and updates them locally, avoiding the error of too many transactions being submitted to the chain, and increasing the probability of transactions being successfully written to the ledger and the availability of accounts.

[0022] Compared with the prior art, the present invention has the following advantages:

[0023] 1. Realized account sharing and unified account management;

[0024] 2. Through the sequence attribute of the account, ensure that the legitimate transactions signed by each account are unique and continuous to avoid the double-spending problem;

[0025] 3. A dual-queue model of idle account queue management and busy account queue management is adopted to avoid the situation where the same sequence signature of the same account is used when multi-threaded on-chain evidence is stored, resulting in multiple transactions signed by the account having the same sequence, further resulting in only one transaction among the multiple transactions signed by the account being successfully stored, and the rest of the transactions failing to be stored due to duplicate numbers;

[0026] 4. By real-time querying the fee changes, the optimal time to upload to the blockchain is selected, thus avoiding the problem of failure of evidence storage due to the failure of consensus on transactions caused by the increase of blockchain fee in high-concurrency scenarios;

[0027] 5. The account management system provides external account signature services, eliminating the risk of private key leakage;

[0028] 6. The account management system sets the maxBusyTime maximum busy time, and forces the account release mechanism to eliminate the hidden danger that the evidence storage system does not submit the transaction to the chain and does not return the account after calling the account signature service;

[0029] 7. When the account sequence reaches 4,294,967,295, it will start counting from 1. Setting the account sequence to enter the account recycling pool after reaching maxSequence will help administrators summarize and count the exact number of services provided by the account management system based on the sequence of each account. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a dual queue model of account management system;

[0031] Figure 2 This is a schematic diagram of the signing process for a normal account;

[0032] Figure 3 This is a schematic diagram of the general account recovery process;

[0033] Figure 4 This is a schematic diagram of normal release of ordinary accounts;

[0034] Figure 5 This is a schematic diagram of forced release of a normal account. DETAILED DESCRIPTION

[0035] The present invention is further described below in conjunction with the accompanying drawings, and the structure and principle of the present invention are very clear to people in the field. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0036] The present invention provides a blockchain account management method for blockchain evidence storage, which can manage accounts in batches and significantly improve the transaction consensus success rate in high-concurrency data evidence storage scenarios, as follows:

[0037] 1. The administrator sets security key 1 to encrypt the Genesis account and store it in the account management system, and sets security key 2 to encrypt the ordinary account and store it in the account management system.

[0038] 2. After the account management system is initialized, 100 ordinary accounts are generated by default and encrypted and stored in the system; the genesis account initially recharges 100,000 points for each ordinary account and enters the idle account queue; when the default ordinary account balance is less than 50 points, the genesis account will recharge 1,000 points; the default maximum number of uses of ordinary accounts maxSequence is 4000000000 (considering that the transaction sequence number in the ordinary account is a 32-bit int type, and each account generates a transaction sequence number incremented by 1, that is, an ordinary account can perform a maximum of 2^32-1 = 4294967295), when the account is used for maxSequence times, it will enter the account recycling pool and will no longer provide on-chain signature services. A new account will be regenerated from the genesis account and added to the idle account queue; the default maximum on-chain fee maxFee is 0.01 points; the default account maximum busy time maxBusyTime is 10s, that is, the time difference from the completion of the account signature to the monitoring of the return of the account public key cannot exceed 10s, otherwise the account return is considered to have failed, and the account management system will forcibly release the account from the busy account queue to the idle account queue; the account management system starts the scheduled task to update the sequence of accounts whose status is "need to be updated" online, and the update interval of the scheduled task updateInterval is 60s.

[0039] 3. When the evidence storage system (one or more) needs to store evidence on the chain, the evidence data is input into the account management system. The account management system performs a queue operation on the first account in the idle account queue, signs the evidence data with the account private key, returns the account public key and the signed data, and puts the account into the busy account queue.

[0040] 3.1. The account management system determines whether there is an idle account in the idle account queue before obtaining the account. If the idle account is empty, an exception indicating that the account is busy is returned.

[0041] 3.2. Before obtaining the account, the account management system calculates the size of the evidence data and obtains the fee value required for on-chain access under the current blockchain state. If it is greater than the maximum on-chain fee rate maxFee, an exception of fee increase is returned.

[0042] 4. After the evidence storage system receives the signed transaction, it needs to submit the transaction to the chain successfully within the account's maximum busy time maxBusyTime and return the account public key to the account management system. The account management system will increase the sequence of the account by 1, dequeue it from the busy account queue, and add it to the last position of the idle account queue.

[0043] 4.1. After the evidence storage system obtains the signed transaction, if it fails to submit it to the chain successfully within maxBusyTime, that is, if the account public key is not returned within maxBusyTime, the account management system will retain the existing sequence of the account and force it to be dequeued from the busy account and returned to the idle account queue, marking the account status as "needs to be updated".

[0044] 4.2. Before the update timer task is triggered, if the evidence storage system polls the account signature with the status of "need to be updated", and successfully submits the transaction to the chain within maxBusyTime and returns the account public key, then the account management system will return the account from the busy account queue to the idle queue and cancel the "need to be updated" status. At this time, if the transaction in 4.1 is submitted to the chain, it will prompt that the transaction failed to be evidenced.

[0045] 4.3. Update the scheduled task to perform an account sequence update operation every 1 minute. That is, the account management system polls all accounts with the status of "need to be updated" every 1 minute, obtains the latest sequence of these accounts from the latest blockchain ledger, and updates them locally. Avoid the error of too many transactions being submitted to the chain, and increase the probability of transactions being successfully written to the ledger and the availability of accounts.

[0046] In a preferred embodiment, ordinary accounts participating in transactions may be managed using a dual-queue model.

[0047] 1. As Figure 1 As shown in the figure, assuming that the account management system initially creates 10 accounts and each account has sufficient points. At a certain moment, there are 8 idle accounts, 2 busy accounts, and 0 recycled accounts.

[0048] 2. When the user initiates a proof storage request, the signature service receives the request and determines whether there is an account in the idle queue. If it is empty, it returns that the account is busy; if there is an account, it takes the account at the head of the queue from the head of the idle account queue and determines whether the account triggers the recycling condition. If not, account 1 is removed from the idle queue and placed in the busy account queue. Figure 2 As shown; if yes, account 1 is dequeued from the idle queue and recycled to the account recycling pool, and the account generation service is triggered to create a new ordinary account based on the creation account and put it at the end of the idle account queue, as shown Figure 3 shown.

[0049] 3. After the signature service completes the signature, it returns the account public key and signature data to the external evidence storage system, and the account monitoring service waits for the external evidence storage system to return the account. Taking account 9 as an example, its latest sequence number after signing is 100. If the account monitoring service obtains the return request of account 9 within 10 seconds, it will increase the sequence of account 9 by 1 (sequence=101) and release it to the end of the idle account queue. Figure 4 shown.

[0050] 4. If the account monitoring service detects that account 9 has not been returned within 10 seconds, the account sequence is kept at 100 and forced to be released to the end of the idle account queue, and the account status is changed to "need to be updated", such as Figure 5 shown.

[0051] 5. Based on step 4, before the execution of the scheduled update task, if the external evidence storage system calls the signature service to sign the new transaction, the signature service obtains the account 9 with the status of "need to be updated" again to complete the signature, and the external evidence storage system obtains the signature result and submits it to the chain successfully together with the transaction and returns account 9 to the account management system within 10 seconds. At this time, the account monitoring system adds 1 to the sequence of account 9 (sequence=101) and releases it to the idle account queue again, canceling the "need to be updated" status of account 9.

[0052] 6. Based on step 4, before the update scheduled task is executed, if the signature of account 9 is not used or account 9 is not returned within 10 seconds after being used, the update scheduled task will access the latest ledger of the blockchain, obtain the latest sequence of account 9 in the ledger and update it.

Claims

1. A blockchain account optimization method for blockchain evidence storage, characterized in that: The specific method is as follows: Step S1. Set a first security key to encrypt the creation account and store it in the account management system, and set a second security key to encrypt the common account and store it in the account management system; Step S2. After the account management system is initialized, several ordinary accounts are generated and encrypted and stored in the system, and enter the idle account queue. The maximum number of uses of ordinary accounts is set, and each ordinary account generates a transaction number, which is incremented by 1 each time the account is used. When the account usage reaches the set maximum number of uses, it enters the account recovery pool and no longer improves the on-chain signature service. A new ordinary account is regenerated by the creation account and added to the idle account queue. The maximum busy time of the ordinary account is set. The maximum busy time is the time difference from the completion of the signature of the ordinary account to the monitoring of the return of the public key of the ordinary account. If the maximum busy time is exceeded, the account return is considered to have failed. The account management system forcibly releases the ordinary account from the busy account queue to the idle account queue. The account management system starts the scheduled task, and the online scheduled update status is the queue of ordinary accounts that need to be updated, and the update scheduled task interval is set; Step S3. When several evidence storage systems need to store evidence on the chain, the evidence data is input into the account management system. The account management system performs a queue operation on the first common account in the idle account queue, signs the evidence data with the account private key, returns the account public key and the signed data, and puts the common account into the busy account queue; Step S4. After the evidence storage system receives the signed transaction, it needs to submit the transaction to the chain successfully within the maximum busy time of the account and return the account public key to the account management system. The account management system will increase the queue of the ordinary account by 1, then dequeue it from the busy account queue and add it to the last position of the idle account queue; The step S2 also includes setting a maximum on-chain fee rate for a common account. The step S3 account management system calculates the size of the evidence data and obtains the on-chain fee rate required for on-chain in the current blockchain state before obtaining the account. If the on-chain fee rate is greater than the maximum on-chain fee rate, an exception indicating an increase in the on-chain fee rate is returned. The step S4 is specifically as follows: Step S41. After the evidence storage system obtains the signed transaction, if it fails to submit the transaction to the chain successfully after the maximum busy time of the account, that is, if the account public key is not returned within the maximum busy time of the account, the account management system will forcibly remove the existing queue of the account from the busy account and return it to the idle account queue, marking the account status as needing to be updated; Step S42. Before the update timer task is triggered, if the evidence storage system polls the account signature whose usage status is to be updated, and the transaction is successfully submitted to the chain within the maximum busy time of the account and the account public key is returned, then the account management system will return the account from the busy account queue to the idle queue and cancel the update status. At this time, if the transaction in step S41 is submitted to the chain, it will prompt that the transaction failed to be evidenced; Step S43. The update scheduled task performs an account queue update operation every set time, that is, the account management system polls all accounts that need to be updated, obtains the latest queues of these accounts from the latest blockchain ledger and updates them locally, avoiding the error of too many transactions being submitted to the chain, and increasing the probability of transactions being successfully written to the ledger and the availability of accounts.

2. A blockchain account optimization method for blockchain evidence storage as claimed in claim 1, characterized in that The step S3 is specifically as follows: before acquiring the account, the account management system determines whether there is an idle account in the idle account queue, and if the idle account is empty, returns an exception indicating that the account is busy.

Citation Information

Patent Citations

  • Method and system for managing user transaction key on blockchain

    CN108667600A

  • Block chain-based evidence storage and preservation notarization system and method

    CN113468598A