Account book error correction method based on block chain technology

Through the combination of blockchain technology and smart contracts, the ledger error correction is automated, which solves the problems of low efficiency, high cost and insufficient security in traditional ledger error correction, and realizes efficient and accurate ledger data management.

CN118965447AActive Publication Date: 2024-11-15CHENGDU HONGYUNDING TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202410921972.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-15
Estimated Expiration
2044-07-10

AI Technical Summary

Technical Problem

Traditional ledger error correction methods rely on manual operations, are inefficient, expensive, and have risks of human error and tampering, making it difficult to ensure the accuracy and completeness of the data.

Method used

Adopt the ledger error correction method based on blockchain technology, and by building the ledger blockchain, using smart contracts and deep error correction models, the wrong data in the ledger is automatically identified and corrected to ensure the accuracy and security of the data.

Benefits of technology

It improves the efficiency of ledger data processing, reduces labor costs, enhances the credibility and security of data, reduces human errors, and ensures the integrity and transparency of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965447A_ABST
    Figure CN118965447A_ABST
Patent Text Reader

Abstract

The invention provides an account book error correction method based on a block chain technology, and the method comprises the steps: constructing an account book block chain according to account book records of different departments, and receiving an account book error correction request sent by a requester; acquiring information corresponding to a target account book according to the unique account book identifier, calling accounting detail analysis logic declared in the smart contract, and creating a corresponding accounting detail record; according to the current accounting detail record, performing hash value comparison with the blocks of the same category to obtain an output result indicating whether the account book information is correct or not; judging whether the output account book information is correct or not, performing different operations according to different output results, changing a corresponding accounting detail record in a target account book according to an error correction result, issuing the accounting detail record to a block chain, and generating a corresponding account book error report result at the same time; according to the invention, the correctness of the account book information can be accurately judged, and error correction processing is carried out on the wrong information by means of the block chain technology and the deep learning algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain and deep learning technology, and in particular to a ledger error correction method based on blockchain technology. Background Art

[0002] In the financial field, especially for financial institutions such as banks, ledger error correction technology is crucial to the entire industry. Traditional ledger error correction is often done manually, and traditional error correction methods face many problems:

[0003] (1) For transaction data in the ledger, it is necessary to be able to accurately identify errors in the ledger, and at the same time, ensure the integrity and consistency of the ledger when correcting errors. This requires strict requirements for manual work. It is necessary to carefully review the accounts, be able to check the accounts, and know the relevant financial regulations and standards to ensure the accuracy of error correction;

[0004] (2) In a financial system, bookkeeping error correction is very time-consuming, especially for large or complex financial systems, which have a large number of transactions and account records. Therefore, traditional manual error correction has no advantage in error correction efficiency and requires a large amount of manpower to correct errors.

[0005] (3) For traditional manual error correction, there are also huge problems with the security of error correction: on the one hand, manual error correction methods may result in deliberate tampering. The way to solve this problem is usually to have multiple people review and correct a single account book, which further increases labor costs and makes efficiency low. On the other hand, for a large financial system, error correction of account books is a very energy-consuming task. People’s energy is limited, and long-term error correction work will cause staff to make errors in the error correction process.

[0006] Blockchain is a distributed database technology used to store data and record the history of transactions and events. Blockchain has many characteristics, such as: blockchain does not rely on a single central agency, but is maintained by multiple nodes in the network; once data is added to the blockchain, it is almost impossible to modify or delete, so each block contains the hash value of the previous block. If you want to change the information in a block, you must change the information of all subsequent blocks at the same time, which is almost impossible; blockchain can be used to create distributed ledgers that can record the transaction history of data. Based on the various characteristics of blockchain, applying it to ledger error correction can effectively solve the current problems of inefficiency and high cost in the ledger data processing process.

[0007] Based on the above background, there is a need for a method that can accurately identify erroneous data in the ledger and effectively correct and store the ledger data to improve the efficiency of ledger data processing and reduce labor costs. Summary of the invention

[0008] In view of this, the purpose of the present invention is to provide a ledger error correction method based on blockchain technology, which can be prepared to identify erroneous data in the ledger and effectively correct it, so as to build a correct financial blockchain for the enterprise.

[0009] One of the purposes of the present invention is achieved through the following technical solutions:

[0010] A ledger error correction method based on blockchain technology, comprising the following steps:

[0011] Step S1: Build a ledger blockchain based on the ledger records of different departments, and receive the ledger error correction request sent by the requester;

[0012] Step S2: Obtain the information corresponding to the target ledger according to the unique identifier of the ledger, call the accounting detail analysis logic declared in the smart contract, and create the corresponding accounting detail record;

[0013] Step S3: Compare the hash values ​​of the current accounting details with the blocks of the same category to obtain the output result of whether the account book information is correct;

[0014] Step S4: Determine whether the output ledger information is correct. If the ledger information is correct, the corresponding accounting details are published to the blockchain. If it is incorrect, the accounting details are input into the deep error correction model for error correction processing, and the error correction results are obtained. According to the error correction results, the corresponding accounting details in the target ledger are changed and published to the blockchain, and the corresponding ledger error report results are generated at the same time.

[0015] Further, the step S1 comprises:

[0016] Step S101: The collector obtains the account book records of each department and generates a corresponding array;

[0017] Step S102: constructing a ledger blockchain according to the obtained ledger record arrays of each department;

[0018] Step S103: receiving the account book error correction request sent by the requesting party;

[0019] Step S104: Obtain the latest block from the blockchain, and obtain transaction data from the latest block as the root of the error correction requester authority verification tree RT;

[0020] Step S105: Construct an RT tree using the root of the RT tree, obtain the permission information corresponding to the error correction requester from the RT tree, and determine whether the error correction requester has permission based on the permission information;

[0021] Step S106: After the requester authentication passes, receive and store the error correction request sent by the requester;

[0022] Step S107: Perform an identification operation on the error correction request and record the error correction request as RID i , where RID i is the identification number of the error correction request, and i is the unique number of the identification number.

[0023] Furthermore, the specific process of constructing the RT tree in step S105 is as follows:

[0024] (1) Take out n pieces of transaction data TD from TransactionsData i ;

[0025] (2) Add the n pieces of transaction data TD to the bottom layer of the RT tree as the root of the RT tree;

[0026] (3) Perform a hash operation on the data block, Block i = Hash(TD i ), where 1 ≤ i ≤ n;

[0027] (4) Concatenate three adjacent Block blocks and then perform a hash operation;

[0028] (5) Block ((k+1) / 2) = Hash(Block (k-1) + Block k + Block (k+1) ), and k = 1, 3, 5, 7, …, n - 1;

[0029] (6) Use the calculated Block ((k+1) / 2) as the new leaf node;

[0030] (7) Repeat the calculation process of Block until a complete RT tree is generated;

