CN115952559A - Tamper-proof trusted index query method and device and electronic equipment - Google Patents

Tamper-proof trusted index query method and device and electronic equipment Download PDF

Info

Publication number
CN115952559A
CN115952559A CN202211713022.3A CN202211713022A CN115952559A CN 115952559 A CN115952559 A CN 115952559A CN 202211713022 A CN202211713022 A CN 202211713022A CN 115952559 A CN115952559 A CN 115952559A
Authority
CN
China
Prior art keywords
index
data
field
information
tamper
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.)
Pending
Application number
CN202211713022.3A
Other languages
Chinese (zh)
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.)
iFlytek Co Ltd
Original Assignee
iFlytek 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 iFlytek Co Ltd filed Critical iFlytek Co Ltd
Priority to CN202211713022.3A priority Critical patent/CN115952559A/en
Publication of CN115952559A publication Critical patent/CN115952559A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a tamper-proof credible index query method, a tamper-proof credible index query device and electronic equipment, wherein the main concept of the invention is that indexes of blocks, transactions, accounts, contracts and the like are constructed on a chain except that information of the blocks and complete and credible transactions are stored on a block chain, only addresses of quick query information and specific information on the chain are stored in the indexes, the pressure of a database is reduced, and real-time query is achieved; the invention solves the problem of low performance in the information query process of block chains, transactions, accounts, contracts and the like under large data volume under the premise of safe and credible, and improves the availability of the block chains under large data volume.

Description

