CN113051622B - Index construction method, device, equipment and storage medium - Google Patents

Index construction method, device, equipment and storage medium Download PDF

Info

Publication number
CN113051622B
CN113051622B CN202110263782.8A CN202110263782A CN113051622B CN 113051622 B CN113051622 B CN 113051622B CN 202110263782 A CN202110263782 A CN 202110263782A CN 113051622 B CN113051622 B CN 113051622B
Authority
CN
China
Prior art keywords
account
account identifier
blockchain
index file
transaction data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110263782.8A
Other languages
Chinese (zh)
Other versions
CN113051622A (en
Inventor
匡立中
邱炜伟
李伟
张帅
曾磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202110263782.8A priority Critical patent/CN113051622B/en
Publication of CN113051622A publication Critical patent/CN113051622A/en
Application granted granted Critical
Publication of CN113051622B publication Critical patent/CN113051622B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3825Use of electronic signatures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Finance (AREA)
  • Strategic Management (AREA)
  • Software Systems (AREA)
  • General Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

An index construction method, an index construction device, index construction equipment and a storage medium are disclosed, and belong to the technical field of block chains. The method comprises the following steps: receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address; storing first transaction data corresponding to the account identifier binding request to a blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address; and constructing an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier. In the method, the index file constructed according to the transaction data stored in the blockchain is truly and credible because of the non-tamper property of the blockchain, so that the safety of the blockchain account during the subsequent operation through the index file is improved.

Description

Index construction method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for constructing an index.
Background
The blockchain system is provided with a blockchain account. The account data for the blockchain account includes account addresses, balances, and the like. User manipulation of blockchain accounts in blockchain systems is required through account addresses of the blockchain accounts, which often contain many characters. For example, if tokens in the balance of one blockchain account need to be transferred to the balance of another blockchain account, the tokens can be realized only by inputting a long account address by both users, and the usability is poor.
For this reason, a database is currently provided outside the blockchain system to store the association relationship between the shorter identifier and the account address, so that the user can use the shorter identifier to implement the operation on the blockchain account. Specifically, the user sends an account operation request carrying a shorter identifier to the blockchain system, and after the blockchain system receives the account operation request, the blockchain system firstly acquires an account address associated with the shorter identifier from an external database, and then operates a blockchain account corresponding to the account address. However, since the external database does not have the non-tamper-resistance of the blockchain system, the security of the account operation is difficult to be ensured.
Disclosure of Invention
The application provides an index construction method, an index construction device, index construction equipment and a storage medium, which can improve the safety when a blockchain account is operated. The technical scheme is as follows:
in a first aspect, an index building method is provided, applied to a blockchain system, the method including:
receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address;
storing first transaction data corresponding to the account identifier binding request to a blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address;
and constructing an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier.
In the method, the index file constructed according to the transaction data stored by the blockchain and related to the account identifier is truly and credible because of the non-tamper-resistance of the blockchain, so that the safety of the blockchain account during the subsequent operation through the index file can be improved.
Optionally, the first transaction data and the index file of the account identifier each include a version number, and before storing the first transaction data corresponding to the account identifier binding request to the blockchain, the method further includes:
if the index file of the account identifier does not exist, setting the version number in the first transaction data as an initial version number;
if the index file of the account identifier exists, setting the version number in the first transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier.
Optionally, the constructing an index file of the account identifier according to the transaction data stored in the blockchain and related to the account identifier includes:
acquiring transaction data with the highest version number from transaction data stored in the blockchain and related to the account identifier as target transaction data;
and constructing an index file of the account identifier according to the target transaction data.
Optionally, the data structure of the index file of the account identifier is a dictionary tree or a b+ tree.
Optionally, the method further comprises:
receiving an account identifier unbinding request, wherein the account identifier unbinding request carries the account identifier and the account address;
Storing second transaction data corresponding to the account identification unbinding request to the blockchain, wherein the second transaction data comprises the account identification;
reconstructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
Optionally, after constructing the index file of the account identifier according to the transaction data stored in the blockchain and related to the account identifier, the method further includes:
acquiring a hash value of the index file of the account identifier as a first hash value;
storing the index file of the account identification to other devices, and storing the first hash value to the blockchain or smart contract;
if the blockchain system is restarted, acquiring an index file of the account identifier from the other equipment as a target index file;
acquiring a hash value of the target index file as a second hash value;
if the second hash value is the same as the stored first hash value, determining the target index file as the index file of the account identifier;
and if the second hash value is different from the stored first hash value, reconstructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
Optionally, after constructing the index file of the account identifier according to the transaction data stored in the blockchain and related to the account identifier, the method further includes:
receiving an account operation request, wherein the account operation request carries the account identifier;
determining an account address associated with the account identifier according to the index file of the account identifier;
and operating the blockchain account corresponding to the account address associated with the account identifier.
In a second aspect, there is provided an index building apparatus for use in a blockchain system, the apparatus comprising:
the receiving module is used for receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address;
the first storage module is used for storing first transaction data corresponding to the account identifier binding request to a blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address;
the construction module is used for constructing an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier.
Optionally, the first transaction data and the index file of the account identifier each include a version number, and the apparatus further includes:
the first setting module is used for setting the version number in the first transaction data as an initial version number under the condition that the index file of the account identifier does not exist;
and the second setting module is used for setting the version number in the first transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier under the condition that the index file of the account identifier exists.
Optionally, the construction module is configured to:
acquiring transaction data with the highest version number from transaction data stored in the blockchain and related to the account identifier as target transaction data;
and constructing an index file of the account identifier according to the target transaction data.
Optionally, the data structure of the index file of the account identifier is a dictionary tree or a b+ tree.
Optionally, the receiving module is further configured to receive an account identifier unbinding request, where the account identifier unbinding request carries the account identifier and the account address;
the first storage module is further configured to store second transaction data corresponding to the account identifier unbinding request to the blockchain, where the second transaction data includes the account identifier;
The construction module is further configured to reconstruct an index file of the account identifier according to transaction data related to the account identifier, which is stored in the blockchain.
Optionally, the apparatus further comprises:
the first acquisition module is used for acquiring a hash value of the index file of the account identifier as a first hash value;
a second storage module for storing the index file of the account identifier to other devices and storing the first hash value to the blockchain or smart contract;
the second obtaining module is used for obtaining the index file of the account identifier from the other equipment as a target index file under the condition that the blockchain system is restarted;
a third obtaining module, configured to obtain a hash value of the target index file as a second hash value;
a first determining module, configured to determine, when the second hash value is the same as the stored first hash value, the target index file as an index file of the account identifier;
the construction module is further configured to reconstruct an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier when the second hash value is different from the stored first hash value.
Optionally, the apparatus further comprises:
the receiving module is further configured to receive an account operation request, where the account operation request carries the account identifier;
the second determining module is used for determining an account address associated with the account identifier according to the index file of the account identifier;
and the account operation module is used for operating the blockchain account corresponding to the account address associated with the account identifier.
In a third aspect, a computer device is provided, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program implementing the index building method described above when executed by the processor.
In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, which when executed by a processor, implements the index building method described above.
In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the steps of the index building method described above.
It will be appreciated that the advantages of the second, third, fourth and fifth aspects may be found in the relevant description of the first aspect, and are not repeated here.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block chain system architecture diagram according to one embodiment of the present application;
FIG. 2 is a schematic diagram of a blockchain provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of an index building system according to an embodiment of the present application;
FIG. 4 is a flowchart of an index building method according to an embodiment of the present application;
FIG. 5 is a flowchart of another index building method provided by an embodiment of the present application;
FIG. 6 is a schematic structural diagram of an index building device according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that reference herein to "a plurality" means two or more. In addition, for the purpose of facilitating the clear description of the technical solutions of the present application, the words "first", "second", etc. are used to distinguish between the same item or similar items having substantially the same function and effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Prior to explaining the embodiments of the present application, the relevant contents of the blockchain are explained.
Fig. 1 is a schematic structural diagram of a blockchain system according to an embodiment of the present application.
Referring to fig. 1, a blockchain system 100 refers to a system for data sharing from node to node, and a plurality of nodes 101 may be included in the blockchain system 100, and the plurality of nodes 101 may refer to respective clients in the blockchain system 100. Each node 101 may receive input information while operating normally and maintain shared data within the blockchain system 100 based on the received input information. To ensure interworking of information within the blockchain system 100, there may be an information connection between each node 101 in the blockchain system 100 through which information may be transferred between the nodes 101. For example, when any node 101 in the blockchain system 100 receives input information, other nodes 101 in the blockchain system 100 acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all nodes 101 in the blockchain system 100 are consistent.
Each node 101 in the blockchain system 100 stores one and the same blockchain. Referring to fig. 2, the blockchain is composed of a plurality of blocks, the starting block includes a block header and a block body, the block header stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block body stores input information; the next block of the starting block takes the starting block as a father block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the father block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
Blockchain system 100 has distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and other computer technologies. The blockchain system 100 is a distributed shared ledger and database, and has the characteristics of decentralization, non-tampering, whole-course trace, traceability, collective maintenance, disclosure transparency and the like. These features ensure the shared openness, realism, integrity and safety and reliability of the blockchain.
The system architecture to which the embodiments of the present application relate is described below.
Fig. 3 is a schematic diagram of an index building system according to an embodiment of the present application. Referring to fig. 3, the index building system includes: a terminal 301 and a blockchain system 302.
The terminal 301 and the blockchain system 302 may communicate over a wired network or a wireless network.
The terminal 301 may be a desktop computer, a portable computer, a palm top computer, a mobile phone, a tablet computer, etc., and the embodiments of the present application are not limited to the type of the terminal 301. The blockchain system 302 may be the blockchain system 100 described in the embodiments of fig. 1-2 above.
The terminal 301 may request registration of a blockchain account in the blockchain system 302, and account data for the blockchain account may include an account address, a balance, a state variable, etc., the balance of the blockchain account representing a number of tokens (token) owned by the blockchain account. Terminal 301 may also request blockchain system 302 to bind or unbind account identifications with account addresses of blockchain accounts, the number of characters of the account identifications being less than the number of characters of the account addresses. When the blockchain system 302 binds an account identification with an account address of a blockchain account, an index file of the account identification may be constructed, where the index file of the account identification is used to indicate the account address associated with the account identification.
After binding a certain account identifier with a certain account address, the terminal 301 may operate on the blockchain account corresponding to the account address through the account identifier. Because the number of characters of the account identifier is smaller than that of the account address, the operation of a user is convenient, and the usability is good.
The index construction method provided in the embodiment of the present application is explained in detail below.
First, describing the registration process of the blockchain account, the method can include the following steps (1) -step (4):
(1) The terminal generates a public-private key pair comprising a public key and a private key.
One public key of the public-private key pair corresponds to one private key, i.e., data encrypted with this public key can be decrypted using this private key and data encrypted with this private key can be decrypted using this public key.
Specifically, the terminal may generate a private key according to the private key generation rule, and then generate a public key corresponding to the private key according to the private key and the public key generation rule; the private key and the public key are used as a public-private key pair.
The private key generation rule may be set in advance. For example, the private key generation rule may be a random number generation algorithm that may be employed to generate a random number as the private key. Of course, the private key generation rule may be other rules, which are not limited in this embodiment of the present application.
The public key generation rule may be set in advance. The public key generation rule may be an elliptic curve public key cryptography algorithm (including but not limited to SM2 elliptic curve algorithm, secp256k1 elliptic curve algorithm, etc.), which may be used to generate a public key from a private key. Of course, the public key generation rule may be other rules, which are not limited in this embodiment of the present application.
(2) And the terminal generates an account address according to the public key in the public-private key pair.
In particular, the terminal may encode the public key to obtain the account address. Of course, the terminal may generate the account address according to the public key in other manners, which is not limited in the embodiment of the present application.
(3) The terminal sends an account registration request to the blockchain system, the account registration request carrying the account address and the public key.
The account registration request is for requesting registration of a blockchain account in a blockchain system.
(4) And after receiving an account registration request sent by the terminal, the blockchain system generates a blockchain account according to an account address and a public key carried by the account registration request.
After receiving an account registration request sent by a terminal, the blockchain system can verify an account address and a public key carried by the account registration request, and after the account address and the public key pass the verification, a blockchain account is generated according to the account address and the public key.
The account data for the blockchain account may include account addresses, balances, state variables, and the like. The account address in the account data of the blockchain account is the account address carried by the account registration request, and the state variable in the account data of the blockchain account comprises a public key carried by the account registration request and is used for indicating that the public key has account operation authority, wherein the account operation authority is used for realizing the operation related to the blockchain account.
After the blockchain system generates the blockchain account, if the terminal needs to operate the blockchain account, the terminal can directly request the blockchain system to perform corresponding operation on the blockchain account through the account address of the blockchain account. However, account addresses are generally relatively large in number of characters and are relatively poor in usability. Therefore, in the embodiment of the application, the terminal can generate the account identifier with fewer characters, and then the operation on the blockchain account is realized through the account identifier, so that the usability is improved. The following describes the relevant content of account identification.
Fig. 4 is a flowchart of an index construction method according to an embodiment of the present application. Referring to fig. 4, the method includes the following steps.
Step 401: the terminal generates an account identifier.
The account identification is used to identify blockchain accounts and may be composed of at least one of letters and numbers. The account identifier has fewer characters, and the number of characters of the account identifier is smaller than the number of characters of the account address. Thus, the account identification is more readily available than the account address. For example, a typical account address is 64 characters, and the account identification may not exceed 8 characters.
The account identifier may be generated by the terminal while the account address is generated, or may be generated by the terminal under other conditions.
Step 402: and the terminal sends an account identification binding request.
The account identifier binding request carries the account identifier and an account address, the character number of the account identifier is smaller than that of the account address, and the account address is the account address of the blockchain account registered in the blockchain system by the terminal.
The account identifier binding request may also carry a digital signature, where the digital signature is obtained by encrypting the information abstract using a private key in a public-private key pair corresponding to the account address. The information digest is obtained by performing a hash operation on the account identifier and the account address. The public-private key pair corresponding to the account address is the public-private key pair where the public key used for generating the account address is located.
The account identifier binding request is for requesting binding of the account identifier with the account address. After the account identifier is bound with the account address, the terminal can operate the blockchain account corresponding to the account address through the account identifier.
Step 403: and after receiving the account identifier binding request sent by the terminal, the blockchain system stores first transaction data corresponding to the account identifier binding request into the blockchain.
After receiving the account identifier binding request sent by the terminal, the blockchain system can verify the digital signature in the account identifier binding request, verify the account identifier in the account identifier binding request after the digital signature passes the verification, and store the first transaction data corresponding to the account identifier binding request to the blockchain after the account identifier passes the verification.
When verifying the digital signature in the account identification binding request, the blockchain system can acquire the public key of the blockchain account corresponding to the account address in the account identification binding request; decrypting the digital signature by using the public key to obtain a first information abstract, and carrying out hash operation on the account identifier and the account address in the account identifier binding request to obtain a second information abstract; if the first information abstract is the same as the second information abstract, the digital signature verification is determined to pass, and if the first information abstract is different from the second information abstract, the digital signature verification is determined to fail.
When the blockchain system checks the account identifier in the account identifier binding request, repeatability, legality and the like can be checked on the account identifier, which is not limited in the embodiment of the present application.
The first transaction data corresponding to the account identification binding request is transaction data related to the account identification binding request. For example, the first transaction data may include an association between the account identifier and the account address, and may further include a version number, account related information, and the like. The version number is used to indicate the number of times the account identification is bound and unbound to the account address. The account related information is some information about the blockchain account corresponding to the account address.
The blockchain system can determine the association relationship between the account identifier and the account address according to the account identifier binding request, can set a version number, and can acquire account related information according to the account address. The blockchain system may then store the association between the account identifier and the account address, the version number, the account related information as first transaction data to the blockchain. After the first transaction data is stored to the blockchain, the first transaction data will not be tampered with.
Step 404: the blockchain system constructs an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier.
The transaction data stored by the blockchain and related to the account identifier can reflect the binding and unbinding condition of the account identifier and the account address, so that the blockchain system can determine the account address currently associated with the account identifier according to the transaction data stored by the blockchain and related to the account identifier, and construct an index file according to the account address. Because the blockchain is not tamper-resistant, the index file constructed according to the transaction data stored by the blockchain and related to the account identifier is truly and credible, so that the security of the blockchain account during the subsequent operation realized through the index file can be improved.
The data structure of the index file of the account identification may be a tree structure, such as a dictionary tree or a b+ tree. Alternatively, the dictionary tree may be selected in a scene with a higher configuration or a higher processing speed. In the scene of lower configuration or lower processing speed requirement, the B+ tree can be selected.
And under the condition that the account identifier is bound with the account address, indexing the account identifier in an index file of the account identifier, and obtaining the account address associated with the account identifier.
Specifically, the blockchain system may obtain transaction data with the highest version number from transaction data related to the account identifier stored in the blockchain as target transaction data, and then construct an index file of the account identifier according to the target transaction data. In this case, the blockchain system only needs to consider the target transaction data with the highest version number when constructing the index file identified by the account, so that the efficiency of constructing the index file can be improved.
Because the version number is used for indicating the binding and unbinding times of the account identifier and the account address, the target transaction data with the highest version number in the transaction data related to the account identifier stored in the blockchain can reflect the latest binding and unbinding conditions of the account identifier and the account address, and therefore the index file of the account identifier can be directly constructed according to the target transaction data.
In the case where the account identifier is bound to an account address, the target transaction data may include the account identifier, account address, version number, account related information, and the like. In this case, the index file of the account identifier may include the account identifier, account address, version number, account related information, and the like in the target transaction data. And indexing the account identifier in an index file of the account identifier to obtain an account address, a version number, account related information and the like.
The process of binding an account identification with an account address is described above. The process of unbinding an account identification from an account address is described below. Specifically, the method may include the following steps (1) -step (3):
(1) And the terminal sends an account identifier unbinding request, wherein the account identifier unbinding request carries the account identifier and the account address.
The account identifier unbinding request can also carry a digital signature, and the digital signature is obtained by encrypting the information abstract by using a private key in a public-private key pair corresponding to the account address. The information digest is obtained by performing a hash operation on the account identifier and the account address. The public-private key pair corresponding to the account address is the public-private key pair where the public key used for generating the account address is located.
The account identification unbinding request is used for requesting unbinding the account identification and the account address. After the account identifier is unbinding with the account address, the terminal can not operate the blockchain account corresponding to the account address through the account identifier.
(2) And after receiving the account identifier unbinding request sent by the terminal, the blockchain system stores second transaction data corresponding to the account identifier unbinding request into the blockchain.
After receiving the account identifier unbinding request sent by the terminal, the blockchain system can verify the digital signature in the account identifier unbinding request, and after the digital signature passes the verification, the second transaction data corresponding to the account identifier unbinding request is stored in the blockchain.
When verifying the digital signature in the account identification unbinding request, the blockchain system can acquire the public key of the blockchain account corresponding to the account address in the account identification unbinding request; decrypting the digital signature by using the public key to obtain a third information abstract, and carrying out hash operation on the account identifier and the account address in the account identifier unbinding request to obtain a fourth information abstract; if the third information abstract is the same as the fourth information abstract, the digital signature verification is determined to pass, and if the third information abstract is different from the fourth information abstract, the digital signature verification is determined to fail.
The second transaction data corresponding to the account identification unbinding request is transaction data related to the account identification unbinding request. For example, the second transaction data may include the account identification, a version number, and the like. The blockchain system may determine the account identification from the account identification binding request and may set a version number. The blockchain system may then store the account identification, the version number as second transaction data to the blockchain. After the second transaction data is stored to the blockchain, the second transaction data will not be tampered with.
(3) The blockchain system reconstructs an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
It should be noted that, in the case that the account identifier is bound to the account address, the index file of the account identifier may indicate the account address associated with the account identifier, and at this time, the account identifier is used for indexing in the index file of the account identifier, so that the currently associated account address of the account identifier may be obtained. And under the condition that the account identifier is unbinding with the account address, the index file of the account identifier can indicate that the account address associated with the account identifier is empty, namely the account identifier is not associated with the account address currently, and at the moment, the account identifier is used for indexing in the index file of the account identifier, so that the account address associated with the account identifier cannot be obtained.
Specifically, the blockchain system may obtain transaction data with the highest version number from transaction data related to the account identifier stored in the blockchain as target transaction data, and then construct an index file of the account identifier according to the target transaction data. In the case where the account identifier is unbundled with the account address, the account identifier, version number may be included in the target transaction data. In this case, the index file of the account identifier may include the account identifier and version number in the target transaction data. And indexing the account identifier in an index file of the account identifier to obtain a version number.
After the account identifier and the account address are unbinding, the terminal can also bind the account identifier and other account addresses, and the binding process is similar to the binding process of the account identifier and the account address, which is not repeated in the embodiment of the present application.
It should be noted that, when the blockchain system receives the account identifier binding request or the account identifier unbinding request, after storing the related transaction data (such as the first transaction data or the second transaction data) into the blockchain, the blockchain system needs to construct an index file of the account identifier according to the transaction data stored in the blockchain and related to the account identifier.
And each time the blockchain system receives an account identification binding request or an account identification unbinding request, the version number in the transaction data needs to be set before the related transaction data (such as the first transaction data or the second transaction data) is stored in the blockchain. For example, the blockchain system in step 403 described above needs to set the version number in the first transaction data before storing the first transaction data in the blockchain. The blockchain system in step (2) of step 404 above needs to set the version number in the second transaction data before storing the second transaction data in the blockchain.
Optionally, the blockchain system may set the version number in the transaction data to the initial version number in the absence of the index file of the account identifier; and setting the version number in the transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier under the condition that the index file of the account identifier exists.
Before the blockchain system stores the transaction data in the blockchain, if the index file of the account identifier does not exist, the account identifier is bound with the account address for the first time, so that the version number in the transaction data can be set as the initial version number. The initial version number may be a predetermined value, such as 1.
Before storing the transaction data in the blockchain, if an index file of the account identifier exists, the blockchain system indicates that the account identifier is bound or unbound with the account address before, so that a new version number can be obtained by adding 1 to a version number in the index file of the account identifier and added to the transaction data.
After the blockchain system builds the index file of the account identifier, the index file of the account identifier can be stored in a memory, and the index file of the account identifier can be stored in other devices, such as an external memory such as a hard disk, so that when the blockchain system is restarted due to system breakdown and the like, the index file of the account identifier can be quickly rebuilt according to the index file stored in the external memory.
Specifically, after the blockchain system builds the index file of the account identifier, a hash value of the index file of the account identifier can be obtained as a first hash value; the index file of the account identification is stored to the other device, and the first hash value is stored to the blockchain or the smart contract. Then, if the blockchain system is restarted, the index file of the account identifier is obtained from the other equipment and is used as a target index file; acquiring a hash value of the target index file as a second hash value; if the second hash value is the same as the stored first hash value, determining the target index file as the index file of the account identifier; if the second hash value is different from the stored first hash value, reconstructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
The blockchain system may also store a timestamp of the first hash value to the blockchain or the smart contract when storing the first hash value to the blockchain or the smart contract. The timestamp of the first hash value is used to indicate the time of generation of the first hash value. For the account identifier, the blockchain system continuously reconstructs an index file of the account identifier in the process of binding or unbinding the account identifier and the account address. The blockchain system may store the hash value of the index file of the account identifier to the blockchain or the smart contract after reconstructing the index file of the account identifier each time, and thus the blockchain or the smart contract may store a plurality of first hash values. In this case, upon a restart of the blockchain system, the blockchain system may obtain the first hash value of the latest timestamp from the blockchain or the smart contract as the first hash value that needs to be compared with the second hash value.
If the second hash value is the same as the stored first hash value, which indicates that the target index file stored by the other device is not tampered, the blockchain system can directly determine the target index file as the index file of the account identifier, so that the creation efficiency of the index file can be improved. If the second hash value is different from the stored first hash value, which indicates that the target index file stored by the other device has been tampered, the blockchain system can reconstruct the index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier, so as to ensure the authenticity and credibility of the constructed index file.
Notably, under the condition that the account identifier and the account address are bound, the terminal can realize the operation of the blockchain account corresponding to the account address through the account identifier, and the specific process is as follows:
step 405: and the terminal sends an account operation request to the blockchain system, wherein the account operation request carries the account identifier.
The account operation request is used for requesting to operate the blockchain account corresponding to the account address associated with the account identifier.
The account operation request may also carry a digital signature, where the digital signature is obtained by encrypting the information abstract using a private key in a public-private key pair corresponding to the account address associated with the account identifier. The information digest is obtained by performing a hash operation on the account identifier.
Step 406: after receiving an account operation request sent by a terminal, the blockchain system determines an account address associated with the account identifier according to an index file of the account identifier carried by the account operation request, and operates a blockchain account corresponding to the account address associated with the account identifier.
After the blockchain system receives an account operation request sent by the terminal, an index file of the account identifier can be quickly found according to the account identifier carried by the account operation request, then the associated account address can be efficiently and safely determined according to the index file of the account identifier, and then the blockchain account is operated according to the index file.
After determining the account address associated with the account identifier, the blockchain system can verify the digital signature in the account operation request, and after the digital signature passes the verification, the blockchain account corresponding to the account address associated with the account identifier is operated.
When the blockchain system verifies the digital signature in the account operation request, the public key of the blockchain account corresponding to the account address associated with the account identifier can be obtained; decrypting the digital signature by using the public key to obtain a fifth information abstract, and carrying out hash operation on the account identifier in the account operation request to obtain a sixth information abstract; if the fifth information abstract is the same as the sixth information abstract, the digital signature verification is determined to pass, and if the fifth information abstract is different from the sixth information abstract, the digital signature verification is determined to fail.
Notably, the blockchain system includes a plurality of blockchain nodes that share the blockchain, i.e., each of the plurality of blockchain nodes is configured with the same blockchain. In this case, for each of the plurality of blockchain nodes, an index file may be constructed according to the blockchain of the blockchain node, and then an operation on the related blockchain account may be implemented according to the constructed index file. That is, for any one of the blockchain nodes, the blockchain node may construct an index file of the account identifier according to transaction data related to a certain account identifier stored in a blockchain configured by the blockchain node, and when an account operation request carrying the account identifier is subsequently received, the blockchain node may acquire an associated account address according to the index file of the account identifier, and then operate a blockchain account corresponding to the account address.
In the embodiment of the application, the blockchain system receives an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address. The blockchain system stores first transaction data corresponding to the account identifier binding request to the blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address. And then, the blockchain system constructs an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier. Because the blockchain is not tamper-resistant, the index file constructed according to the transaction data stored by the blockchain and related to the account identifier is truly and credible, so that the security of the blockchain account during the subsequent operation realized through the index file can be improved.
Fig. 5 is a flowchart of an index construction method according to an embodiment of the present application. The method is applied to a blockchain system, either the blockchain system 100 described in the embodiment of fig. 1-2 above or the blockchain system 302 described in the embodiment of fig. 3 above. Referring to fig. 5, the method includes the following steps.
Step 501: and receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address.
The relevant contents of step 501 have been explained in the above steps 401 and 402, and this will not be repeated in the embodiments of the present application.
Step 502: storing first transaction data corresponding to the account identifier binding request to a blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address.
The related content of step 502 has been explained in step 403, and this will not be repeated in the embodiments of the present application.
Step 503: and constructing an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier.
The related content of step 503 is already explained in step 404, and this will not be repeated in the embodiment of the present application.
In the embodiment of the application, the blockchain system receives an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address. The blockchain system stores first transaction data corresponding to the account identifier binding request to the blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address. And then, the blockchain system constructs an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier. Because the blockchain is not tamper-resistant, the index file constructed according to the transaction data stored by the blockchain and related to the account identifier is truly and credible, so that the security of the blockchain account during the subsequent operation realized through the index file can be improved.
Fig. 6 is a schematic diagram of an index building device according to an embodiment of the present application, where the device is applied to a blockchain system, such as the blockchain system 100 described in the embodiment of fig. 1-2, or the blockchain system 302 described in the embodiment of fig. 3. Referring to fig. 6, the apparatus includes: a receiving module 601, a first storage module 602, and a constructing module 603.
The receiving module 601 is configured to receive an account identifier binding request, where the account identifier binding request carries an account identifier and an account address, and the number of characters of the account identifier is smaller than that of the account address;
the first storage module 602 is configured to store first transaction data corresponding to the account identifier binding request to the blockchain, where the first transaction data includes an association relationship between an account identifier and an account address;
the construction module 603 is configured to construct an index file of the account identifier according to transaction data related to the account identifier stored in the blockchain, where the index file of the account identifier is used to indicate an account address associated with the account identifier.
Optionally, the first transaction data and the index file of the account identifier each include a version number, and the apparatus further includes:
the first setting module is used for setting the version number in the first transaction data as an initial version number under the condition that the index file of the account identifier does not exist;
and the second setting module is used for setting the version number in the first transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier under the condition that the index file of the account identifier exists.
Optionally, the building module 603 is configured to:
Acquiring transaction data with the highest version number from transaction data related to account identification stored in a blockchain as target transaction data;
and constructing an index file of the account identifier according to the target transaction data.
Optionally, the data structure of the index file of the account identifier is a dictionary tree or a b+ tree.
Optionally, the receiving module 601 is further configured to receive an account identifier unbinding request, where the account identifier unbinding request carries an account identifier and an account address;
the first storage module 602 is further configured to store second transaction data corresponding to the account identifier unbinding request to the blockchain, where the second transaction data includes an account identifier;
the construction module 603 is further configured to reconstruct an index file of the account identifier according to transaction data related to the account identifier stored in the blockchain.
Optionally, the apparatus further comprises:
the first acquisition module is used for acquiring a hash value of an index file of the account identifier as a first hash value;
the second storage module is used for storing the index file of the account identifier to other devices and storing the first hash value to the blockchain or the intelligent contract;
the second acquisition module is used for acquiring an index file of the account identifier from other equipment as a target index file under the condition that the blockchain system is restarted;
The third acquisition module is used for acquiring the hash value of the target index file as a second hash value;
the first determining module is used for determining the target index file as the index file of the account identifier under the condition that the second hash value is the same as the stored first hash value;
the construction module 603 is further configured to reconstruct an index file of the account identifier according to transaction data related to the account identifier stored in the blockchain when the second hash value is different from the stored first hash value.
Optionally, the apparatus further comprises:
the receiving module 601 is further configured to receive an account operation request, where the account operation request carries an account identifier;
the second determining module is used for determining account addresses associated with account identifications according to the index files of the account identifications;
and the account operation module is used for operating the blockchain account corresponding to the account address associated with the account identifier.
In the embodiment of the application, the blockchain system receives an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address. The blockchain system stores first transaction data corresponding to the account identifier binding request to the blockchain, wherein the first transaction data comprises an association relationship between the account identifier and the account address. And then, the blockchain system constructs an index file of the account identifier according to transaction data stored in the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier. Because the blockchain is not tamper-resistant, the index file constructed according to the transaction data stored by the blockchain and related to the account identifier is truly and credible, so that the security of the blockchain account during the subsequent operation realized through the index file can be improved.
It should be noted that: in the index construction device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to perform all or part of the functions described above.
The functional units and modules in the above embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiments of the present application.
The index construction device and the index construction method provided in the foregoing embodiments belong to the same concept, and specific working processes and technical effects brought by units and modules in the foregoing embodiments may be referred to a method embodiment part, which is not repeated herein.
Fig. 7 is a schematic structural diagram of a computer device according to an embodiment of the present application. The blockchain system 100 described in the embodiment of fig. 1-2 above, or the blockchain system 302 described in the embodiment of fig. 3 above, may be implemented by the computer device 7. As shown in fig. 7, the computer device 7 includes: a processor 70, a memory 71 and a computer program 72 stored in the memory 71 and executable on the processor 70, the processor 70 implementing the steps in the index building method in the embodiment of fig. 5 above when executing the computer program 72.
The computer device 7 may be a general purpose computer device or a special purpose computer device. In a specific implementation, the computer device 7 may be a server cluster consisting of a plurality of servers. It will be appreciated by those skilled in the art that fig. 7 is merely an example of the computer device 7 and is not limiting of the computer device 7, and may include more or fewer components than shown, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 70 may be a central processing unit (Central Processing Unit, CPU) and the processor 70 may be other general purpose processors, digital signal processors (Digital Signal Processor, DSPs), application specific integrated circuits (Application Specific Integrated Circuit, ASICs), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or may be any conventional processor.
The memory 71 may in some embodiments be an internal storage unit of the computer device 7, such as a hard disk or a memory of the computer device 7. The memory 71 may in other embodiments also be an external storage device of the computer device 7, such as a plug-in hard disk provided on the computer device 7, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Further, the memory 71 may also include both an internal storage unit and an external storage device of the computer device 7. The memory 71 is used to store an operating system, application programs, boot loader (BootLoader), data, and other programs and the like, such as program codes of computer programs and the like. The memory 71 may also be used to temporarily store data that has been output or is to be output.
The embodiment of the application also provides a computer device, which comprises: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, which when executed by the processor performs the steps of any of the various method embodiments described above.
The present application also provides a computer readable storage medium storing a computer program which, when executed by a processor, implements the steps of the respective method embodiments described above.
The present embodiments provide a computer program product which, when run on a computer, causes the computer to perform the steps of the various method embodiments described above.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. With such understanding, the present application implements all or part of the flow of the above-described method embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, may implement the steps of the above-described method embodiments. Wherein the computer program comprises computer program code which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal device, recording medium, computer Memory, ROM (Read-Only Memory), RAM (Random Access Memory ), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, and so forth. The computer readable storage medium mentioned in the present application may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps to implement the above-described embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in this application, it should be understood that the disclosed apparatus/computer device and method may be implemented in other ways. For example, the apparatus/computer device embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (8)

1. An index building method, for use in a blockchain system, the method comprising:
receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address;
If the index file of the account identifier does not exist, setting a version number in first transaction data corresponding to the account identifier binding request as an initial version number, wherein the first transaction data comprises an association relationship between the account identifier and the account address;
if the index file of the account identifier exists, setting the version number in the first transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier;
storing first transaction data corresponding to the account identification binding request to a blockchain;
constructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier;
the constructing an index file of the account identifier according to the transaction data stored in the blockchain and related to the account identifier includes:
acquiring transaction data with the highest version number from transaction data stored in the blockchain and related to the account identifier as target transaction data;
and constructing an index file of the account identifier according to the target transaction data.
2. The method of claim 1, wherein the data structure of the index file of account identifications is a dictionary tree or a b+ tree.
3. The method of claim 1, wherein the method further comprises:
receiving an account identifier unbinding request, wherein the account identifier unbinding request carries the account identifier and the account address;
storing second transaction data corresponding to the account identification unbinding request to the blockchain, wherein the second transaction data comprises the account identification;
reconstructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
4. The method of claim 1, wherein the constructing the index file of the account identifier from transaction data stored by the blockchain and associated with the account identifier further comprises:
acquiring a hash value of the index file of the account identifier as a first hash value;
storing the index file of the account identification to other devices, and storing the first hash value to the blockchain or smart contract;
if the blockchain system is restarted, acquiring an index file of the account identifier from the other equipment as a target index file;
Acquiring a hash value of the target index file as a second hash value;
if the second hash value is the same as the stored first hash value, determining the target index file as the index file of the account identifier;
and if the second hash value is different from the stored first hash value, reconstructing an index file of the account identifier according to transaction data stored by the blockchain and related to the account identifier.
5. The method of any of claims 1-4, wherein the constructing an index file for the account identifier based on transaction data stored by the blockchain and associated with the account identifier further comprises:
receiving an account operation request, wherein the account operation request carries the account identifier;
determining an account address associated with the account identifier according to the index file of the account identifier;
and operating the blockchain account corresponding to the account address associated with the account identifier.
6. An index building apparatus for use in a blockchain system, the apparatus comprising:
the receiving module is used for receiving an account identifier binding request, wherein the account identifier binding request carries an account identifier and an account address, and the character number of the account identifier is smaller than that of the account address;
The first storage module is used for setting a version number in first transaction data corresponding to the account identifier binding request as an initial version number if the index file of the account identifier does not exist, wherein the first transaction data comprises an association relationship between the account identifier and the account address; if the index file of the account identifier exists, setting the version number in the first transaction data as the version number obtained by adding 1 to the version number in the index file of the account identifier; storing first transaction data corresponding to the account identification binding request to a blockchain;
the construction module is used for acquiring transaction data with the highest version number from transaction data which are stored in the blockchain and are related to the account identifier as target transaction data; and constructing an index file of the account identifier according to the target transaction data, wherein the index file of the account identifier is used for indicating an account address associated with the account identifier.
7. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, which computer program, when executed by the processor, implements the method according to any of claims 1 to 5.
8. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 5.
CN202110263782.8A 2021-03-11 2021-03-11 Index construction method, device, equipment and storage medium Active CN113051622B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110263782.8A CN113051622B (en) 2021-03-11 2021-03-11 Index construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110263782.8A CN113051622B (en) 2021-03-11 2021-03-11 Index construction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113051622A CN113051622A (en) 2021-06-29
CN113051622B true CN113051622B (en) 2023-05-12

Family

ID=76511356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110263782.8A Active CN113051622B (en) 2021-03-11 2021-03-11 Index construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113051622B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113821536B (en) * 2021-11-23 2022-03-18 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812402A (en) * 2014-12-29 2016-07-27 腾讯科技(深圳)有限公司 File transmission method and device based on Internet of things
CN107786425A (en) * 2016-09-12 2018-03-09 平安科技(深圳)有限公司 Information off-line treating method and apparatus
CN111708825A (en) * 2020-06-11 2020-09-25 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN112269839A (en) * 2020-11-18 2021-01-26 网易(杭州)网络有限公司 Data storage method and device in block chain, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10963881B2 (en) * 2015-05-21 2021-03-30 Mastercard International Incorporated Method and system for fraud control of blockchain-based transactions
CN111414560B (en) * 2019-01-04 2024-05-24 腾讯科技(深圳)有限公司 Shared information processing method and device, related equipment and storage medium
CN110070445B (en) * 2019-04-28 2024-03-01 深圳前海微众银行股份有限公司 Transaction processing method and device based on blockchain system
CN110544101A (en) * 2019-09-10 2019-12-06 苏州阿尔山数字科技有限公司 SM 9-based alliance chain identity authentication method
CN111461719A (en) * 2020-04-13 2020-07-28 江苏恒为信息科技有限公司 Block chain account identity identification method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105812402A (en) * 2014-12-29 2016-07-27 腾讯科技(深圳)有限公司 File transmission method and device based on Internet of things
CN107786425A (en) * 2016-09-12 2018-03-09 平安科技(深圳)有限公司 Information off-line treating method and apparatus
CN111708825A (en) * 2020-06-11 2020-09-25 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN112269839A (en) * 2020-11-18 2021-01-26 网易(杭州)网络有限公司 Data storage method and device in block chain, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113051622A (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN112446785B (en) Cross-chain transaction method, system, device, equipment and storage medium
JP7372434B2 (en) Script-based blockchain interaction
US10747721B2 (en) File management/search system and file management/search method based on block chain
CN109040341B (en) Intelligent contract address generation method and device, computer equipment and readable storage medium
CN108334753B (en) Pirate application verification method and distributed server node
CN108734028B (en) Data management method based on block chain, block chain link point and storage medium
CN115391749A (en) Method and system for protecting computer software using distributed hash table and blockchain
CN117278224A (en) Method and system for verifying identity attribute information
CN111506901A (en) Data processing method based on block chain, terminal and storage medium
CN108848148B (en) Transaction information confirmation method and device based on block chain
US20200313859A1 (en) Cryptologic Blockchain-Based Off-Chain Storage Verification
CN111476573B (en) Account data processing method, device, equipment and storage medium
CN111597567B (en) Data processing method, data processing device, node equipment and storage medium
CN113055380B (en) Message processing method and device, electronic equipment and medium
CN112948851A (en) User authentication method, device, server and storage medium
CN110598433B (en) Block chain-based anti-fake information processing method and device
CN112001376B (en) Fingerprint identification method, device, equipment and storage medium based on open source component
CN111367923A (en) Data processing method, data processing device, node equipment and storage medium
CN113783708A (en) Re-voting binary consensus method and device based on reliable broadcast
CN111817859A (en) Data sharing method, device, equipment and storage medium based on zero knowledge proof
CN109413099B (en) Certificate-based hybrid cloud encrypted communication method and device and electronic equipment
CN113051622B (en) Index construction method, device, equipment and storage medium
CN114826736A (en) Information sharing method, device, equipment and storage medium
CN116583833A (en) Self-auditing blockchain
CN107145342B (en) Method and device for processing channel information of application

Legal Events

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