[0031] Among them, TransactionsData i is the set of multiple transaction data in the memory of block i, TransactionsData i = {<TD1, transaction data 1>: <TD2, transaction data 2>: …: <TD i , transaction data i>: …: <TD n, transaction data n>}, where TD1 is the first transaction data, TD2 is the second transaction data, TD i is the i-th transaction data, n is the total amount of transaction data; Hash() is the method for calculating the sha-256 value; Block is the corresponding block in the blockchain.

[0032] Further, the step S2 comprises:

[0033] Step S201: Based on the unique identifier RID of the account book i , detect the block where the current ledger is located, and obtain the accounting rules and account book information corresponding to the target ledger from the block;

[0034] Step S202: calling the accounting details analysis logic declared in the smart contract;

[0035] Step S203: Create corresponding accounting details records according to the accounting rules and accounting information corresponding to the target account book.

[0036] Furthermore, the specific process and formula for creating the corresponding accounting detail record in step S203 are as follows:

[0037] (1) Obtain the unique address of the smart contract on the blockchain based on the contract deployment transaction;

[0038] (2) According to the current block, obtain the specified parameters, and then pass the parameters to the contract function to perform the operation. The formula for calling the contract function is:

[0039] tranTypeRules=fun_trule(p1,p2,…,p i ,…,p n )

[0040] amountItems=fun_amount(p1,p2,…,p i ,…,p n )

[0041] dateRules=fun_drule(p1,p2,…,p i ,…,p n )

[0042] accountRules=fun_arule(p1,p2,…,p i ,…,p n )

[0043] analysisLogicInfo={tranTypeRules,amountItems,dateRules,accountRules}

[0044] Among them, the fun_trule() function is used to obtain the rules of the current account book transaction type, tranTypeRules is the classification rule of the transaction type, the fun_amount() function is used to obtain the number of amount items in the current account book, amountItems is the number of amount items in the account book, the fun_drule() function is used to obtain the date rules, dateRules is the date rules, the fun_arule() function is used to obtain the classification rules of the current account book, accountRules is the account book classification rules, p i is the i-th parameter, n represents the number of parameters, and analysisLogicInfo is the returned accounting detail analysis logic information;

[0045] tranTypeRules=extract_r(analysisLogicInfo)

[0046] dateRules=extract_d(analysisLogicInfo)

[0047] tranRules={tranTypeRules,dateRules}

[0048] transactionDataType=typeAnalysis(tranRules,accountBookInfo)

[0049] Among them, the extract_r() function is used to extract the classification rules tranTypeRules of the transaction type in the accounting detail analysis logic information analysisLogicInfo, and the extract_d() function is used to extract the date rules dateRules in the accounting detail analysis logic information analysisLogicInfo. tranRules is a set of transaction data type rules, accountBookInfo is the account book accounting information, typeAnalysis() is a transaction data classification function, which is used to classify each transaction information according to the input transaction data type rules, and transactionDataType is the transaction data type.

[0050] amountItems=extract_am(analysisLogicInfo)

[0051] accountRules=extract_ac(analysisLogicInfo)

[0052] accRules={amountItems,accountRules,dateRules}

[0053] accountBookCategory=categorize(transactionDataType,accRules,accountBookInfo)

[0054] Among them, the extract_am() function is used to extract the number of account book amount items amountItems in the accounting detail analysis logic information analysisLogicInfo, the extract_ac() function is used to extract the account book classification rules accountRules in the accounting detail analysis logic information analysisLogicInfo, accRules is the account book category rule set, categorize() is the account book classification function, the main function of this function is to assign the classified transaction data type transactionDataType and account book accounting information accountBookInfo to the account book according to specific rules, and return the account book category information at the same time, accountBookCategory is the account book category;

[0055] actorRules={dateRules,transactionDataType,accountBookCategory}

[0056] acterInfo=accountAssign(acterRules,accountBookInfo)

[0057] accountingRecord={transactionDataType,accountBookCategory,acterInfo,accountBookInfo}

[0058] Among them, actorRules is the account classification rule set, accountAssign() is the account assignment function, which assigns specific ledgers and transactions to corresponding users according to the input account classification rule set actorRules and account book accounting information accountBookInfo, and returns the account information, actorInfo is the assigned account information;

[0059] Among them, accountingRecord is the accounting detail record.

[0060] Further, the step S3 comprises:

[0061] Step S301: Based on the account book accounting information in the current accounting details record, a hash operation is performed on it to obtain a hash value h x ;

[0062] Step S302: According to the account book category information of the currently verified block, find the block of the same category in the blockchain, and perform a hash operation on the account book information in the account record of the block to obtain the hash value h y ;

[0063] Step S303: h x With h y For comparison, if the two hash values ​​are the same, the accounting details record in the verified block is correct and the record is True. If the two hash values ​​are different, the accounting details record in the verified block is wrong and the record is False.

[0064] Furthermore, the specific process of performing hash operation on the accounting detail record in step S301 is as follows:

[0065] (1) Split and fill the account book information in the current account record to generate N 256-bit information blocks M (i) ;

[0066] (2) Use the SHA-256 encryption algorithm to encrypt the information block M (i) Perform circular calculation to achieve encryption;

[0067] (3)h x The value is calculated as follows:

[0068] h (i) =sha_256(M (i) )

[0069] h x =h (1) ||h (2) ||h (3) …||h (i)

[0070] Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h x The hash value generated for the account book information of the verified block, || is a concatenation operation.

[0071] Furthermore, the specific process of performing hash operation on the accounting information of blocks of the same category in step S302 is as follows:

[0072] (1) Extract account book category information accountBookCategory from the current accounting detail record to be verified;

[0073] (2) Based on the extracted account book category information accountBookCategory, find the block b with the same account book category on the chain y ;

[0074] (3) According to the discovered block b y , extract the account book information accountBookInfo_b of this block y ;

[0075] (4) Record the account book information of this block as accountBookInfo_b y Use the SHA-256 algorithm to encrypt and get the corresponding hash value h y ,h y The value is calculated as follows:

[0076] h (i) =sha_256(M (i) )

[0077] h y =h (1) ||h (2) ||h (3) …||h (i)

[0078] Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h y The hash value generated for the ledger information of the same block of the identified category, || is a concatenation operation.

[0079] Further, the step S4 comprises:

[0080] Step S401: Based on the output result of the ledger information, if the result record is True, the corresponding accounting details record is published to the blockchain;

[0081] Step S402: If the result record is False, the accounting detail record is input into the preset deep error correction model for error correction processing, and the error correction result is obtained;

[0082] Step S403: According to the correct accounting information obtained, the corresponding accounting details in the target account book are modified;

[0083] Step S404: Publish the corrected target ledger to the blockchain and generate a corresponding ledger error report result.