Tamper-proof trusted index query method and device and electronic equipment
Technical Field
The invention relates to the technical field of block chains, in particular to a tamper-proof trusted index query method and device and electronic equipment.
Background
With the development of scientific technology, more and more business scenes are applied by a blockchain technology with the advantages of decentralization, safety and the like, the blockchain technology is a shared and non-falsifiable account book, a large number of transaction data records in a full-order relationship are stored in a distributed environment, and the data are stored in blocks and are managed according to the granularity of the blocks. With the increase of transaction amount, data stored in the block chain will increase day by day, and query of conditions such as corresponding data blocks, transaction data total amount, transaction accounts, contract addresses and the like will become slower and slower under the condition that the number of the block chain is increased, so that the use requirements can not be met finally, and the use of the block chain in large data amount and long-term service is seriously influenced.
Specifically, blocks and transactions in a block chain system are stored in a linked list format, each transaction record in each block can be traversed by the existing method when conditions such as data blocks, transaction data total amount, transaction accounts and contract addresses are queried, and when the data volume is large, the method has the problems of long time consumption, slow updating and the like, and the system performance is seriously influenced.
In addition, when data is stored, the existing technical scheme directly generates and stores index data of a block chain in a traditional index mode, namely, the data is stored in a file or a base table in a general mode, and generated index records are independent. In such a manner, not only is data access pressure easily caused to be too high when data are too much, and the problem of data redundancy exists, but also certain abnormal conditions that the index data are stored and sent wrongly or are maliciously tampered can easily occur, so that the blockchain system queries wrong data through wrong indexes, the reliability of the blockchain system is reduced, and a great safety risk is caused.
Disclosure of Invention
In view of the foregoing, the present invention is directed to a tamper-resistant trusted index query method, device and electronic device, so as to solve the problems of excessive access pressure and low reliability in a large data volume scenario.
The technical scheme adopted by the invention is as follows:
in a first aspect, the present invention provides a method for querying a tamper-resistant trusted index, including:
predefining indexes for inquiring the blocks and the transaction related data on the chain, adding a hash value field, and generating a corresponding index field;
sequentially traversing each block on the block chain, adding data to be queried into an index field, and only storing preset query information and the address of the information to be queried on the block chain in the index field;
constructing a context link field between adjacent indexes;
binding each index record with data related to a block chain or a transaction by using a Hash locking mechanism;
and storing the constructed multiple index records in a form, and retrieving the index table to obtain corresponding data information during query.
In at least one possible implementation manner, the retrieving the index table to obtain the corresponding data information during the query includes:
generating a hash value according to the taken index information when inquiring data, and carrying out first verification on the hash value and the hash value stored in the table:
if the first check result is correct, acquiring the index record or taking out corresponding data from the block chain according to the index record, and then checking the context link field;
and if the first check result is an error or the context link field check fails, reconstructing the index record.
In at least one possible implementation manner, the manner of reconstructing the index includes:
and taking the last index record from the index table and generating a corresponding hash value for performing second check with the hash value in the index table:
if the second check result is different, sequentially taking a first record in the index table to repeatedly perform the second check until the check is successful, and reconstructing the index from the successful check position;
if the second check result is the same, information is added from the index record to reconstruct the index.
In at least one possible implementation manner, the binding each index record with data related to a block chain or a transaction includes:
splicing data needing to be added into the index field into a character string, hashing by using a hash algorithm, generating a digital signature hash value by using a node certificate, and putting the digital signature hash value into the hash value field of the index field.
In at least one possible implementation manner, the splicing the data that needs to be added into the index field into a character string includes:
and splicing the values of the fields except the hash value field according to a preset format, and performing corresponding conversion according to the data type of the values.
In at least one possible implementation manner, the constructing the context link field between adjacent indexes includes:
and performing up-down index row linkage in row units based on all the transaction numbers before the current block and the transaction number of the current block.
In at least one possible implementation manner, the up-down indexing row linking in row units adopts the following algorithm:
the sum of the transaction number of the previous row of the current block and the transaction number of the current block is equal to the transaction number of the next row of the current block.
In a second aspect, the present invention provides a tamper-resistant trusted index querying device, including:
the index definition module is used for predefining indexes for inquiring the blocks and the transaction related data on the chain, adding a hash value field and generating a corresponding index field;
the index information adding module is used for sequentially traversing each block on the block chain, adding the data to be inquired into the index field, and only storing preset inquiry information and the address of the information to be inquired on the block chain in the index field;
the index linking module is used for constructing context linking fields between adjacent indexes;
the index data binding module is used for binding each index record with data related to a block chain or a transaction by utilizing a Hash locking mechanism;
and the index table query module is used for storing the constructed multiple index records in a form and retrieving the index table to obtain corresponding data information during query.
In a third aspect, the present invention provides an electronic device, comprising:
one or more processors, memory which may employ a non-volatile storage medium, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the method as in the first aspect or any possible implementation of the first aspect.
The invention has the main conception that besides the information of blocks and complete and credible transaction is stored in a block chain, indexes of the blocks, the transaction, accounts, contracts and the like are constructed on the chain, and only information needing to be quickly inquired and the address of specific information on the chain are stored in the indexes, so that the pressure of a database is reduced, and the real-time inquiry is realized; when the index is constructed, a Hash locking mechanism is used, context linkage is established in the upper and lower adjacent index rows through field information, the index is prevented from being stored wrongly or tampered through the Hash locking and context linkage mechanisms, the index is bound with a block chain or transaction information, and the same credibility of data inquired from the index is ensured. On the premise of safety and credibility, the method and the device solve the problem of low performance in the information query process of the blockchain, transaction, account, contract and the like under the large data volume, and improve the usability of the blockchain under the large data volume.
Furthermore, the invention also provides an index query verification and reconstruction mechanism aiming at credible tamper resistance, and the index is ensured to be prompted to be abnormal and to be automatically reconstructed aiming at wrong indexes after the indexes are tampered.
Compared with the prior art, the scheme of the invention has at least the following advantages:
(1) When the data volume of the block chain is large, the whole block chain needs to be traversed sequentially by inquiring data in a traditional mode, the time consumption is long, and after the scheme of the invention is used, indexes for constructing blocks, transactions, accounts and contracts are established, the data inquiry performance is improved, and the efficient real-time inquiry effect is realized;
(2) In the scheme of the invention, only the index information of the block, the transaction, the account and the contract is needed to be stored, and the tampering is prevented through the hash field and the context link, which is different from the conventional method of storing all transaction information in the block under a link, so that the storage space can be greatly saved;
(3) Hash locking is carried out when the index is constructed, the index is bound with information such as blocks or transactions, and the index is matched with context linkage, so that the index data line is prevented from being lost or tampered, and the index is ensured to be safe, real and credible.
Drawings
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described with reference to the accompanying drawings, in which:
FIG. 1 is a flowchart of an embodiment of a tamper-resistant trusted index query method provided by the present invention;
FIG. 2 is a diagram illustrating an embodiment of a tamper-resistant trusted index lookup apparatus according to the present invention;
fig. 3 is a schematic diagram of an embodiment of an electronic device provided in the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
In order to solve the aforementioned drawbacks, the invention proposes that a tamper-resistant hash field is added when an index is constructed, and index information can contain not only directly and quickly retrieved information (which can be understood as simple information to be queried) but also the position of specific information to be queried in a block chain; in addition, linking between upper and lower adjacent indexes can be performed when the indexes are constructed, abnormal scenes such as index loss and malicious tampering are prevented, the safety of index data is improved, and the reliability of data query from the indexes is further improved. Therefore, when the block chain information is inquired, because the index is bound with the block chain or the transaction information, the direct access of the index is equal to the access of the block chain, and the data is safe and quick to check. It should be noted that the invention can be used for index establishment of blocks, transactions, accounts and contracts in a block chain under a general scene and real-time query, and can also be used for safe, reliable and quick query processing of data under a large data volume scene.
Furthermore, when index information is inquired, the invention also provides data check, if the index information is correct, the needed index record is taken out, or corresponding detailed information is taken out from the block chain according to the index record, so that the data inquiry is fast and safe, then the context link field check is carried out, if the hash check is wrong or the context link check is failed, the record is reconstructed, and the index data is ensured to be complete, safe and credible.
Specifically, the present invention provides an embodiment of at least one tamper-resistant trusted index query method, as shown in fig. 1, which specifically includes:
step S1, predefining indexes for inquiring all blocks and related data of the transaction on a chain, adding a hash value field, and generating a corresponding index field;
in addition to storing the blocks and the transaction data as original data in the blockchain, a custom index of the blocks, the transactions, the accounts and the contracts is additionally constructed, and here, the construction of the blockchain index is taken as an example: taking the block number as a key, taking the version number, all transaction numbers before the current block, the transaction number of the current block and other data needing to be quickly inquired as the Value, and simultaneously adding a tamper-resistant hash value field to generate a corresponding index field;
in some preferred embodiments, the data included in the Value may not only be data to be queried, but also include an address number where a certain piece of detailed information is located, for example, in the process of constructing a transaction index, an account name may be used as a key, and a number of a block chain where a specific transaction related to the account is located is stored in the Value.
S2, traversing each block on the block chain in sequence, and adding data to be inquired into an index field;
in the process of building the block index, each block on the block chain can be traversed, and data needing to be quickly inquired, such as block numbers, version numbers, transaction numbers before the current block, transaction numbers of the current block and the like, are added into a corresponding index table.
S3, constructing a context link field between adjacent indexes;
and constructing a context link field in a row unit, for example, linking up and down index rows through all transaction numbers before the current block and the transaction number of the current block in the block index, wherein the sum of all transaction numbers before the current block of the previous row and the transaction number of the current block is equal to all transaction numbers of the current block of the next row, so that the integrity of index information is ensured, and information of a certain row is prevented from being lost.
Specifically, in combination with the above steps, in the process of adding data, all transaction numbers before the current block and the transaction number in the current block are added to form all transaction numbers before the current block in the next index, and the up-and-down adjacent links of the index are formed, so that the security of the index data can be further improved.
S4, binding each index record with a block chain or data related to the transaction by utilizing a Hash locking mechanism;
in actual operation, data to be placed in an index base table can be spliced into a character string, hash processing is performed by using hash algorithms including but not limited to cryptographic algorithms such as SHA256 and SM3, meanwhile, a node certificate is used for generating a digital signature hash value, the digital signature hash value is placed in a hash value field, and binding of indexes and information such as block chains or transactions is completed.
The reference for the string splicing method and the calculation of the digital signature hash value is as follows, where a block index is taken as an example:
taking the hash value, version number, transaction number before the current block, and transaction number of the current block as the block index Va lue value:
Valu6={“hash”:″”,”version”:1,”totalTxCount”:2000,”curTxCount”:1000};
and splicing the values of other fields except the hash value field according to a character string format, converting the values into character strings if the values are integers, and converting the values into 'true'/'false' if the values are booI.
A separator of '0 x 90' is added between the first field value and the second field value;
a separator of '0 x 80' is added between the second field value and the third field value;
no separator is needed to be added between the third field value and the fourth field value and between every two subsequent field values.
The splicing process is as follows:
S=string(V 1 )+”Ox90"+string(V 2 )+”0x80″+string(V 3 )+…+string(V n )
wherein, V 1 ,V 2 ,…,V n To index a particular Value in Value, string is to convert a numeric Value of a different data type into a string type.
And then calculating the digital signature hash value used for being placed in the hash value field by using the spliced character string through an encryption algorithm such as sha256, wherein the formula is as follows:
hash=sha256(S)
when the number of blocks in the block chain is more than the number of records in the current index form, the index information which is not added into the form can be added into the form to update the index, and the hash locking is performed on the updated index information.
And S5, storing the constructed multiple index records in a form, and retrieving corresponding data information during query.
Specifically, when information needs to be queried, each block does not need to be traversed, only the record value of the index table stored in the database needs to be fetched, and if the record value is the required information value, the information is directly fetched; if the value is the address number record value of a certain detailed information, the detailed information is taken out from the block chain according to the address number record value, and the searching performance of the block chain under the condition of large data volume is greatly improved by the inquiring mode.
When index information is inquired, the invention also provides a data checking operation, specifically, when data is inquired, a hash value is generated according to the index information taken out, and a first check is carried out on the hash value stored in the table: if the first check result is correct, acquiring the index record or taking out corresponding data from the block chain according to the index record, and then checking the context link field; and if the first check result is error or the context link field check fails, the index is reconstructed, and the data of the index record is ensured to be complete, safe and credible.
Based on this, further, when the index needs to be reconstructed, the last index record in the index table (directory) may also be taken and a corresponding hash value may be generated, which is used to perform a second check with the hash value in the form:
if the second check result is different, the index is falsified, one record on the index form is sequentially taken for second check until the check is successful, and the index is reconstructed from the successful check position;
if the second check result is the same, indicating that the reconstruction position is not tampered, adding the index record from the position, and reconstructing the form.
In summary, the main idea of the present invention is to construct indexes of blocks, transactions, accounts, contracts, etc. on a chain, besides storing complete and reliable information of the blocks and transactions on the block chain, and only storing addresses of quick query information and specific information on the chain in the indexes, thereby reducing database pressure and achieving real-time query; the invention solves the problem of low performance in the information query process of block chains, transactions, accounts, contracts and the like under large data volume under the premise of safe and credible, and improves the availability of the block chains under large data volume.
Corresponding to the above embodiments and preferred schemes, the present invention further provides an embodiment of a tamper-resistant trusted index query apparatus, as shown in fig. 2, which may specifically include the following components:
the index definition module 1 is used for predefining indexes used for inquiring all blocks and related data of transactions on a chain, adding a hash value field and generating a corresponding index field;
the index information adding module 2 is used for sequentially traversing each block on the block chain, adding the data to be inquired into the index field, and only storing preset inquiry information and the address of the information to be inquired on the block chain in the index field;
an index linking module 3, configured to construct a context link field between adjacent indexes;
the index data binding module 4 is used for binding each index record with data related to a block chain or a transaction by using a Hash locking mechanism;
and the index table query module 5 is configured to store the constructed multiple index records in a form, and retrieve the index table to obtain corresponding data information during query.
It should be understood that the division of the components in the tamper-resistant trusted index lookup apparatus shown in fig. 2 is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity or physically separated. And these components may all be implemented in software invoked by a processing element; or can be implemented in the form of hardware; and part of the components can be realized in the form of software called by the processing element, and part of the components can be realized in the form of hardware. For example, a certain module may be a separate processing element, or may be integrated into a certain chip of the electronic device. Other components are implemented similarly. In addition, all or part of the components can be integrated together or can be independently realized. In implementation, each step of the above method or each component above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above components may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors (DSPs), one or more Field Programmable Gate Arrays (FPGAs), etc. For another example, these components may be integrated together and implemented in the form of a System-On-a-Chip (SOC).
In view of the foregoing examples and preferred embodiments thereof, it will be appreciated by those skilled in the art that, in practice, the technical idea underlying the present invention may be applied in a variety of embodiments, the present invention being schematically illustrated by the following vectors:
(1) An electronic device is provided. The device may specifically include: one or more processors, memory, and one or more computer programs stored in the memory, the one or more computer programs comprising instructions which, when executed by the apparatus, cause the apparatus to perform the steps/functions of the foregoing embodiments or equivalent implementations.
The electronic device may specifically be a computer-related electronic device, such as but not limited to various interactive terminals and electronic products, a mobile terminal, and the like.
Fig. 3 is a schematic structural diagram of an embodiment of an electronic device provided in the present invention, and specifically, the electronic device 900 includes a processor 910 and a memory 930. Wherein, the processor 910 and the memory 930 can communicate with each other and transmit control and/or data signals through the internal connection path, the memory 930 is used for storing computer programs, and the processor 910 is used for calling and running the computer programs from the memory 930. The processor 910 and the memory 930 may be combined into a single processing device, or more generally, separate components, and the processor 910 is configured to execute the program code stored in the memory 930 to implement the functions described above. In particular implementations, the memory 930 may be integrated with the processor 910 or may be separate from the processor 910.
In addition, to further enhance the functionality of the electronic device 900, the device 900 may further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, a sensor 901, and the like, which may further include a speaker 982, a microphone 984, and the like. The display unit 970 may include a display screen, among others.
Further, the apparatus 900 may also include a power supply 950 for providing power to various devices or circuits within the apparatus 900.
It should be understood that the operation and/or function of the various components of the apparatus 900 can be referred to in the foregoing description with respect to the method, system, etc., and the detailed description is omitted here as appropriate to avoid repetition.
It should be understood that the processor 910 in the electronic device 900 shown in fig. 3 may be a system on chip SOC, and the processor 910 may include a Central processing Unit (Central pro 6 session Unit; hereinafter, referred to as CPU) and may further include other types of processors, for example: an image Processing Unit (GPU), etc., which will be described in detail later.
In summary, various portions of the processors or processing units within the processor 910 may cooperate to implement the foregoing method flows, and corresponding software programs for the various portions of the processors or processing units may be stored in the memory 930.
(2) A computer data storage medium having stored thereon a computer program or the above apparatus which, when executed, causes a computer to perform the steps/functions of the above embodiments or equivalent implementations.
In several embodiments provided by the present invention, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer data-accessible storage medium. Based on this understanding, some aspects of the present invention may be embodied in the form of software products, which are described below, or portions thereof, which substantially contribute to the art.
In particular, it should be noted that the storage medium may refer to a server or a similar computer device, and specifically, the aforementioned computer program or the aforementioned apparatus is stored in a storage device in the server or the similar computer device.
(3) A computer program product (which may include the above apparatus) when running on a terminal device, causes the terminal device to execute the tamper-resistant trusted index querying method of the foregoing embodiment or equivalent embodiments.
From the above description of the embodiments, it is clear to those skilled in the art that all or part of the steps in the above implementation method can be implemented by software plus a necessary general hardware platform. With this understanding, the above-described computer program product may include, but is not limited to referring to APP.
In the foregoing, the device/terminal may be a computer device, and the hardware structure of the computer device may further specifically include: at least one processor, at least one communication interface, at least one memory, and at least one communication bus; the processor, the communication interface and the memory can all complete mutual communication through the communication bus. The processor may be a central Processing unit CPU, a DSP, a microcontroller, or a digital Signal processor, and may further include a GPU, an embedded Neural Network Processor (NPU), and an Image Signal Processing (ISP), and may further include a specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present invention, and the processor may have a function of operating one or more software programs, and the software programs may be stored in storage media such as a memory; and the aforementioned memory/storage media may include: non-volatile Memory (non-volatile Memory) such as non-removable magnetic disk, U disk, removable hard disk, optical disk, etc., read-Only Memory (ROM), random Access Memory (RAM), etc.
In the embodiments of the present invention, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, and means that there may be three relationships, for example, a and/or B, and may mean that a exists alone, a and B exist simultaneously, and B exists alone. Wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" and the like, refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c may represent: a, b, c, a and b, a and c, b and c or a and b and c, wherein a, b and c can be single or multiple.
Those of skill in the art will appreciate that the various modules, elements, and method steps described in the embodiments disclosed in this specification can be implemented as electronic hardware, 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 implementation. 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 invention.
And, modules, units, etc. described herein as separate components may or may not be physically separate, i.e., may be located in one place, or may be distributed across multiple places, e.g., nodes of a system network. Some or all of the modules and units can be selected according to actual needs to achieve the purpose of the above-mentioned embodiment. Can be understood and carried out by those skilled in the art without inventive effort.
The structure, features and effects of the present invention have been described in detail with reference to the embodiments shown in the drawings, but the above embodiments are merely preferred embodiments of the present invention, and it should be understood that technical features related to the above embodiments and preferred modes thereof can be reasonably combined and configured into various equivalent schemes by those skilled in the art without departing from and changing the design idea and technical effects of the present invention; therefore, the invention is not limited to the embodiments shown in the drawings, and all the modifications and equivalent embodiments that can be made according to the idea of the invention are within the scope of the invention as long as they are not beyond the spirit of the description and the drawings.

Claims (10)

1. A tamper-resistant trusted index query method is characterized by comprising the following steps:
predefining indexes for inquiring the blocks and the transaction related data on the chain, adding a hash value field, and generating a corresponding index field;
sequentially traversing each block on the block chain, adding data to be queried into the index field, and only storing preset query information and the address of the information to be queried on the block chain in the index field;
constructing a context link field between adjacent indexes;
binding each index record with a block chain or data related to the transaction by utilizing a Hash locking mechanism;
and storing the constructed multiple index records in a form, and retrieving the index table to obtain corresponding data information during query.
2. The method according to claim 1, wherein retrieving the index table to obtain the corresponding data information during querying comprises:
generating a hash value according to the taken index information when inquiring data, and carrying out first verification on the hash value and the hash value stored in the table:
if the first check result is correct, acquiring the index record or taking out corresponding data from the block chain according to the index record, and then checking the context link field;
and if the first check result is an error or the context link field check fails, reconstructing the index record.
3. The tamper-resistant trusted index lookup method according to claim 2, wherein the manner of reconstructing the index includes:
and taking the last index record from the index table and generating a corresponding hash value for performing second check with the hash value in the index table:
if the second check result is different, sequentially taking a first record in the index table to repeatedly perform the second check until the check is successful, and reconstructing the index from the successful check position;
if the second check result is the same, information is added from the index record to reconstruct the index.
4. The tamper-resistant trusted index lookup method as claimed in claim 1, wherein said binding each index record with block chain or transaction-related data comprises:
splicing data needing to be added into the index field into a character string, hashing by using a hash algorithm, generating a digital signature hash value by using a node certificate, and putting the digital signature hash value into the hash value field of the index field.
5. The tamper-resistant trusted index query method of claim 4, wherein the splicing the data to be added into the index field into a string comprises:
and splicing the values of the fields except the hash value field according to a preset format, and performing corresponding conversion according to the data type of the values.
6. The tamper-resistant trusted index lookup method according to any one of claims 1 to 5, wherein constructing the context link field between adjacent indexes comprises:
and performing up-down index row linkage in row units based on all the transaction numbers before the current block and the transaction number of the current block.
7. The tamper-resistant trusted index lookup method according to claim 6, wherein the up-down indexing row linking in row units adopts the following algorithm:
the sum of the transaction number of the previous row of the current block and the transaction number of the current block is equal to the transaction number of the current block of the next row.
8. A tamper-resistant trusted index lookup apparatus, comprising:
the index definition module is used for predefining indexes used for inquiring the blocks and the transaction related data on the chain, adding a hash value field and generating a corresponding index field;
the index information adding module is used for sequentially traversing each block on the block chain, adding the data to be inquired into the index field, and only storing preset inquiry information and the address of the information to be inquired on the block chain in the index field;
the index linking module is used for constructing context linking fields between adjacent indexes;
the index data binding module is used for binding each index record with data related to a block chain or a transaction by utilizing a Hash locking mechanism;
and the index table query module is used for storing the constructed multiple index records in a form and retrieving the index table to obtain corresponding data information during query.
9. An electronic device, comprising:
one or more processors, memory, and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform the tamper-resistant trusted index querying method of any one of claims 1-7.
10. A computer data storage medium having a computer program stored therein, wherein the computer program is enabled to cause a computer to execute the tamper-resistant trusted index lookup method as claimed in any one of claims 1 to 7 when the computer program runs on the computer.
CN202211713022.3A 2022-12-26 2022-12-26 Tamper-proof trusted index query method and device and electronic equipment Pending CN115952559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211713022.3A CN115952559A (en) 2022-12-26 2022-12-26 Tamper-proof trusted index query method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211713022.3A CN115952559A (en) 2022-12-26 2022-12-26 Tamper-proof trusted index query method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN115952559A true CN115952559A (en) 2023-04-11