[0084] Furthermore, the specific process of inputting the accounting detail records into the preset deep error correction model for error correction processing in step S402 is as follows:

[0085] (1) Extract the account book accounting information accountBookInfo from the accounting details record, pre-process the account book accounting information, and obtain the data set ac_datas;

[0086] (2) Vectorize the data set ac_datas to obtain a vector representation of the training data:

[0087] d i =data_embeding(y i )+row_embedding(y i )+site_embedding(y i )

[0088] Among them, d i represents the training data vector, y i represents the i-th character in the accounting information, data_embedding() is the data embedding vector obtaining function, row_embedding() is the row embedding vector obtaining function, and site_embedding() is the position embedding vector obtaining function;

[0089] (3) For the training data vector d i Perform mask connection preprocessing to obtain embedded data, the embedded data d i 'The calculation formula is as follows:

[0090]

[0091] Among them, d i ' is the embedded data, ρ is the variance coefficient, * is the multiplication operator, P a is the bias term in the fully connected layer, Q a is the weight matrix in the fully connected layer, is the matrix inner product operation, is the encoding hidden vector, d mask is the embedded "mask" special data, d e is the vector with errors in the training vector;

[0092] (4) The embedded data is encoded using the repair network of the error correction model to obtain the hidden state of the middle coding layer in the multiple coding layers, the hidden state and the embedded data are differentially connected to obtain the connection value, which is then input into the fully connected layer, and the posterior probability of the connection value is calculated using the activation function in the fully connected layer. The posterior probability is compared with the error correction tolerance. When the posterior probability is less than the error correction tolerance, the error correction result is judged to be wrong. When the posterior probability is greater than or equal to the error correction tolerance, the error correction result is judged to be correct. The posterior probability calculation formula is as follows:

[0093] cv i '=hd i +d i '

[0094] P i (x i = k|X) = activate(cv i ')*100%

[0095] Among them, cv i ' is the connection value, hd i is the hidden state, d i ' is the embedded data, P i (x i = k|X) is the character x i The posterior probability of being corrected to character k, X is the sample space of the text to be corrected, activate() is the activation function in the fully connected layer, and * is the multiplication operator;

[0096] (5) Calculate the logarithmic loss value of the error correction model according to the error correction result, adjust the model parameters of the deep error correction model according to the logarithmic loss value, and output the standard error correction model. The logarithmic loss value calculation formula of the error correction model is as follows:

[0097]

[0098] Among them, L is the logarithmic loss value of the error correction model, p is the error correction rate, q is the preset detection rate, k is the preset fixed weight, and n is the total amount of data;

[0099] (6) Inputting the bookkeeping information into the predetermined deep error correction model, and obtaining the correct bookkeeping information after error correction through a preset multi-round error correction mechanism.

[0100] The beneficial effects of the present invention include:

[0101] (1) Based on blockchain technology, the present invention combines the account book information of different departments into a blockchain, making the management of the account book more decentralized and not relying solely on a single management entity, thereby increasing the credibility and stability of the account book and facilitating the management of the account book;

[0102] (2) The present invention proposes an RT tree, which combines the characteristics of the Merkle tree and the prefix tree. It is a data structure that efficiently stores and retrieves data and is suitable for the blockchain ledger error correction scenario. It makes the verification of data integrity more efficient and the judgment of the error correction request authority more accurate. Its flexibility and verifiability can make the storage and modification of ledger transaction data safer.

[0103] (3) The present invention only needs to perform hash processing on the same category of ledgers in the blockchain, and judges the correctness of the ledger by comparing the hash values ​​of two blocks, thereby improving the efficiency and accuracy of error correction. At the same time, automated data verification can effectively reduce the need for manual intervention, thereby reducing the cost of manual maintenance and operation;

[0104] (4) The present invention further enhances the accuracy of the ledger data by invoking the smart contract of the blockchain to obtain detailed records of the ledger. Through the distributed characteristics of the blockchain and the smart contract, transactions can be automatically executed, reducing human errors and human changes to the data.

[0105] (5) The present invention uses the ledger as a block, which can provide the characteristic that data cannot be tampered with, ensuring that the data on the ledger is not maliciously tampered with, which helps to improve the integrity and transparency of the data; at the same time, based on the SHA-256 encryption technology and using block encryption to encrypt the ledger information, the security of the ledger is further enhanced, which can reduce the risk of data tampering and attack;

[0106] (6) The present invention adopts a combination of smart contracts and deep error correction models to realize an efficient ledger error correction mechanism; the smart contract extracts the data required by the model according to the accounting rules and specified parameters, and then transmits the data to the deep learning model for deep error correction processing. The advantage of this error correction mechanism is that it is highly automated and intelligent, and can quickly and effectively discover and correct errors, thereby improving the efficiency and accuracy of error correction. Compared with the traditional natural language error correction model, this method is more suitable for the high security requirements of ledger data, can better adapt to the needs of ledger management, and ensure the accuracy and security of data;

[0107] (7) The mask connection preprocessing proposed in the present invention allows the model to ignore uncertain data, which enhances the robustness of the model to noise or missing data. At the same time, due to the use of the encoded hidden vector, the model can consider the contextual information of the input data, which helps to better understand and process the data. By connecting the error vector, the formula can directly process and correct the errors in the data during the training process, thereby improving the accuracy of the output data.

[0108] (8) The logarithmic loss value calculation formula of the deep error correction model proposed in the present invention is highly flexible. Compared with other loss function calculation formulas, this method can fine-tune the loss function for specific error types or data imbalance problems by adjusting the fixed weight k; at the same time, the formula takes into account the error correction probability p and the preset detection probability q, which helps the model to better balance the relationship between the predicted results and the actual results in practical applications, thereby improving the robustness of the model.

[0109] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description and the preceding claims. BRIEF DESCRIPTION OF THE DRAWINGS

[0110] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:

[0111] Figure 1 A flowchart of a ledger error correction method based on blockchain technology of the present invention;

[0112] Figure 2 This is an example diagram of an array of account book records of the finance department, the purchasing department, the sales department, and the tax department acquired by the data collector in an embodiment of the present invention;

[0113] Figure 3 This is an example diagram of the ledger blockchain of an embodiment of the present invention;

[0114] Figure 4 This is an example diagram of a transaction data set of a tax department block in an embodiment of the present invention;

[0115] Figure 5 This is an example diagram of a transaction data set of a financial department block in an embodiment of the present invention;

[0116] Figure 6 This is an example diagram of RT tree construction according to an embodiment of the present invention;

[0117] Figure 7 This is an example diagram of information blocks after the accounting information of the tax department's account book is segmented and filled in an embodiment of the present invention;

[0118] Figure 8 This is an example diagram of generating hash values ​​by hash encryption of tax department information blocks according to an embodiment of the present invention;

[0119] Fig. 9 This is an example diagram of information blocks after the accounting information of the financial department account book is divided and filled in an embodiment of the present invention;

[0120] Fig.10 This is an example diagram of generating hash values ​​by hash encryption of a financial department information block according to an embodiment of the present invention;

[0121] Fig.11 This is an example diagram of the error correction process of the deep error correction model for some transaction details in an embodiment of the present invention. DETAILED DESCRIPTION

[0122] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0123] The present invention provides a ledger error correction method based on blockchain technology, such as Figure 1 As shown, the following steps are included:

[0124] Step S1: Build a ledger blockchain based on the ledger records of different departments, and receive the ledger error correction request sent by the requester;

[0125] Step S2: Obtain the information corresponding to the target ledger according to the unique identifier of the ledger, call the accounting detail analysis logic declared in the smart contract, and create the corresponding accounting detail record;

[0126] Step S3: Compare the hash values ​​of the current accounting details with the blocks of the same category to obtain the output result of whether the account book information is correct;

[0127] Step S4: Determine whether the output ledger information is correct. If the ledger information is correct, the corresponding accounting details are published to the blockchain. If it is incorrect, the accounting details are input into the deep error correction model for error correction processing, and the error correction results are obtained. According to the error correction results, the corresponding accounting details in the target ledger are changed and published to the blockchain, and the corresponding ledger error report results are generated at the same time.

[0128] The specific steps of the above method will be further described below through a specific embodiment.

[0129] In this embodiment, step S1 specifically includes the following steps:

[0130] Step S101: The collector obtains the account book records of each department and generates a corresponding array;

[0131] In step S101, the data collected by the data collector is as follows: Figure 2As shown, after the collector obtains the ledger records of the finance department, procurement department, sales department, and tax department, the generated array format is as follows: The finance department array FinanceDept = {FDR1, FDR2, …, FDR i}, the procurement department array ProcurementDept = {PDR1, PDR2, …, PDR j}, the sales department array SalesDept = {SDR1, SDR2, …, SDR k}, the tax department array TaxDept = {TDR1, TDR2, …, TDR x}, where FinanceDept represents the array storing all ledger records of the finance department, FDR1 represents the finance department ledger record 1, FDR2 represents the finance department ledger record 2, FDR i represents the finance department ledger record i, ProcurementDept is the array storing all ledger records of the procurement department, PDR1 represents the procurement department ledger record 1, PDR2 represents the procurement department ledger record 2, PDR j represents the procurement department ledger record j, SalesDept is the array storing all ledger records of the sales department, SDR1 represents the sales department ledger record 1, SDR2 represents the sales department ledger record 2, SDR k represents the sales department ledger record k, TaxDept represents the array storing all ledger records of the tax department, TDR1 represents the tax department ledger record 1, TDR2 represents the tax department ledger record 2, TDR x represents the tax department ledger record x.

[0132] Step S102: Construct a ledger blockchain based on the obtained ledger record arrays of each department;

[0133] Step S102 constructs a ledger blockchain AccountChain with the finance department array FinanceDept, procurement department array ProcurementDept, sales department array SalesDept, and tax department array TaxDept as nodes. The constructed ledger blockchain is as Figure 3 shown. The ledger blockchain AccountChain = {<Block1, block 1>: <Block2, block 2>: …: <Block i , block i>: …: <Block n , block n>}, where AccountChain represents the ledger blockchain storing all smart contracts, Block1 represents block 1, Block2 represents block 2, Block iDenote the block as i, and n as the total number of blocks. Each Block consists of a set, where Block = {<BlockVersion, version number of the block header> : <PrevBlockHash, Hash value of the previous block of this block> : <MerkleRootHash, Hash value of the Merkle root of the transactions in the block> : <TimeStamp, creation timestamp of this block> : <WorkDifficultyTarget, proof-of-work difficulty target of this blockchain> : <WorkNonce, calculation parameter used to prove the work> : <DealNumTransactionsBytes, number of bytes occupied by the transaction count> : <DealNumTransactions, number of transactions in the block> : <TransactionsData i , a set of multiple transaction data stored in the block memory> : <RT, Hash value of the transaction permission verification tree in the block>};

[0134] Among them, BlockVersion is the version number of the block header, PrevBlockHash is the Hash value of the previous block of this block, MerkleRootHash is the Hash value of the Merkle root of the transactions in the block, TimeStamp is the creation timestamp of this block, WorkDifficultyTarget is the proof-of-work difficulty target of this blockchain, WorkNonce is the calculation parameter used to prove the work, DealNumTransactionsBytes is the number of bytes occupied by the transaction count, DealNumTransactions is the number of transactions in the block, TransactionsData i is a set of multiple transaction data stored in the memory of block i, and RT is the Hash value of the transaction permission verification tree in the block.

[0135] Step S103: Receive the ledger error correction request sent by the requester;

[0136] In step S103, the requesting tax department issues the ledger error correction request ErrorRequestInfo.

[0137] Step S104: Obtain the latest block from the blockchain, and obtain the transaction data from the latest block as the root of the RT tree;

[0138] Step S105: Construct an RT tree using the root of the RT tree, obtain the permission information corresponding to the error correction requester from the RT tree, and determine whether the error correction requester has the permission according to the permission information;

[0139] The specific process of constructing the RT tree in step S105 is as follows:

[0140] (1) Take out n pieces of transaction data TD from TransactionsData i ;

[0141] (2) Add the n pieces of transaction data TD to the bottom layer of the RT tree as the root of the RT tree;

[0142] (3) Perform a hash operation on the data block, Block i = Hash(TD i ), where 1 ≤ i ≤ n;

[0143] (4) Concatenate three adjacent Block blocks and then perform a hash operation;

[0144] (5) Block ((k+1) / 2) = Hash(Block (k-1) + Block k + Block (k+1) ), and k = 1, 3, 5, 7, …, n - 1;

[0145] (6) Take the calculated Block ((k+1) / 2) as the new leaf node;

[0146] (7) Repeat the calculation process of Block until a complete RT tree is generated;

[0147] Among them, TransactionsData i is the set of multiple transaction data in the memory of block i, TransactionsData i = {<TD1, transaction data 1>: <TD2, transaction data 2>: …: <TD i , transaction data i>: …: <TD n , transaction data n>}, where TD1 is the first piece of transaction data, TD2 is the second piece of transaction data, TD i is the i-th piece of transaction data, and n is the total amount of transaction data; Hash() is the method for calculating the sha - 256 value; Block is the corresponding block in the blockchain;

[0148] In this implementation, Figure 4 is an example diagram of the transaction data set of the tax department block, Figure 5 is an example diagram of the transaction data set of the financial department block, where the transaction data of both departments is 3 pieces, Figure 6 is an example diagram of RT tree construction.

[0149] Step S106: After the requester is authenticated, receive and store the error correction request sent by the requester;