Family

ID=87282227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211713022.3A Pending CN115952559A (en) 2022-12-26 2022-12-26 Tamper-proof trusted index query method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN115952559A (en)

Similar Documents

Publication Publication Date Title
US11095451B2 (en) Optimal data storage configuration in a blockchain
US11196542B2 (en) Checkpointing for increasing efficiency of a blockchain
US11334439B2 (en) Checkpointing for increasing efficiency of a blockchain
US10901957B2 (en) Checkpointing for increasing efficiency of a blockchain
US10789597B2 (en) Systems and methods for using a distributed ledger for data handling
US20170346693A1 (en) Method and system for efficient distribution of configuration data utilizing permissioned blockchain technology
CN108572986B (en) Data updating method and node equipment
JP7279904B2 (en) Chain data verification system and method
CN117278224A (en) Method and system for verifying identity attribute information
CN112287034B (en) Data synchronization method, equipment and computer readable storage medium
CN107463597B (en) Passive verification method and system for block chain of modified block volume data
KR20210045353A (en) Indexing and recovery of encoded blockchain data
US20210303633A1 (en) Shard hashing
CN112287033B (en) Data synchronization method, equipment and computer readable storage medium
CN109409882A (en) A kind of credit accreditation storage method and device based on block chain
CN111177225B (en) Account state existence proving method and device and state inquiring method and device
CN113326165B (en) Data processing method and device based on block chain and computer readable storage medium
WO2023051308A1 (en) Data verification method and apparatus, device and storage medium
CN111817859A (en) Data sharing method, device, equipment and storage medium based on zero knowledge proof
JP2021528884A (en) Memory of dynamic blockchain data based on error correction code
CN107451002B (en) Active verification method and system for block chain of modified block volume data
CN115952559A (en) Tamper-proof trusted index query method and device and electronic equipment
JP2024505105A (en) Method and device for validating database query results
CN116015609A (en) Business record storage method, device, computer equipment and storage medium
AU2022405455A1 (en) Data validation techniques for sensitive data migration across multiple platforms

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