[0150] Step S107: perform an identification operation on the error correction request and record the error correction request as RID i , where RID i is the identification number of the error correction request, and i is the unique number of the identification number.

[0151] Step S2: Obtain the information corresponding to the target account book according to the account book unique identifier, call the accounting detail analysis logic declared in the smart contract, and create the corresponding accounting detail record;

[0152] In this embodiment, S2 specifically includes the following steps:

[0153] Step S201: Based on the unique identifier RID of the account book i , detect the block where the current ledger is located, and obtain the accounting rules and account book information corresponding to the target ledger from the block;

[0154] Step S202: calling the accounting details analysis logic declared in the smart contract;

[0155] Step S203: Create corresponding accounting details records according to the accounting rules and accounting information corresponding to the target account book.

[0156] The specific method of creating the corresponding accounting detail record in step S203 is:

[0157] (1) Obtain the unique address of the smart contract on the blockchain based on the contract deployment transaction;

[0158] (2) According to the current block, obtain the specified parameters, and then pass the parameters to the contract function to perform the operation. The formula for calling the contract function is:

[0159] tranTypeRules=fun_trule(p1,p2,…,p i ,…,p n )

[0160] amountItems=fun_amount(p1,p2,…,p i ,…,p n )

[0161] dateRules=fun_drule(p1,p2,…,p i ,…,p n )

[0162] accountRules=fun_arule(p1,p2,…,p i ,…,p n )

[0163] analysisLogicInfo={tranTypeRules,amountItems,dateRules,accountRules}

[0164] Among them, the fun_trule() function is used to obtain the rules of the current account book transaction type, tranTypeRules is the classification rule of the transaction type, the fun_amount() function is used to obtain the number of amount items in the current account book, amountItems is the number of amount items in the account book, the fun_drule() function is used to obtain the date rules, dateRules is the date rules, the fun_arule() function is used to obtain the classification rules of the current account book, accountRules is the account book classification rules, p i is the i-th parameter, n represents the number of parameters, and analysisLogicInfo is the returned accounting detail analysis logic information;

[0165] tranTypeRules=extract_r(analysisLogicInfo)

[0166] dateRules=extract_d(analysisLogicInfo)

[0167] tranRules={tranTypeRules,dateRules}

[0168] transactionDataType=typeAnalysis(tranRules,accountBookInfo)

[0169] Among them, the extract_r() function is used to extract the classification rules tranTypeRules of the transaction type in the accounting detail analysis logic information analysisLogicInfo, and the extract_d() function is used to extract the date rules dateRules in the accounting detail analysis logic information analysisLogicInfo. tranRules is a set of transaction data type rules, accountBookInfo is the account book accounting information, typeAnalysis() is a transaction data classification function, which is used to classify each transaction information according to the input transaction data type rules, and transactionDataType is the transaction data type.

[0170] amountItems=extract_am(analysisLogicInfo)

[0171] accountRules=extract_ac(analysisLogicInfo)

[0172] accRules={amountItems,accountRules,dateRules}

[0173] accountBookCategory=categorize(transactionDataType,accRules,accountBookInfo)

[0174] Among them, the extract_am() function is used to extract the number of account book amount items amountItems in the accounting detail analysis logic information analysisLogicInfo, the extract_ac() function is used to extract the account book classification rules accountRules in the accounting detail analysis logic information analysisLogicInfo, accRules is the account book category rule set, categorize() is the account book classification function, the main function of this function is to assign the classified transaction data type transactionDataType and account book accounting information accountBookInfo to the account book according to specific rules, and return the account book category information at the same time, accountBookCategory is the account book category;

[0175] actorRules={dateRules,transactionDataType,accountBookCategory}

[0176] acterInfo=accountAssign(acterRules,accountBookInfo)

[0177] accountingRecord={transactionDataType,accountBookCategory,acterInfo,accountBookInfo}

[0178] Among them, actorRules is the account classification rule set, accountAssign() is the account assignment function, which assigns specific ledgers and transactions to corresponding users according to the input account classification rule set actorRules and account book accounting information accountBookInfo, and returns the account information, actorInfo is the assigned account information;

[0179] Among them, accountingRecord is the accounting detail record;

[0180] In this embodiment, the parameters p provided by the block where the tax department is located are: p1 = TaxSender, p2 = TaxValue, p3 = TaxBlock, p4 = TaxState. The parameters are input into the fun_trule() function, fun_amount() function, fun_drule() function, and fun_arule() function to obtain the parameters TaxtranTypeRules, TaxamountItems, TaxdateRules, TaxaccountRules, and the accounting detail analysis logic information TaxanalysisLogicInfo of the block where the tax department is located, where TaxSender is the address information of the sender, TaxValue is the amount of currency passed to the contract by the sender, and TaxBlock is the information set of the block where the tax department is located, including the timestamp of the block, random TaxState is the state variable of the contract that the contract function needs to access or modify. TaxtranTypeRules is the ledger transaction type rule of the block where the tax department is located, which is returned by calling the fun_trule() function. TaxamountItems is the number of ledger amount entries of the block where the tax department is located, which is returned by calling the fun_amount() function. TaxdateRules is the date rule of the block where the tax department is located, which is returned by calling the fun_drule() function. TaxaccountRules is the ledger classification rule of the block where the tax department is located, which is returned by calling the fun_arule() function. Among them, parameter TaxanalysisLogicInfo={TaxtranTypeRules,TaxamountItems,TaxdateRules,TaxaccountRules};

[0181] Input TaxanalysisLogicInfo to the extract_r() function and extract_d() function, and return the parameters TaxtranTypeRules, TaxdateRules, and TaxtranRules, where the parameter TaxtranRules = {TaxtranTypeRules, TaxdateRules}; input TaxaccountBookInfo and TaxtranRules to the typeAnalysis() function, and return TaxtransactionDataType, where TaxaccountBookInfo is the account book information provided by the block where the tax department is located, and TaxtransactionDataType is the transaction data type of the block where the tax department is located;

[0182] Input TaxanalysisLogicInfo to the extract_am() function and extract_ac() function, and return the parameters TaxamountItems, TaxaccountRules, and TaxaccRules, where the parameter TaxaccRules = {TaxamountItems, TaxaccountRules, TaxdateRules}; Input TaxaccountBookInfo, TaxaccRules, and TaxtransactionDataType to the categorize() function, and return TaxaccountBookCategory, where TaxaccountBookCategory is the account book category of the block where the tax department is located;

[0183] The above-obtained parameters TaxdateRules, TaxtransactionDataType, and TaxaccountBookCategory are combined to obtain the parameter TaxacterRules, where TaxacterRules is the account classification rule set of the block where the tax department is located; actorRules and TaxaccountBookInfo are input into the accountAssign() function, and TaxacterInfo is returned, where TaxacterInfo is the account information of the block where the tax department is located, and the parameter TaxaccountingRecord = {TaxtransactionDataType, TaxaccountBookCategory, TaxacterInfo, TaxaccountBookInfo}, where TaxaccountingRecord is the accounting detail record of the block where the tax department is located.

[0184] Step S3: Compare the hash values ​​of the current accounting details with those of the same category of blocks to obtain the output result of whether the account book information is correct.

[0185] In this embodiment, S3 specifically includes the following steps:

[0186] Step S301: Based on the account book accounting information in the current accounting details record, a hash operation is performed on it to obtain a hash value h x ;

[0187] In step S301, the specific process of performing hash operation on the accounting detail record is as follows:

[0188] (1) Split and fill the account book information in the current account record to generate N 256-bit information blocks M (i) ;

[0189] (2) Use the SHA-256 encryption algorithm to encrypt the information block M (i) Perform circular calculation to achieve encryption;

[0190] (3)h x The value is calculated as follows:

[0191] h (i) =sha_256(M (i) )

[0192] h x =h (1) ||h (2) ||h (3) …||h (i)

[0193] Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h x The hash value generated for the account book information of the verified block, || is a concatenation operation;

[0194] In this embodiment, according to the current accounting detail record set TaxaccountingRecord, the current account book accounting information TaxaccountBookInfo is extracted from it, and the split and fill method split_and_fill() in the hashlib library is called to generate three 256-bit information blocks M (i) ,like Figure 7 As shown, then the information block M (i) Perform cyclic calculation and hash encryption using the SHA-256 algorithm to calculate h (1) 、h (2) 、h (3) The value of h x , the generation process is as follows Figure 8 shown.

[0195] Step S302: According to the account book category information of the currently verified block, find the block of the same category in the blockchain, and perform a hash operation on the account book information in the account record of the block to obtain the hash value h y ;

[0196] In step S302, the specific process of performing hash operation on the accounting information of blocks of the same category is as follows:

[0197] (1) Extract account book category information accountBookCategory from the current accounting detail record to be verified;

[0198] (2) Based on the extracted account book category information accountBookCategory, find the block b with the same account book category on the chain y ;

[0199] (3) According to the discovered block b y , extract the account book information accountBookInfo_b of this block y ;

[0200] (4) Record the account book information of this block as accountBookInfo_b y Use the SHA-256 algorithm to encrypt and get the corresponding hash value h y ,h y The value is calculated as follows:

[0201] h (i) =sha_256(M (i) )

[0202] h y =h (1) ||h (2) ||h (3) …||h (i)

[0203] Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h y The hash value generated for the ledger bookkeeping information of the same block of the identified category, || is a concatenation operation;

[0204] In this embodiment, according to the current accounting detail record set TaxaccountingDetailsRecord, the current account book category information TaxaccountBookCategory is extracted therefrom, and the same account book category block is found on the chain according to the current account book category information, that is, the block where the finance department is located, and the account book accounting information FinaccountBookInfo of the block where the finance department is located is extracted according to the block where the finance department is located, and the account book accounting information FinaccountBookInfo of the block where the finance department is located is divided and filled to generate three 256-bit information blocks M (i) ,like Fig. 9 As shown, for information block M (i) Perform cyclic calculation and hash encryption with SHA-256 algorithm to get h y , the generation process is as follows Fig.10 shown.

[0205] Step S303: h x With h y Compare the two hash values. If the two hash values ​​are the same, the detailed accounting records in the verified block are correct and recorded as True. If the two hash values ​​are different, the detailed accounting records in the verified block are wrong and recorded as False.

[0206] In this embodiment, h x Value and h y If the values ​​are different, the accounting details record in the verified block is wrong and the record is False.

[0207] Step S4: Determine whether the output ledger information is correct. If the ledger information is correct, the corresponding accounting details are published to the blockchain. If it is incorrect, the accounting details are input into the deep error correction model for error correction processing, and the error correction results are obtained. According to the error correction results, the corresponding accounting details in the target ledger are changed and published to the blockchain, and the corresponding ledger error report results are generated at the same time.

[0208] In this embodiment, S4 specifically includes the following steps:

[0209] Step S401: Based on the output result of the ledger information, if the result record is True, the corresponding accounting details record is published to the blockchain;

[0210] Step S402: If the result record is False, the accounting detail record is input into the preset deep error correction model for error correction processing, and the error correction result is obtained;

[0211] Step S403: According to the correct accounting information obtained, the corresponding accounting details in the target account book are modified;

[0212] Step S404: Publish the corrected target ledger to the blockchain and generate a corresponding ledger error report result;

[0213] In step S402, the specific process of inputting the accounting details into the preset deep error correction model for error correction is as follows:

[0214] (1) Extract the account book accounting information accountBookInfo from the accounting details record, pre-process the account book accounting information, and obtain the data set ac_datas;

[0215] (2) Vectorize the data set ac_datas to obtain a vector representation of the training data:

[0216] d i =data_embeding(y i )+row_embedding(y i )+site_embedding(y i )

[0217] Among them, d i represents the training data vector, y i represents the i-th character in the accounting information, data_embedding() is the data embedding vector obtaining function, row_embedding() is the row embedding vector obtaining function, and site_embedding() is the position embedding vector obtaining function;

[0218] (3) For the training data vector d i Perform mask connection preprocessing to obtain embedded data, the embedded data d i 'The calculation formula is as follows:

[0219]

[0220] Among them, d i ' is the embedded data, ρ is the variance coefficient, * is the multiplication operator, P a is the bias term in the fully connected layer, Q a is the weight matrix in the fully connected layer, is the matrix inner product operation, is the encoding hidden vector, d mask is the embedded "mask" special data, d e is the vector with errors in the training vector;

[0221] (4) The embedded data is encoded using the repair network of the error correction model to obtain the hidden state of the middle coding layer in the multiple coding layers, the hidden state and the embedded data are differentially connected to obtain the connection value, which is then input into the fully connected layer, and the posterior probability of the connection value is calculated using the activation function in the fully connected layer. The posterior probability is compared with the error correction tolerance. When the posterior probability is less than the error correction tolerance, the error correction result is judged to be wrong. When the posterior probability is greater than or equal to the error correction tolerance, the error correction result is judged to be correct. The posterior probability calculation formula is as follows:

[0222] cv i '=hd i +d i '

[0223] P i (x i = k|X) = activate(cv i ')*100%

[0224] Among them, cv i ' is the connection value, hd i is the hidden state, d i ' is the embedded data, P i (x i = k|X) is the character x i The posterior probability of being corrected to character k, X is the sample space of the text to be corrected, activate() is the activation function in the fully connected layer, and * is the multiplication operator;

[0225] (5) Calculate the logarithmic loss value of the error correction model according to the error correction result, adjust the model parameters of the deep error correction model according to the logarithmic loss value, and output the standard error correction model. The logarithmic loss value calculation formula of the error correction model is as follows:

[0226]

[0227] Among them, L is the logarithmic loss value of the error correction model, p is the error correction rate, q is the preset detection rate, k is the preset fixed weight, and n is the total amount of data;

[0228] (6) Inputting the bookkeeping information into the predetermined deep error correction model, and obtaining the correct bookkeeping information after error correction through a preset multi-round error correction mechanism;

[0229] In this embodiment, the tax department account book accounting information TaxaccountBookInfo is preprocessed to obtain a data set Datas, and Datas is vectorized to obtain a training data vector Datas. i , Datas i Perform mask preprocessing to obtain embedded data Datas i ', the posterior probability is calculated by the posterior probability formula: P i =96.96%;

[0230] Knowing that the error correction margin is 95.00%, the posterior probability P i If the error correction result is greater than the error correction tolerance, the error correction result is determined to be correct True, and the logarithmic loss value of the Bert error correction model is calculated according to the error correction result: L = 0.03564, where the error correction process of some transaction details is as follows Fig.11 shown.

[0231] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0232] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0233] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0234] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0235] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the protection scope of the present invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific variations and combinations that do not deviate from the essence of the present invention based on the technical revelations disclosed by the present invention, and these variations and combinations are still within the protection scope of the present invention.

Claims

1. A ledger error correction method based on blockchain technology, characterized in that: The method comprises the following steps: Step S1: Build a ledger blockchain based on the ledger records of different departments, and receive the ledger error correction request sent by the requester; Step S2: Obtain the information corresponding to the target ledger according to the unique identifier of the ledger, call the accounting detail analysis logic declared in the smart contract, and create the corresponding accounting detail record; Step S3: Compare the hash values ​​of the current accounting details with the blocks of the same category to obtain the output result of whether the account book information is correct; Step S4: Determine whether the output ledger information is correct. If the ledger information is correct, the corresponding accounting details are published to the blockchain. If it is incorrect, the accounting details are input into the deep error correction model for error correction processing, and the error correction results are obtained. According to the error correction results, the corresponding accounting details in the target ledger are changed and published to the blockchain, and the corresponding ledger error report results are generated at the same time.

2. According to claim 1, a ledger error correction method based on blockchain technology is characterized in that: The step S1 specifically includes: Step S101: The collector obtains the account book records of each department and generates a corresponding array; Step S102: constructing a ledger blockchain according to the obtained ledger record arrays of each department; Step S103: receiving the account book error correction request sent by the requesting party; Step S104: Obtain the latest block from the blockchain, and obtain transaction data from the latest block as the root of the error correction requester authority verification tree RT; Step S105: constructing an RT tree using the root of the RT tree, and obtaining the authority information corresponding to the error correction requester from the RT tree, and judging whether the error correction requester has the authority according to the authority information; Step S106: After the requesting party passes the authentication, receiving and storing the error correction request sent by the requesting party; Step S107: perform an identification operation on the error correction request and record the error correction request as RID i , where RID i is the identification number of the error correction request, and i is the unique number of the identification number.

3. According to claim 1, a ledger error correction method based on blockchain technology is characterized in that: The specific process of constructing the RT tree in step S105 is as follows: (1) From TransactionsData i Take out n pieces of transaction data TD; (2) Add n copies of transaction data TD to the bottom layer of the RT tree as the root of the RT tree; (3) Perform hash operation on the data block, Block i =Hash(TD i ), where 1≤i≤n; (4) Connect three adjacent blocks in series and then perform hash calculation; (5)Block ((k+1) / 2) = Hash(Block (k-1) + Block k + Block (k+1) ), and k = 1, 3, 5, 7, …, n - 1; (6) The Block obtained by calculation ((k+1) / 2) As a new leaf node; (7) Repeat the calculation process of Block until a complete RT tree is generated; Among them, TransactionsData i is a set of multiple transaction data in the memory of block i. TransactionsData i = {<TD1, transaction data 1>: <TD2, transaction data 2>: …: <TD i , transaction data i>: …: <TD n , transaction data n>}, where TD1 is the first piece of transaction data, TD2 is the second piece of transaction data, TD i is the i-th piece of transaction data, and n is the total amount of transaction data; Hash() is a method for calculating the sha-256 value; Block is the corresponding block in the blockchain.

4. According to claim 1, a ledger error correction method based on blockchain technology is characterized in that: The step S2 specifically includes: Step S201: Based on the unique identifier RID of the account book i , detect the block where the current ledger is located, and obtain the accounting rules and account book information corresponding to the target ledger from the block; Step S202: calling the accounting details analysis logic declared in the smart contract; Step S203: Create corresponding accounting details records according to the accounting rules and accounting information corresponding to the target account book.

5. According to claim 4, a ledger error correction method based on blockchain technology is characterized in that: The specific method of creating the corresponding accounting detail record in step S203 is: (1) Obtain the unique address of the smart contract on the blockchain based on the contract deployment transaction; (2) According to the current block, obtain the specified parameters, and then pass the parameters to the contract function to perform the operation. The formula for calling the contract function is: tranTypeRules=fun_trule(p1,p2,…,p i ,…,p n ) amountItems=fun_amount(p1,p2,…,p i ,…,p n ) dateRules=fun_drule(p1,p2,…,p i ,…,p n ) accountRules=fun_arule(p1,p2,…,p i ,…,p n ) analysisLogicInfo={tranTypeRules,amountItems,dateRules,accountRules} Among them, the fun_trule() function is used to obtain the rules of the current account book transaction type, tranTypeRules is the classification rule of the transaction type, the fun_amount() function is used to obtain the number of amount items in the current account book, amountItems is the number of amount items in the account book, the fun_drule() function is used to obtain the date rules, dateRules is the date rules, the fun_arule() function is used to obtain the classification rules of the current account book, accountRules is the account book classification rules, p i is the i-th parameter, n represents the number of parameters, and analysisLogicInfo is the returned accounting detail analysis logic information; tranTypeRules=extract_r(analysisLogicInfo) dateRules=extract_d(analysisLogicInfo) tranRules={tranTypeRules,dateRules} transactionDataType=typeAnalysis(tranRules,accountBookInfo) Among them, the extract_r() function is used to extract the classification rules tranTypeRules of the transaction type in the accounting detail analysis logic information analysisLogicInfo, and the extract_d() function is used to extract the date rules dateRules in the accounting detail analysis logic information analysisLogicInfo. tranRules is a set of transaction data type rules, accountBookInfo is the account book accounting information, typeAnalysis() is a transaction data classification function, which is used to classify each transaction information according to the input transaction data type rules, and transactionDataType is the transaction data type. amountItems=extract_am(analysisLogicInfo) accountRules=extract_ac(analysisLogicInfo) accRules={amountItems,accountRules,dateRules} accountBookCategory=categorize(transactionDataType,accRules,accountBookInfo) Among them, the extract_am() function is used to extract the number of account book amount items amountItems in the accounting detail analysis logic information analysisLogicInfo, the extract_ac() function is used to extract the account book classification rules accountRules in the accounting detail analysis logic information analysisLogicInfo, accRules is the account book category rule set, categorize() is the account book classification function, the main function of this function is to assign the classified transaction data type transactionDataType and account book accounting information accountBookInfo to the account book according to specific rules, and return the account book category information at the same time, accountBookCategory is the account book category; actorRules={dateRules,transactionDataType,accountBookCategory} acterInfo=accountAssign(acterRules,accountBookInfo) accountingRecord={transactionDataType,accountBookCategory,acterInfo,accountBookInfo} Among them, actorRules is the account classification rule set, accountAssign() is the account assignment function, which assigns specific ledgers and transactions to corresponding users according to the input account classification rule set actorRules and account book accounting information accountBookInfo, and returns the account information, actorInfo is the assigned account information; Among them, accountingRecord is the accounting detail record.

6. The method for correcting errors in an account book based on blockchain technology according to claim 1, characterized in that: The step S3 specifically includes: Step S301: Based on the account book accounting information in the current accounting details record, a hash operation is performed on it to obtain a hash value h x ; Step S302: According to the account book category information of the currently verified block, find the block of the same category in the blockchain, and perform a hash operation on the account book information in the account record of the block to obtain the hash value h y ; Step S303: h x With h y For comparison, if the two hash values ​​are the same, the accounting details record in the verified block is correct and the record is True. If the two hash values ​​are different, the accounting details record in the verified block is wrong and the record is False.

7. The method for correcting errors in an account book based on blockchain technology according to claim 6, characterized in that: The specific process of performing hash operation on the accounting detail record in step S301 is as follows: (1) Split and fill the account book information in the current account record to generate N 256-bit information blocks M (i) ; (2) Use the SHA-256 encryption algorithm to encrypt the information block M (i) Perform cyclic calculation to achieve encryption; (3)h x The value is calculated as follows: h (i) =sha_256(M (i) ) h x =h (1) ||h (2) ||h (3) …||h (i) Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h x The hash value generated for the account book information of the verified block, || is a concatenation operation.

8. The method for correcting errors in an account book based on blockchain technology according to claim 6, characterized in that: The specific steps of performing hash operation on the accounting information of the same type of blocks in step S302 are: (1) Extract account book category information accountBookCategory from the current accounting detail record to be verified; (2) Based on the extracted account book category information accountBookCategory, find the block b with the same account book category on the chain y ; (3) According to the discovered block b y , extract the account book information accountBookInfo_b of this block y ; (4) Record the account book information of this block as accountBookInfo_b y Use the SHA-256 algorithm to encrypt and get the corresponding hash value h y ,h y The value is calculated as follows: h (i) =sha_256(M (i) ) h y =h (1) ||h (2) ||h (3) …||h (i) Among them, h (i) is the hash value returned after hash encryption of the i-th information block, sha_256() is the SHA-256 function called, and h y The hash value generated for the ledger information of the same block of the identified category, || is a concatenation operation.

9. The method for correcting errors in an account book based on blockchain technology according to claim 1, characterized in that: The step S4 specifically includes: Step S401: Based on the output result of the ledger information, if the result record is True, the corresponding accounting details record is published to the blockchain; Step S402: If the result record is False, the accounting detail record is input into the preset deep error correction model for error correction processing, and the error correction result is obtained; Step S403: According to the correct accounting information obtained, the corresponding accounting details in the target account book are modified; Step S404: Publish the corrected target ledger to the blockchain and generate a corresponding ledger error report result.

10. The method for correcting errors in an account book based on blockchain technology according to claim 9, characterized in that: The specific process of inputting the accounting details into the preset deep error correction model for error correction processing in step S402 is as follows: (1) Extract the account book accounting information accountBookInfo from the accounting details record, pre-process the account book accounting information, and obtain the data set ac_datas; (2) Vectorize the data set ac_datas to obtain a vector representation of the training data: d i =data_embeding(y i )+row_embedding(y i )+site_embedding(y i ) Among them, d i represents the training data vector, y i represents the i-th character in the accounting information, data_embedding() is the data embedding vector obtaining function, row_embedding() is the row embedding vector obtaining function, and site_embedding() is the position embedding vector obtaining function; (3) For the training data vector d i Perform mask connection preprocessing to obtain embedded data, the embedded data d i 'The calculation formula is as follows: Among them, d i ' is the embedded data, ρ is the variance coefficient, * is the multiplication operator, P a is the bias term in the fully connected layer, Q a is the weight matrix in the fully connected layer, is the matrix inner product operation, is the encoding hidden vector, d mask is the embedded "mask" special data, d e is the vector with errors in the training vector; (4) The embedded data is encoded using the repair network of the error correction model to obtain the hidden state of the middle coding layer in the multiple coding layers, the hidden state and the embedded data are differentially connected to obtain the connection value, which is then input into the fully connected layer, and the posterior probability of the connection value is calculated using the activation function in the fully connected layer. The posterior probability is compared with the error correction tolerance. When the posterior probability is less than the error correction tolerance, the error correction result is judged to be wrong. When the posterior probability is greater than or equal to the error correction tolerance, the error correction result is judged to be correct. The posterior probability calculation formula is as follows: cv i '=hd i +d i ' P i (x i =k|X)=activate(cv i ')*100% Among them, cv i ' is the connection value, hd i is the hidden state, d i ' is the embedded data, P i (x i = k|X) is the character x i The posterior probability of being corrected to character k, X is the sample space of the text to be corrected, activate() is the activation function in the fully connected layer, and * is the multiplication operator; (5) Calculate the logarithmic loss value of the error correction model according to the error correction result, adjust the model parameters of the deep error correction model according to the logarithmic loss value, and output the standard error correction model. The logarithmic loss value calculation formula of the error correction model is as follows: Among them, L is the logarithmic loss value of the error correction model, p is the error correction rate, q is the preset detection rate, k is the preset fixed weight, and n is the total amount of data; (6) Inputting the bookkeeping information into the predetermined deep error correction model, and obtaining the correct bookkeeping information after error correction through a preset multi-round error correction mechanism.

Citation Information

Patent Citations

  • A method for enhancing the safety performance of a block chain

    CN109409879A

  • Account book establishment and query method based on block chain and electronic equipment

    CN110322352A

  • Evidence verification method and device based on block chain, equipment and storage medium

    CN110598478A

  • Accounting method and accounting system based on block chain

    CN111339567A

  • Text fixed-length error correction method and device, equipment and storage medium

    CN113887201A