Block chain transaction search method, related device and medium

By building an indexed data library for each transaction type in the blockchain system and generating an index using specific index rules, the problems of inefficiency and poor scalability of transaction queries are solved, and flexible and efficient query capabilities are achieved.

CN119938987APending Publication Date: 2025-05-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311469849.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-06
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing blockchain system is inefficient in transaction query, and the preset indexing method needs to frequently update the background when query requirements change, resulting in poor scalability.

Method used

By building the corresponding index data library for each transaction type in the index database, and generating indexes using transaction type-specific index rules, dynamic query and flexible expansion are achieved.

Benefits of technology

It improves the efficiency of transaction query and the scalability of the system, and can flexibly respond to different transaction query needs without frequent updates to the background.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938987A_ABST
    Figure CN119938987A_ABST
Patent Text Reader

Abstract

The invention provides a block chain transaction search method, a related device and a medium. The method comprises the steps of receiving a block chain transaction query request of a target object, wherein the block chain transaction query request comprises a target transaction type of a to-be-queried transaction; a target index data sub-library corresponding to the target transaction type is determined in an index database, the index database comprises multiple index data sub-libraries corresponding to the multiple transaction types, and the index data sub-library corresponding to each transaction type searches for transactions of the transaction type on the block chain; the searched transactions are generated by adding indexes according to index rules specific to transaction types; displaying an index entry corresponding to the target index data sub-library, and receiving a target index specified by the target object for the index entry; and obtaining a transaction corresponding to the target index from the target index data sub-library as a search result. According to the method and the device, different query requirements can be met, and the expandability is relatively good. The method and the device can be applied to various scenes such as block chains, artificial intelligence and cloud technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of blockchain technology, and in particular to a blockchain transaction search method, related devices and media. Background Art

[0002] Currently, in blockchain systems, when querying transactions, the corresponding transactions are often searched by traversing blocks on the blockchain based on block identifiers and transaction identifiers. This method results in low transaction search efficiency.

[0003] To address this problem, the related art uses a preset index to implement transaction query. Specifically, first determine an index format, and build an index for all transactions on the blockchain according to the index format. When you want to query a transaction, you can query the corresponding transaction by inputting the index into the object. However, when the query field input by the object changes and the search is not performed according to the preset index, there is no way to search for the transaction to be queried, unless the new query format determined by the object is used to rebuild the index for each transaction to meet the new query requirements. This method requires continuous updating of the background and changing the fixed index to meet different query requirements when the query requirements change. This often results in the system background being updated every time a new query requirement is generated, and the scalability is poor. Summary of the invention

[0004] The disclosed embodiments provide a blockchain transaction search method, related devices, and media, which can meet different query requirements and have good scalability.

[0005] According to one aspect of the present disclosure, a blockchain transaction search method is provided, and the blockchain transaction search method includes:

[0006] Receive a blockchain transaction query request of a target object, wherein the blockchain transaction query request includes a target transaction type of the transaction to be queried;

[0007] In an index database, determining a target index data sub-library corresponding to the target transaction type, wherein the index database includes a plurality of index data sub-libraries corresponding to a plurality of transaction types, and the index data sub-library corresponding to each of the transaction types is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to an index rule specific to the transaction type;

[0008] Displaying the index entry corresponding to the target index data sub-library, and receiving the target index specified by the target object for the index entry;

[0009] In the target index database sub-library, the transaction corresponding to the target index is obtained as a search result.

[0010] According to one aspect of the present disclosure, a blockchain transaction search device is provided, and the blockchain transaction search device includes:

[0011] A receiving unit, configured to receive a blockchain transaction query request from a target object, wherein the blockchain transaction query request includes a target transaction type of a transaction to be queried;

[0012] a determining unit, configured to determine, in an index database, a target index data sub-library corresponding to the target transaction type, wherein the index database includes a plurality of index data sub-libraries corresponding to a plurality of transaction types, and the index data sub-library corresponding to each of the transaction types is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to an index rule specific to the transaction type;

[0013] A display unit, used to display the index entry corresponding to the target index data sub-library, and receive the target index specified by the target object for the index entry;

[0014] The acquisition unit is used to acquire the transaction corresponding to the target index as a search result in the target index data sub-library.

[0015] Optionally, the index data sub-library corresponding to each of the transaction types is generated in the following manner:

[0016] Determine a transaction signature and an associated blockchain address of the transaction based on an index rule corresponding to the transaction type;

[0017] For each of the transaction types, starting from a predetermined block height, determining the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address;

[0018] Adding an index to the searched transaction according to an index rule specific to the transaction type;

[0019] Based on the multiple transactions to which the index is added, the index data sub-library corresponding to the transaction type is generated.

[0020] Optionally, the transaction signature is generated in the following manner:

[0021] For each of the transactions, determining a transaction type of the transaction and a transaction parameter type associated with the transaction;

[0022] Performing a digest operation on the concatenation result of the transaction type and the transaction parameter type to obtain a digest result;

[0023] The digest result is determined as the transaction signature of the transaction.

[0024] Optionally, determining the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address includes:

[0025] Starting from the predetermined block height, determining a plurality of candidate on-chain transactions recorded on the blockchain;

[0026] For each of the candidate on-chain transactions, determine a first transaction signature and a first blockchain address of the candidate on-chain transaction;

[0027] Based on the comparison between the first transaction signature and the transaction signature, and the comparison between the first blockchain address and the associated blockchain address, the transaction is determined from the multiple candidate on-chain transactions.

[0028] Optionally, the determining the transaction from the plurality of candidate on-chain transactions based on the comparison of the first transaction signature with the transaction signature and the comparison of the first blockchain address with the associated blockchain address includes:

[0029] Integrate the candidate on-chain transactions that have the first transaction signature consistent with the transaction signature into a first transaction set;

[0030] Integrate the candidate on-chain transactions that are consistent with the first blockchain address and the associated blockchain address into a second transaction set;

[0031] The candidate on-chain transactions included in both the first transaction set and the second transaction set are determined as the transactions.

[0032] Optionally, the predetermined block height is determined by:

[0033] determining, in the blockchain, transaction timestamps of a plurality of the transactions having the transaction signatures;

[0034] Determine the target block where the transaction with the earliest transaction timestamp is located;

[0035] The block height of the target block is determined as the predetermined block height.

[0036] Optionally, the index rule includes a first index, a second index, and a resource identifier; the transaction association information of the transaction includes a first address associated with the first index, a second address associated with the second index, and an associated resource of the transaction;

[0037] The step of generating the index data sub-library corresponding to the transaction type based on the transactions with multiple added indexes includes:

[0038] Based on the first index, storing the first address to a first position of the index data sub-library, wherein the first position is a position indicated by the index that is consistent with the first index;

[0039] Based on the second index, storing the second address to a second position of the index data sub-library, wherein the second position is a position indicated by the index that is consistent with the second index;

[0040] Based on the resource identifier, the associated resource is stored in a third location of the index data sub-library, wherein the third location is a location indicated by the index that is consistent with the resource identifier.

[0041] Optionally, the blockchain transaction search device further includes a resource accumulation unit, wherein the resource accumulation unit is used to:

[0042] Based on the first address associated with the first index, performing resource accumulation on the associated resource pointed to by the first address associated with the first index;

[0043] Based on the second address associated with the second index, resource accumulation is performed on the associated resource pointed to by the second address associated with the second index.

[0044] Optionally, the acquiring unit is specifically used for:

[0045] In the target index database sub-library, comparing the target index with a plurality of the indexes;

[0046] The transaction corresponding to the index consistent with the target index is extracted as a search result.

[0047] Optionally, the determining unit is specifically configured to:

[0048] For each of the index data sub-libraries, comparing the transaction type of the index data sub-library with the target transaction type;

[0049] The index data sub-library whose transaction type is consistent with the target transaction type is determined as the target index data sub-library.

[0050] Optionally, the index entry has multiple content editing areas;

[0051] The target index is specified in the following way:

[0052] Receiving the content determined by the target object in each of the content editing areas;

[0053] Assembling a plurality of query conditions based on the content and the index entries;

[0054] The target index is determined based on a logical operation relationship of a plurality of the query conditions.

[0055] Optionally, the blockchain transaction query request includes a transaction query time interval;

[0056] The acquisition unit is specifically used for:

[0057] In the target index data sub-database, the transaction corresponding to the target index is obtained as the filtered and on-chain transaction;

[0058] Determine the transaction timestamp of each of the filtered transactions on the chain;

[0059] The filtered on-chain transactions whose transaction timestamps are within the transaction query time interval are used as the search results.

[0060] Optionally, the indexing rules are deployed by the service management end to the indexing service end in the following manner:

[0061] displaying a first content page, the first content page having an editing area;

[0062] For each of the transaction types, based on a plurality of policy configuration parameters received in the editing area, determining the index rule corresponding to the transaction type;

[0063] Deploy the indexing rules to the indexing server.

[0064] Optionally, the index rule includes transaction information to be recorded on the chain, transaction processing strategy information, and interface deployment strategy information; the editing area includes multiple editing sub-areas;

[0065] The step of determining the indexing rule based on a plurality of policy configuration parameters received in the editing area comprises:

[0066] Determine the transaction information to be recorded on the chain based on the policy configuration parameter received on the editing sub-area corresponding to the transaction information to be recorded on the chain;

[0067] determining the transaction processing policy information based on the policy configuration parameters received on the editing sub-area corresponding to the transaction processing policy information;

[0068] Determining the interface deployment policy information based on the policy configuration parameters received on the editing sub-area corresponding to the interface deployment policy information;

[0069] The to-be-recorded on-chain transaction information, transaction processing strategy information, and interface deployment strategy information are integrated into the index rule.

[0070] Optionally, the blockchain transaction search device further includes an interface generation unit, and the interface generation unit is used to:

[0071] The index server determines the interface deployment information based on the index rule;

[0072] Based on the interface deployment information, a candidate query interface is deployed, wherein the candidate query interface is used to receive a blockchain transaction query request.

[0073] Optionally, the blockchain transaction query request of the target object is sent by the object terminal in the following manner:

[0074] Determine a target query interface from the plurality of candidate query interfaces;

[0075] The blockchain transaction query request is sent to the index server through the target query interface.

[0076] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the blockchain transaction search method as described above is implemented.

[0077] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the blockchain transaction search method as described above is implemented.

[0078] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain transaction search method as described above.

[0079] In the disclosed embodiment, the index service end constructs corresponding index data sub-libraries for different transaction types. The index data sub-library corresponding to each transaction type is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to index rules specific to the transaction type. For different transaction types, transactions that meet the transaction type are extracted according to different index rules, and the extracted transactions are indexed and stored according to the index rules; so that the indexing method of transactions of each transaction type is adapted to the transaction type. Further, after the index database is generated, when a blockchain transaction query request of the target object is received, after determining the target transaction type of the transaction to be queried from the blockchain transaction query request, the target index data sub-library corresponding to the target transaction type is determined in the index database according to the target transaction type. Then, according to the index entry corresponding to the target transaction type, the index entry corresponding to the target index data sub-library is displayed to the target object, and the target index specified by the target object for the index entry is received. Finally, in the target index data sub-library, the transaction corresponding to the target index is obtained as the search result. This approach builds corresponding index data sub-databases for different transaction types, and sets specific index entries for transactions under different transaction types, so that the query service provided by the index service can meet the query requirements for transactions of different transaction types and has good scalability.

[0080] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0082] Figure 1 is a system architecture diagram of a system to which a blockchain transaction search method according to an embodiment of the present disclosure is applied;

[0083] Figure 2A-2D A schematic diagram showing the application of a blockchain transaction search method in a transaction query scenario according to an embodiment of the present disclosure is shown;

[0084] Figure 3 is a flowchart of a blockchain transaction search method according to an embodiment of the present disclosure;

[0085] Figure 4 is a flowchart of generating an index data sub-library corresponding to a transaction type according to an embodiment of the present disclosure;

[0086] Figure 5 is a flow chart of generating a transaction signature according to one embodiment of the present disclosure;

[0087] Figure 6 is a flowchart of determining a transaction from multiple candidate on-chain transactions according to an embodiment of the present disclosure;

[0088] Figure 7 is a flow chart for determining a predetermined block height according to an embodiment of the present disclosure;

[0089] Figure 8 is a schematic diagram of an implementation process of determining a predetermined block height according to an embodiment of the present disclosure;

[0090] Fig. 9 It is a flowchart of generating index data sub-libraries corresponding to transaction types based on multiple index-added transactions according to an embodiment of the present disclosure;

[0091] Fig.10 It is a schematic diagram of an implementation process of generating an index data sub-library corresponding to a transaction type based on multiple index-added transactions according to an embodiment of the present disclosure;

[0092] Fig.11 is a flowchart of processing multiple index-added transactions according to an embodiment of the present disclosure;

[0093] Fig.12 is a schematic diagram of an implementation process of processing multiple index-added transactions according to an embodiment of the present disclosure;

[0094] Fig.13 is a flow chart of determining a target index data sub-library according to an embodiment of the present disclosure;

[0095] Fig.14 is a flowchart of determining a target index according to an embodiment of the present disclosure;

[0096] Fig.15 is a flow chart of generating search results according to one embodiment of the present disclosure;

[0097] Fig.16 is a flow chart of generating search results according to another embodiment of the present disclosure;

[0098] Fig.17 is a flowchart of determining index rules according to an embodiment of the present disclosure;

[0099] Fig.18 is a flowchart of determining an indexing rule based on a plurality of policy configuration parameters received in an editing area according to an embodiment of the present disclosure;

[0100] Figure 19A-19B is a schematic diagram of an implementation process of determining an index rule based on multiple policy configuration parameters received in an editing area according to the present disclosure;

[0101] Fig. 20 is a flow chart of a deployment candidate query interface according to one embodiment of the present disclosure;

[0102] Fig.21 is a schematic diagram of an implementation process of a deployment candidate query interface according to an embodiment of the present disclosure;

[0103] Fig. 22 is a flow chart of sending a blockchain transaction query request by a target terminal according to an embodiment of the present disclosure;

[0104] Fig.23 is a schematic diagram of implementation details of a blockchain transaction search method according to an embodiment of the present disclosure;

[0105] Fig.24 is a module diagram of a blockchain transaction device according to an embodiment of the present disclosure;

[0106] Fig.25 is a terminal structure diagram of a blockchain transaction search method according to an embodiment of the present disclosure;

[0107] Fig.26 1 is a server structure diagram of a blockchain transaction search method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0108] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0109] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:

[0110] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction system, mechatronics, etc. Among them, the pre-trained model is also called the large model or basic model. After fine-tuning, it can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0111] Blockchain: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of its information (anti-counterfeiting) and associate with the previous block.

[0112] Currently, in blockchain systems, when querying transactions, the corresponding transactions are often searched by traversing blocks on the blockchain based on block identifiers and transaction identifiers. This method results in low transaction search efficiency.

[0113] To address this problem, the related art uses a preset index to implement transaction query. Specifically, first determine an index format, and build an index for all transactions on the blockchain according to the index format. When you want to query a transaction, you can query the corresponding transaction by inputting the index into the object. However, when the query field input by the object changes and the search is not performed according to the preset index, there is no way to search for the transaction to be queried, unless the new query format determined by the object is used to rebuild the index for each transaction to meet the new query requirements. This method requires continuous updating of the background and changing the fixed index to meet different query requirements when the query requirements change. This often results in the system background being updated every time a new query requirement is generated, and the scalability is poor.

[0114] System architecture and scenario description of the application of the embodiments of the present disclosure

[0115] Figure 1 It is a system architecture diagram of the blockchain transaction search method according to an embodiment of the present disclosure. It includes an object terminal 140 and a server 110, wherein the server 110 includes a blockchain network 150, an index database 160, an index service 130, and a service management terminal 120.

[0116] The object terminal 140 includes various forms such as desktop computers, laptop computers, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. The object terminal 140 can communicate with the server 110 in a wired or wireless manner to exchange data. Among them, the object terminal 140 includes a transaction processing system, which is used to receive a transaction query request input by the object and forward the transaction query request to the server 110, and perform a transaction query through the index service 130 provided by the server 110.

[0117] The server 110 refers to a computer system that can provide certain services to the object terminal 140. Compared with the common object terminal 140, the server 110 has higher requirements in terms of stability, security, performance, etc. The server 110 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc.

[0118] The server 110 includes a blockchain network 150 , an index database 160 , an index service 130 , and a service management terminal 120 .

[0119] See also Figure 1The blockchain network 150 shown includes a consensus network. A consensus network refers to a network that uploads transactions to the blockchain after consensus is reached, and includes multiple consensus nodes. A consensus node is a blockchain node. A consensus node or a blockchain node can be a server in a blockchain network or an object terminal connected to a blockchain network. The specific form of a consensus node or a blockchain node is not limited here.

[0120] The service management terminal 120 is used to deploy the indexing rules to the indexing service 130. The indexing service 130 is used to extract transactions from the blockchain network 150 according to the indexing rules, add indexes to the extracted transactions, and store the indexed transactions in the index database 160. The indexing service 130 is also used to provide a query interface to the transaction processing system of the object terminal 140, so as to receive transaction query requests through the query interface, and provide the on-chain transactions in the database 160 to the transaction processing system according to the transaction query requests.

[0121] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A-2D The transaction query scenario shown, etc.

[0122] like Figure 2A As shown, when object A wants to query a transaction, object A will log in to the transaction processing system. The transaction processing system will display a content page, in which there are 4 interactive controls, namely, the "Add Transaction" control, the "Transaction Query" control, the "Xxxxx" control, and the "Xxxx" control. The "Add Transaction" control is used to trigger the process of adding a new transaction, and the "Transaction Query" control is used to trigger the process of querying a transaction. At this time, object A clicks the "Transaction Query" control to enter the transaction query process.

[0123] like Figure 2B As shown, when object A clicks the "Transaction Query" control and enters the transaction query process, a prompt field "Please enter the following information" and an input box corresponding to the transaction type and an input box corresponding to the resource transfer address will be displayed on the interface of the object terminal. At this time, object A enters "Resource Transfer" in the input box corresponding to the transaction type, enters "Xxxxx123" in the input box corresponding to the resource transfer address, and clicks the "OK" button to query the resource transfer transaction of the address "Xxxxx123".

[0124] like Figure 2CAs shown, after the transaction processing system receives the transaction type and resource transfer address input by object A, it will generate a transaction query request and send the transaction query request to the index service 130 through the query interface of the index service 130 in the server 110. After receiving the transaction query request, the index service 130 will query the resource transfer transactions related to each blockchain address recorded in a table form in the index database 160. Among them, two resource transfer transactions that meet the transaction query request are recorded in the index database 160, wherein the resource transfer transaction includes transferring 50 virtual resources from the address "Xxxxx123" to the address "Yy14"; and transferring 50 virtual resources from the address "Xxxxx123" to the address "Tt88". At this time, the index service 130 will send the two queried resource transfer transactions to the transaction processing system.

[0125] like Figure 2D As shown, after the transaction processing system receives the resource transfer transaction fed back by the index service 130, a prompt field "The resource transfer status of the resource transfer address "Xxxxx123" is as follows" will be displayed on the content page, and the resource transfer transaction of transferring 50 virtual resources from the address "Xxxxx123" to the address "Yy14" and the resource transfer transaction of transferring 50 virtual resources from the address "Xxxxx123" to the address "Tt88" will be displayed on the content page to realize transaction query. At this time, object A clicks the "OK" button to confirm the completion of the transaction query.

[0126] General description of the disclosed embodiments

[0127] According to one embodiment of the present disclosure, a blockchain transaction search method is provided.

[0128] This blockchain transaction search method is generally used in blockchain business scenarios such as alliance chains and enterprise-level blockchains, for example Figure 2A-2D The transaction query scenario shown. The disclosed embodiment provides a solution for building multiple index data sub-databases based on different index rules to record and save transactions on the blockchain, and directly obtain the corresponding transaction when receiving a transaction query request, which can meet different query requirements, improve the scalability of the system, and thus improve the transaction query efficiency.

[0129] The blockchain transaction search method of the embodiment of the present disclosure can be executed by the index server in the server.

[0130] like Figure 3 As shown, a blockchain transaction search method according to an embodiment of the present disclosure may include:

[0131] Step 310: Receive a blockchain transaction query request from a target object;

[0132] Step 320: Determine the target index data sub-database corresponding to the target transaction type in the index database;

[0133] Step 330: display the index entry corresponding to the target index data sub-library, and receive the target index specified by the target object as the index entry;

[0134] Step 340: In the target index database sub-library, obtain the transaction corresponding to the target index as the search result.

[0135] Steps 310 - 340 are described in detail below.

[0136] In step 310, a blockchain transaction query request of a target object is received.

[0137] The target objects refer to general Internet users, or certain enterprises and institutions.

[0138] The blockchain transaction query request is a request generated by the target object to query the required blockchain transaction according to actual needs.

[0139] The blockchain transaction query request includes the target transaction type of the transaction to be queried.

[0140] The transaction to be queried is the blockchain transaction that the target object wants to query.

[0141] The target transaction type is used to identify the category of the transaction to be queried. The target transaction type generally includes resource transfer, contract call, information verification, etc.

[0142] In the specific implementation of this embodiment, when the target object wants to query certain transactions, it will enter the transaction type and other information of the transaction to be queried on the front-end interface of the object terminal to generate a blockchain transaction query request. The object terminal will send the blockchain transaction query request to the server so that the index service in the server performs a transaction query according to the blockchain transaction query request.

[0143] The predetermined indexing strategy is used to indicate the information to be indexed and the processing method for the information to be indexed.

[0144] On-chain transactions refer to transactions recorded on the blockchain. Transactions are used to indicate the transfer of resources between objects.

[0145] To save space, the specific implementation process of recording multiple transactions on the blockchain according to the predetermined indexing strategy will be described in detail below. It will not be repeated here.

[0146] In step 320, a target index data sub-library corresponding to the target transaction type is determined in the index database.

[0147] The index database includes multiple index data sub-databases corresponding to multiple transaction types. The index data sub-database corresponding to each transaction type is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to index rules specific to the transaction type.

[0148] The index database refers to the database formed by the index service adding indexes to multiple transactions according to the transaction type. The index data sub-database refers to the database corresponding to the transaction type.

[0149] For example, the index database is composed of index data sub-databases corresponding to five transaction types. Each transaction type corresponds to an index data sub-database, and each index data sub-database stores multiple transactions with added indexes. The transaction types of the transactions with added indexes are the same, and the index adding method is the same.

[0150] Index rules refer to the way to add indexes to transactions of different transaction types, the way to process and store transaction information in transactions, etc.

[0151] In order to save space, the specific implementation process of searching for transactions of transaction types on the blockchain and adding indexes to the searched transactions according to index rules specific to the transaction type to generate index data sub-libraries in the disclosed embodiment will be described in detail below. No further description will be given here.

[0152] In the specific implementation of this embodiment, since the transaction type and the index data sub-database are one-to-one corresponding, based on this, according to the target transaction type of the transaction to be queried, among multiple index data sub-databases, the index data sub-database corresponding to the transaction type consistent with the target transaction type is determined as the target index data sub-database.

[0153] In step 330, the index entry corresponding to the target index database sub-library is displayed, and the target index specified by the target object for the index entry is received.

[0154] An index entry refers to a pointer identifier used for searching and querying transactions in a target index sub-database. For example, for a target index sub-database whose transaction type is resource transfer, the index entry of the target index sub-database is from or to; for a target index sub-database whose transaction type is identity authentication, the index entry of the target index sub-database is id or number.

[0155] The target index refers to the index that contains the specific transaction information of a transaction. The target index consists of index entries and specific transaction information.

[0156] For example, the target index can be from A. Among them, from is the index entry, and A is the contract address of the transaction to be queried.

[0157] In the specific implementation of this embodiment, the index entry corresponding to the target index data sub-library is first displayed on the object terminal. Then, the specific content corresponding to the index entry input by the target object on the interface of the object terminal is received. Finally, based on the specific content corresponding to the index entry and the index entry, the target index specified by the target object for the index entry is determined.

[0158] In step 340, in the target index database sub-library, the transaction corresponding to the target index is obtained as the search result.

[0159] The search result is a collection of multiple queried transactions.

[0160] In the specific implementation of this embodiment, since each transaction in the target index data sub-library contains an index, based on this, each index of the target index data sub-library is compared with the target index, and the transaction whose index is consistent with the target index is taken as the transaction corresponding to the target index. Finally, the multiple transactions corresponding to the target index are taken as search results, and the search results are fed back to the target object.

[0161] Through the above steps 310-340, in the embodiment of the present disclosure, the index service end constructs corresponding index data sub-libraries for different transaction types. The index data sub-library corresponding to each transaction type is generated by searching for transactions of the transaction type on the blockchain and adding indexes to the searched transactions according to index rules specific to the transaction type. For different transaction types, transactions that meet the transaction type are extracted according to different index rules, and the extracted transactions are indexed and stored according to the index rules; so that the indexing method of transactions of each transaction type is adapted to the transaction type. Further, after the index database is generated, when a blockchain transaction query request of the target object is received, after determining the target transaction type of the transaction to be queried from the blockchain transaction query request, the target index data sub-library corresponding to the target transaction type is determined in the index database according to the target transaction type. Then, according to the index entry corresponding to the target transaction type, the index entry corresponding to the target index data sub-library is displayed to the target object, and the target index specified by the target object for the index entry is received. Finally, in the target index data sub-library, the transaction corresponding to the target index is obtained as the search result. This approach builds corresponding index data sub-databases for different transaction types, and sets specific index entries for transactions under different transaction types, so that the query service provided by the index service can meet the query requirements for transactions of different transaction types and has good scalability.

[0162] The above is a general description of steps 310 to 340. Since step 310 has been described in detail in the above general description, the specific implementation of steps 320, 330 and 340 will be described in detail below.

[0163] Detailed description of generating index data sub-libraries corresponding to each transaction type in an embodiment of the present disclosure

[0164] Since the index rules are determined for different transaction query requirements, according to the index rules, the index server will add indexes and records to multiple transactions on the blockchain that meet the index rules specific to the transaction type, so that when a transaction query request is received, the transaction information that meets the requirements can be extracted from the recorded transaction information in a timely manner. However, the number of transactions recorded on the blockchain is often large. If all transactions recorded on the blockchain are screened one by one, the efficiency of the index server in extracting transactions will often be low, which is not conducive to the rapid construction and rapid update of the index data sub-library. Based on this, the embodiment of the present disclosure provides a solution for extracting transactions corresponding to transaction types based on transaction signatures, which can improve transaction extraction efficiency and transaction storage efficiency, thereby achieving rapid construction and rapid update of index data sub-libraries.

[0165] Please refer to Figure 4 In some embodiments, the process of generating the index data sub-library corresponding to each transaction type includes but is not limited to the following steps 410-440:

[0166] Step 410: Determine the transaction signature and associated blockchain address of the transaction based on the index rule corresponding to the transaction type;

[0167] Step 420: for each transaction type, starting from a predetermined block height, determine the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address;

[0168] Step 430: add an index to the searched transaction according to an index rule specific to the transaction type;

[0169] Step 440: Based on multiple transactions to add indexes, generate index data sub-libraries corresponding to the transaction types.

[0170] Steps 410 - 440 are described in detail below.

[0171] In step 410, for each transaction type, starting from a predetermined block height, the transaction recorded on the blockchain is determined based on the transaction signature and the associated blockchain address.

[0172] The transaction signature is used to identify the authenticity and integrity of the on-chain transaction. When a blockchain node generates an on-chain transaction based on the smart contract stored in the blockchain node, it will use its own private key to encrypt the on-chain transaction to generate the on-chain transaction signature.

[0173] The associated blockchain address is used to indicate the contract address of the smart contract that generated the transaction. The associated blockchain address of transactions generated by the same smart contract is the same.

[0174] In the specific implementation of this embodiment, since the index rules are often limited to extracting, processing, storing, etc. multiple transactions generated by a certain blockchain node or a certain smart contract. Therefore, the index rules often record the relevant information of the smart contract, the transaction type of the transaction, etc. Among them, the relevant information includes the contract address of the smart contract. Based on this, the transaction signature of the transaction to be recorded and the contract address of the smart contract that generated the transaction can be directly extracted from the index rules, and the contract address is used as the associated blockchain address.

[0175] For example, the index rule is: extract the transaction whose transaction signature is 174qra88 from the smart contract with the contract address kkk on the blockchain. Based on this, the transaction signature of the transaction is 174qra88, and the associated blockchain address is kkk.

[0176] In step 420, for each transaction type, starting from a predetermined block height, the transaction recorded on the blockchain is determined based on the transaction signature and the associated blockchain address.

[0177] Block height refers to the position of a block in the blockchain. The predetermined block height is used to indicate the starting position of transactions that need to be recorded.

[0178] When this embodiment is implemented specifically, starting from a predetermined block height, each block is traversed in turn according to the arrangement order of each block in the blockchain, and the transaction of each block is determined according to the transaction signature and the associated blockchain address.

[0179] For example, if the predetermined block height is 3, then starting from the third block in the blockchain, the transaction in the third block is determined based on the transaction signature and the associated blockchain address. Then, the transaction in the fourth block is determined based on the transaction signature and the associated blockchain address, and so on, and the transaction type in all blocks after the third block is determined to be a transaction of the transaction type specified in the index rule.

[0180] In step 430, the searched transactions are indexed according to indexing rules specific to the transaction type.

[0181] In the specific implementation of this embodiment, firstly, an index adding method of an index rule specific to a transaction type is determined, and then indexes are added one by one for the searched transactions according to the determined index adding method.

[0182] In step 440, based on multiple index-added transactions, an index data sub-library corresponding to the transaction type is generated.

[0183] In the specific implementation of this embodiment, multiple transaction key-value pairs are generated based on the index fields commonly owned by multiple indexed transactions and the specific fields of each indexed transaction, and the multiple transaction key-value pairs are stored in a database to obtain an index data sub-library.

[0184] To save space, the specific implementation process of generating the index data sub-library corresponding to the transaction type in the embodiment of the present disclosure will be described in detail below. No further description will be given here.

[0185] Through the above steps 410-440, the embodiment of the present disclosure extracts transactions that meet the requirements from the blockchain based on the transaction signatures and associated blockchain addresses of each transaction, adds an index to each transaction, and uniformly stores the indexed transactions, thereby forming an index data sub-library corresponding to the transaction type, which is conducive to improving transaction extraction efficiency and transaction storage efficiency.

[0186] Please refer to Figure 5 In one embodiment, the process of generating a transaction signature includes but is not limited to the following steps 510-530:

[0187] Step 510: for each transaction, determine the transaction type of the transaction and the transaction parameter type associated with the transaction;

[0188] Step 520: Perform a digest operation on the concatenation result of the transaction type and the transaction parameter type to obtain a digest result;

[0189] Step 530: Determine the summary result as the transaction signature of the transaction.

[0190] Steps 510 - 530 are described in detail below.

[0191] In step 510, for each transaction, the transaction type of the transaction and the transaction parameter type associated with the transaction are determined.

[0192] Transaction types are used to distinguish different on-chain transactions. For example, transaction types can include resource transfer, identity verification, and so on.

[0193] Transaction parameter types are used to distinguish different transaction parameters. Transaction parameters refer to the specific information contained in each transaction. For example, transaction parameter types can include addresses, names, etc.

[0194] In the specific implementation of this embodiment, when each transaction is generated, the specific information of the transaction will record the transaction type of the transaction and the transaction parameters involved in the transaction. Based on this, the transaction type can be extracted from the specific information of the transaction, and the transaction parameter type associated with the transaction can be determined according to the transaction parameters involved in the transaction.

[0195] For example, when the specific information of a transaction is to verify whether the address is a contract address, the transaction type of the transaction is verification, and the associated transaction parameter type is address. When the specific information of a transaction is to transfer resources from address A to address B, the transaction type of the transaction is resource transfer, and the associated transaction parameter types are address and resource value.

[0196] In step 520, a digest operation is performed on the concatenation result of the transaction type and the transaction parameter type to obtain a digest result.

[0197] In the specific implementation of this embodiment, the transaction type and the transaction parameter type are first concatenated to obtain a concatenation result, and then a digest operation is performed on the concatenation result using a predetermined digest algorithm to obtain a digest result.

[0198] For example, when a hash algorithm is used, the summary result can be expressed as hash(transaction type (transaction parameter type, transaction parameter type, …, transaction parameter type)).

[0199] It should be noted that the established digest algorithms in the embodiments of the present disclosure include but are not limited to MD5 message digest algorithm, Poseidon hash algorithm, reliable message digest algorithm, etc.

[0200] In step 530, the digest result is determined as the transaction signature of the transaction.

[0201] When this embodiment is specifically implemented, for each transaction generated by the smart contract, the summary result of the transaction is used as the transaction signature of the transaction.

[0202] For example, when a smart contract generates a transaction with a transaction type of resource transfer, and the specific content of the transaction is to transfer 50 virtual resources from address A to address B, the transaction signature of the transaction can be expressed as hash(Transfer(address,address,uint256)). Among them, Transfer is used to indicate that the transaction type is resource transfer, the two addresses are used to indicate that the transaction parameter types of the transaction parameters "address A" and "address B" are addresses, and uint256 is used to indicate the encoding form of the resource value 50.

[0203] Through the above steps 510-530, the embodiment of the present disclosure concatenates the transaction type and transaction parameter type of the transaction, performs a digest operation on the concatenation result, and uses the digest result as the transaction signature, which can more conveniently implement the signature operation of each transaction, and is beneficial to improving the reliability and efficiency of the signature.

[0204] Since each transaction recorded on the blockchain has a transaction signature and an associated blockchain address, based on this, the embodiment of the present disclosure provides a solution for transaction extraction based on the transaction signature and the associated blockchain address, which can improve the accuracy and efficiency of transaction extraction.

[0205] Please refer to Figure 6 In one embodiment, the process of determining a transaction recorded on a blockchain based on a transaction signature and an associated blockchain address includes, but is not limited to, the following steps 610-630:

[0206] Step 610: Starting from a predetermined block height, determine multiple candidate on-chain transactions recorded on the blockchain;

[0207] Step 620: For each candidate on-chain transaction, determine the first transaction signature and the first blockchain address of the candidate on-chain transaction;

[0208] Step 630: Based on the comparison between the first transaction signature and the transaction signature, and the comparison between the first blockchain address and the associated blockchain address, a transaction is determined from multiple candidate on-chain transactions.

[0209] Steps 610-630 are described in detail below.

[0210] In step 610, starting from a predetermined block height, multiple candidate on-chain transactions recorded on the blockchain are determined.

[0211] When this embodiment is implemented specifically, starting from a predetermined block height, all transactions recorded in all blocks starting from the predetermined block height are taken as candidate on-chain transactions, thereby obtaining multiple candidate on-chain transactions recorded on the blockchain.

[0212] For example, when the predetermined block height is 4 and the number of blocks on the blockchain is 6, all transactions recorded in the 4th block, the 5th block, and the 6th block are used as candidate on-chain transactions.

[0213] In step 620, for each candidate on-chain transaction, a first transaction signature and a first blockchain address of the candidate on-chain transaction are determined.

[0214] The first transaction signature is used to indicate the authenticity and integrity of the candidate on-chain transaction. The first transaction signature is also determined by the transaction type of the candidate on-chain transaction and the summary result of the associated transaction parameter type.

[0215] The first blockchain address is used to indicate the contract address of the smart contract that generates the candidate on-chain transaction.

[0216] In step 630, based on the comparison between the first transaction signature and the transaction signature, and the comparison between the first blockchain address and the associated blockchain address, a transaction is determined from multiple candidate on-chain transactions.

[0217] In the specific implementation of this embodiment, first, the candidate on-chain transactions whose first transaction signature is consistent with the transaction signature are integrated into a first transaction set, so as to screen the candidate on-chain transactions according to the transaction signature. Next, the candidate on-chain transactions whose first blockchain address is consistent with the associated blockchain address are integrated into a second transaction set, so as to screen the candidate on-chain transactions according to the blockchain address. Finally, the candidate on-chain transactions contained in both the first transaction set and the second transaction set are determined as transactions.

[0218] Through the above steps 610-630, the embodiment of the present disclosure screens multiple candidate on-chain transactions recorded on the blockchain based on the transaction signature and the associated blockchain address, takes the candidate on-chain transaction whose first transaction signature is consistent with the transaction signature and whose first blockchain address is consistent with the associated blockchain address as the transaction, and extracts the transaction association information of the transaction, which can improve the accuracy of transaction screening and the efficiency of transaction extraction.

[0219] Since transactions that meet the index rules do not necessarily exist in every block. If transactions are traversed from the first block on the blockchain, there is often a problem of low efficiency. For example, if the earliest transaction that meets the index rules is recorded in the fifth block, if the traversal starts from the first block, it will take time and resources to traverse the first four blocks, but no transactions that meet the requirements will be found, which is not conducive to improving transaction extraction efficiency. Based on this, the embodiment of the present disclosure provides a solution for determining a predetermined block height and traversing transactions from the predetermined block height, which can improve transaction extraction efficiency.

[0220] Please refer to Figure 7 , Figure 8 In one embodiment, the process of determining the predetermined block height includes but is not limited to the following steps 710-730:

[0221] Step 710: Determine transaction timestamps of multiple transactions with transaction signatures in the blockchain;

[0222] Step 720, determine the target block where the transaction with the earliest transaction timestamp is located;

[0223] Step 730: Determine the block height of the target block as the predetermined block height.

[0224] Steps 710 - 730 are described in detail below.

[0225] In step 710, transaction timestamps for a plurality of transactions having transaction signatures are determined in a blockchain.

[0226] The transaction timestamp is used to mark the time point when each transaction occurs.

[0227] In the specific implementation of this embodiment, since the transaction timestamp of each transaction on the blockchain is bound to the on-chain transaction, for each transaction with a transaction signature, the transaction timestamp can be extracted from the transaction receipt or transaction association information of the transaction.

[0228] In step 720, the target block where the transaction with the earliest transaction timestamp is located is determined.

[0229] In the specific implementation of this embodiment, first, for multiple transactions with transaction signatures, the transaction timestamps of each transaction are compared, and the transaction with the largest time difference between the transaction timestamp and the current time is determined as the transaction with the earliest transaction timestamp. Then, based on the transaction summary of the transaction and the transaction summary stored in each block on the blockchain, the block storing the transaction summary of the transaction is determined as the target block.

[0230] In step 730 , the block height of the target block is determined as a predetermined block height.

[0231] When this embodiment is specifically implemented, the block height of the target block is first determined based on the clustering between the target block and the genesis block of the blockchain; then, the block height of the target block is determined as the predetermined block height.

[0232] like Figure 8 As shown, the transactions with transaction signatures in the blockchain include transaction 6, transaction 2, transaction 4, and transaction 1. Among them, the transaction timestamp of transaction 6 is 15:00:01; the transaction timestamp of transaction 2 is 15:31:01; the transaction timestamp of transaction 4 is 15:53:30; and the transaction timestamp of transaction 1 is 14:28:22. It can be seen that the transaction timestamp of transaction 1 is the earliest, and transaction 1 is the earliest transaction generated. Therefore, the block where transaction 1 is located is used as the target block, that is, the target block is block 7, and the predetermined block height is the block height of block 7.

[0233] Through the above steps 710-730, the embodiment of the present disclosure determines the block where the transaction with the earliest transaction timestamp and transaction signature is located in the blockchain, uses the block height of the determined block as the predetermined block height, and extracts transactions from the predetermined block height, which can reduce the time waste caused by traversing the blocks before the predetermined block height and improve the efficiency of transaction extraction.

[0234] When a transaction query request is received, the index of the transaction that meets the transaction query request is obtained by querying the index entry. Therefore, the storage format of transactions and indexes in the index data sub-library will greatly affect the transaction query efficiency. Based on this, the embodiment of the present disclosure provides a solution for recording transactions and indexes in the index data sub-library based on a key-value pair, which can improve the storage rationality of transactions and indexes, and thus improve the transaction query efficiency.

[0235] In the disclosed embodiment, the index rule includes a first index, a second index, and a resource identifier; the transaction association information of the transaction includes a first address associated with the first index, a second address associated with the second index, and associated resources of the chained transaction.

[0236] The first index is used to indicate the storage location of the first address. The second index is used to indicate the storage location of the second address. The resource identifier is used to store the associated resource.

[0237] The first address and the second address are both used to indicate the contract address of a smart contract on the blockchain or the address of an associated resource pool of an object.

[0238] The first address and the second address are different.

[0239] Associated resources refer to the number of resources involved in a transaction.

[0240] For a transaction whose transaction type is resource transfer, the transaction association information of the transaction can be defined as:

[0241] event Transfer(address indexed_from,address indexed_to,uint256_value);

[0242] Among them, event refers to a transaction; Transfer refers to a transaction type of resource transfer; address indicates that the transaction parameter type is an address, and uint256 indicates that the transaction parameter type is a resource value. Indexed is used to modify the transaction parameter used as an index. In the above transaction association information, the transaction parameters modified by indexed are from and to, and both from and to are address type data. Value refers to the resource identifier.

[0243] For example, a transaction generated by a smart contract can be expressed as event Transfer (from A11, to B22, 50), which means transferring 50 virtual resources from the blockchain address A11 to the blockchain address B22.

[0244] For the transaction generated by the above smart contract, the first index refers to from, the second index refers to to; the resource identifier is Value. The first address is A11, the second address is B22, and the associated resource is 50.

[0245] Please refer to Fig. 9 , Fig.10In one embodiment, the process of recording transactions and indexes in the index data sub-library based on key-value pairs includes but is not limited to the following steps 910-930:

[0246] Step 910: based on the first index, store the first address to the first position of the index data sub-library;

[0247] Step 920: based on the second index, store the second address to the second position of the index data sub-library;

[0248] Step 930: Based on the resource identifier, store the associated resource in the third location of the index data sub-library.

[0249] Steps 910 - 930 are described in detail below.

[0250] In step 910, based on the first index, a first address is stored in a first position of the index data library.

[0251] The first position is the position indicated by the index that coincides with the first index.

[0252] In the specific implementation of this embodiment, the first index is first compared with each index. Then, an index consistent with the first index is determined, and the data storage location indicated by the index consistent with the first index is obtained to obtain the first location. Finally, the first address is stored in the first location.

[0253] In step 920, based on the second index, the second address is stored in a second location of the index data library.

[0254] The second position is the position indicated by the index that coincides with the second index.

[0255] When this embodiment is implemented, the specific implementation process of step 920 is similar to the above step 910. The difference is that the specific storage locations of the first address and the second address are different. To save space, it will not be repeated.

[0256] In step 930, based on the resource identifier, the associated resource is stored in a third location of the index database sub-library.

[0257] The third position is the position indicated by the index that is consistent with the resource identifier.

[0258] When this embodiment is implemented, the specific implementation process of step 930 is similar to the above step 910. The difference is that the specific storage locations of the first address and the associated resource are different. To save space, it will not be repeated.

[0259] like Fig.10As shown, for a certain smart contract P, for recording multiple transactions whose transaction type is resource transfer, the index data sub-library contains three index entries, wherein the index entries include index from, index to and index value. Further, for each index, a column is set as the storage space for the corresponding transaction association information. Among them, the column corresponding to the index from is the first position, the column corresponding to the candidate query index to is the second position, and the column corresponding to the index value is the third position. Based on this, for the transaction association information "event Transfer (from Xxxxx123, toMmkk1, 50)" of the transaction, the first address "Xxxxx123" associated with the first index from is stored in the first position (i.e., the first column); the second address "Mmkk1" associated with the second index to to is stored in the second position (i.e., the second column), and the associated resource "50" is stored in the third position (i.e., the third column) corresponding to the index value. By analogy, the transaction association information of multiple transactions whose transaction type is resource transfer in the smart contract P is continuously extracted and recorded.

[0260] Through the above steps 910-930, the embodiment of the present disclosure records the transaction-related information of the transaction based on the key-value pair method, and sets a storage space for each index to record the corresponding transaction-related information, which can effectively improve the rationality and standardization of information recording, thereby improving the transaction query efficiency.

[0261] Since transaction query often requires not only extracting transaction information on the blockchain, but also the overall situation of a certain type of transaction, or the analysis results of some transactions on the blockchain. Based on this, the embodiment of the present disclosure provides a solution for further processing the extracted transactions based on index rules, which can better expand the business processing scope of the index server, enable the index server to implement a variety of index business processing, and thus improve the scalability of the index server.

[0262] Please refer to Fig.11 , Fig.12 In one embodiment, the process of further processing the extracted transactions based on the index rules includes but is not limited to the following steps 1110-1120:

[0263] Step 1110: Based on the first address associated with the first index, accumulate the associated resources pointed to by the first address associated with the first index;

[0264] Step 1120: Based on the second address associated with the second index, perform resource accumulation on the associated resources pointed to by the second address associated with the second index.

[0265] Steps 1110 - 1120 are described in detail below.

[0266] In step 1110, for each first address associated with the first index, the associated resources pointed to by the first address in all on-chain transactions are accumulated to obtain the accumulated resources associated with the first address.

[0267] In step 1120, for each second address associated with the second index, the associated resources pointed to by the second address in all on-chain transactions are accumulated to obtain the accumulated resources associated with the second address.

[0268] like Fig.12 As shown, in addition to recording the transaction association information of multiple transactions as required, the index server also accumulates the transfer-in resources / transfer-out resources of the same blockchain address according to the predetermined index rules, and forms the resource accumulation result. Specifically, according to the specific records, the cumulative transfer-out amount of address "Xxxxx123" is 280; the cumulative transfer-in amount of address "Mmkk1" is 80; the cumulative transfer-in amount of address "Pp90" is 66; the cumulative transfer-in amount of address "Yy14" is 216.

[0269] Through the above steps 1110-1120, in the embodiment of the present disclosure, the index rules can not only guide the index server to extract what kind of data from the blockchain, but also provide various forms of data processing methods, adapt to the data processing needs and transaction query needs in various scenarios, and can play a good query guidance effect, so that the index server can realize various index business processing, thereby improving the scalability of the index server.

[0270] Detailed description of step 320

[0271] In step 320, a target index data sub-library corresponding to the target transaction type is determined in the index database.

[0272] In the specific implementation of this embodiment, since multiple transactions recorded in the index database can be distinguished according to transaction types, when querying transactions, transaction queries can be performed according to transaction types to improve the accuracy and efficiency of transaction queries.

[0273] Please refer to Fig.13 In some embodiments, based on the transaction type, the process of determining the target index data sub-library corresponding to the target transaction type includes but is not limited to the following steps 1310-1320:

[0274] Step 1310: for each index data sub-database, compare the transaction type of the index data sub-database with the target transaction type;

[0275] Step 1320: determine the index data sub-library whose transaction type is consistent with the target transaction type as the target index data sub-library.

[0276] Steps 1310 - 1320 are described in detail below.

[0277] In step 1310, for each index data sub-library, the transaction type of the index data sub-library is compared with the target transaction type.

[0278] When this embodiment is implemented specifically, in multiple index data sub-databases, the transaction type corresponding to each index data sub-database is compared with the target transaction type to determine the index data sub-database indicated by the transaction type consistent with the target transaction type.

[0279] In step 1320, the index data sub-library whose transaction type is consistent with the target transaction type is determined as the target index data sub-library.

[0280] In the specific implementation of this embodiment, since the index data sub-library with the transaction type consistent with the target transaction type is determined as the target index data sub-library and stores multiple transactions with the target transaction type, the index data sub-library with the target transaction type is determined as the target index data sub-library.

[0281] For example, the transaction type of transaction A and transaction B is resource transfer, and transaction A and transaction B are stored in index data sub-database 1; the transaction type of transaction C is resource verification, and transaction C is stored in index data sub-database 2. When the target transaction type of the transaction to be queried is resource transfer, it is determined that the target index data sub-database corresponding to the transaction type is index data sub-database 1, and the transactions corresponding to the target transaction type are transaction A and transaction B.

[0282] Through the above steps 1310-1320, the embodiment of the present disclosure performs transaction query according to the transaction type, determines the index data sub-library whose transaction type is consistent with the target transaction type as the target index data sub-library, and performs further transaction search according to the index in the target index data sub-library, which can improve the accuracy and efficiency of transaction search.

[0283] Detailed description of step 330

[0284] In step 330, the index entry corresponding to the target index database sub-library is displayed, and the target index specified by the target object for the index entry is received.

[0285] Please refer to Fig.14 In some embodiments, the index entry has multiple content editing areas, and the process of determining the target index includes but is not limited to the following steps 1410-1430:

[0286] Step 1410: receiving the content determined by the target object in each content editing area;

[0287] Step 1420: assemble multiple query conditions based on the content and index entries;

[0288] Step 1430: Determine a target index based on the logical operation relationship of multiple query conditions.

[0289] Steps 1410-1430 are described in detail below.

[0290] In step 1410 , the content determined by the target object in each content editing area is received.

[0291] When this embodiment is specifically implemented, the target object will input specific content in each index entry according to the actual transaction query requirements to determine the query conditions for the transaction to be queried.

[0292] For example, when the target object wants to query all resource transfer transactions of the blockchain address "Xxxxx123", the index entries corresponding to the index data sub-library with the transaction type of resource transfer are from and to. At this time, the target object will enter the content "Xxxxx123" in the content editing area corresponding to the index entry from; and keep the content editing area corresponding to the index entry to empty.

[0293] When this embodiment is implemented, the corresponding relationship between the sub-address and the sub-index is extracted from the transaction query request.

[0294] In step 1420, multiple query conditions are assembled based on the content and index entries.

[0295] In the specific implementation of this embodiment, according to the correspondence between the content input by the target object and the index items, the content and index items with the corresponding relationship are combined, and each combined index item and content is used as a query condition.

[0296] For example, the correspondence between the target object input content and the index entry is: "Xxxxx123" and "from" in one group; "Xxxxx123" and "to" in another group. For the above two groups of correspondence, two query conditions can be generated. Specifically, the query conditions include: query condition 1 "from Xxxxx123", which means querying all resource transfer-out transactions of the blockchain address "Xxxxx123"; query condition 2 "to kkk73", which means querying all resource transfer-in transactions of the blockchain address "kkk73".

[0297] In step 1430, a target index is determined based on the logical operation relationship of multiple query conditions.

[0298] The logical operation relationship refers to an association relationship generated based on a logical operator, where the logical operators include but are not limited to and, or, and not.

[0299] The target index is a conditional relational expression formed by combining multiple query conditions according to a logical operation relationship.

[0300] In the specific implementation of this embodiment, the logical operation relationship of multiple query conditions is determined according to the blockchain transaction query request. Then, according to the logical operation relationship of the multiple query conditions, the multiple query conditions are combined to obtain the target index.

[0301] For example, the logical operation relationship between query condition 1 "from Xxxxx123" and query condition 2 "to kkk73" is and, then the target index is "from Xxxxx123" and "to kkk73", which means querying all resource transfer transactions from blockchain address "Xxxxx123" to blockchain address "kkk73".

[0302] Through the above steps 1410-1430, the embodiment of the present disclosure adds multiple contents to the index entry under the same blockchain transaction query request, and generates multiple query conditions according to the correspondence between the contents and the index entries, and determines the target index based on the logical operation relationship of the multiple query conditions. The target index is used to perform transaction query, and multiple transaction queries can be implemented based on one blockchain transaction query request, thereby improving the scalability and efficiency of transaction query.

[0303] Detailed description of step 340

[0304] In step 340, in the target index database sub-library, the transaction corresponding to the target index is obtained as the search result.

[0305] Please refer to Fig.15 In some embodiments, the process of obtaining the transaction corresponding to the target index as the search result includes but is not limited to the following steps 1510-1520:

[0306] Step 1510: In the target index database sub-library, compare the target index with multiple indexes;

[0307] Step 1520: extract transactions corresponding to the index consistent with the target index as search results.

[0308] Steps 1510-1520 are described in detail below.

[0309] In step 1510, in the target index database sub-library, the target index is compared with multiple indexes.

[0310] When this embodiment is specifically implemented, in the target index data sub-library, the index of each transaction in the target index data sub-library is compared with the target index.

[0311] In step 1520, transactions corresponding to the index consistent with the target index are extracted as search results.

[0312] In the specific implementation of this embodiment, the transaction whose index is consistent with the target index is taken as the transaction corresponding to the target index. Then, the multiple transactions corresponding to the target index are taken as the search results.

[0313] For example, if the target index is "from kkk73", Fig.12 The target index database of the target index database is traversed, and the row information with the index entry "from" and the blockchain address "kkk73" is extracted, and the search results are determined based on the row information. Based on this, the search results include "from kkk73, to Yy14, 70" and "from kkk73, to Xxxxx123, 10".

[0314] Through the above steps 1510-1520, the embodiment of the present disclosure compares the target index and multiple indexes in the target index data sub-library, uses the target index and the index to perform traversal query, and thus uses the transaction corresponding to the index consistent with the target index as the search result, which can effectively improve the query speed.

[0315] In actual transaction query scenarios, it is often necessary to query transactions within a certain time period. If, in each transaction query process, only a series of transactions of the same transaction type are provided to the target object and the target object filters them by itself, the transaction query timeliness is often not high. Based on this, the embodiment of the present disclosure provides a solution for transaction filtering based on transaction timestamps, which can improve the accuracy of transaction filtering, make the search results more in line with the actual needs of the target object, and thus improve the transaction query timeliness.

[0316] In the embodiment of the present disclosure, the transaction query request includes a transaction query time interval, and the transaction query time interval is used to limit the generation time range of the transaction to be queried.

[0317] Please refer to Fig.16 In some embodiments, the process of determining search results based on timestamps includes, but is not limited to, the following steps 1610-1630:

[0318] Step 1610: In the target index data sub-database, obtain the transaction corresponding to the target index as the filtered and chained transaction;

[0319] Step 1620: Determine the transaction timestamp of each filtered transaction on the chain;

[0320] Step 1630: Filter and upload transactions whose transaction timestamps are within the transaction query time interval as search results.

[0321] Steps 1610-1630 are described in detail below.

[0322] In step 1610, in the target index data sub-library, the transaction corresponding to the target index is obtained as the filtered on-chain transaction.

[0323] In the specific implementation of this embodiment, the specific implementation process of step 1610 is similar to the specific implementation process of the above steps 1510-1520. The difference is that what is determined in step 1610 is the filtered on-chain transaction, and the filtered on-chain transaction needs to be further filtered; while what is determined in steps 1510-1520 is the final search result, and there is no further screening link. In order to save space, it will not be repeated.

[0324] In step 1620, the transaction timestamp of each filtered on-chain transaction is determined.

[0325] When this embodiment is implemented, the specific implementation process of step 1620 is similar to the specific implementation process of the above step 710. To save space, it will not be repeated.

[0326] In step 1630, the filtered on-chain transactions whose transaction timestamps are within the transaction query time interval are used as search results.

[0327] In the specific implementation of this embodiment, the start time and the end time are first determined according to the transaction query time interval. Then, for each filtered on-chain transaction, the filtered on-chain transaction whose transaction timestamp is not later than the start time and whose transaction timestamp is not earlier than the end time is taken as the target transaction, and multiple target transactions are determined as search results.

[0328] Through the above steps 1610-1630, the embodiment of the present disclosure performs transaction screening based on transaction timestamps, and feeds back transactions whose transaction timestamps satisfy the transaction query time interval to the target object, which can improve the accuracy of transaction screening, make the search results more in line with the actual needs of the target object, and thus improve the timeliness of transaction queries.

[0329] Detailed description of generating index rules according to an embodiment of the present disclosure

[0330] In the actual transaction search process, the transaction query requirements are diverse. In order to cope with different transaction query requirements, the disclosed embodiment provides a method for defining index rules in a programming manner. When each index rule is deployed to the index server, the index server will automatically execute the policy defined in the index rule and provide a corresponding query interface to the outside. Therefore, the index server can support the deployment of multiple different index rules, and can effectively improve the scalability of the index service without the need to upgrade the index server or use multiple index servers to support multiple index rules.

[0331] In the disclosed embodiment, the indexing rules are generated by the service management end and deployed to the indexing service end.

[0332] Please refer to Fig.17 In some embodiments, the process of generating index rules by the service management terminal includes but is not limited to the following steps 1710-1730:

[0333] Step 1710: display a first content page, where the first content page has an editing area;

[0334] Step 1720: for each transaction type, determine an index rule corresponding to the transaction type based on multiple policy configuration parameters received in the editing area;

[0335] Step 1730: deploy the indexing rules to the indexing server.

[0336] Steps 1710-1730 are described in detail below.

[0337] In step 1710 , a first content page is displayed, the first content page having an editing area.

[0338] The editing area of ​​the first content page is used to provide a place for relevant personnel to input specific content of the indexing rule.

[0339] In the specific implementation of this embodiment, when it is necessary to expand the query service that the index server can provide, the relevant personnel will often trigger the index rule construction process of the service management end through interaction with the service management end. After the index rule process of the service management end is triggered, the service management end will display the first content page and provide an editing area through the first content page so that the relevant personnel can enter the specific content of the index rule.

[0340] In step 1720, for each transaction type, an index rule corresponding to the transaction type is determined based on a plurality of policy configuration parameters received in the editing area.

[0341] Policy configuration parameters refer to the specific parameter information of index rules.

[0342] In the specific implementation of this embodiment, after the first content page is displayed, the relevant personnel will enter the specific content of the index rule in the editing area, and the specific content entered can be used as the policy configuration parameter. The service management end forms the index rule by combining and sorting multiple policy configuration parameters.

[0343] In step 1730, the indexing rules are deployed to the indexing server.

[0344] When this embodiment is implemented, the service management end may deploy the indexing rules to the indexing service end through a relevant transmission protocol.

[0345] Through the above steps 1710-1730, the embodiment of the present disclosure provides a method for defining index rules in a programming manner, so that the specific content of the index rules can be entered on the first content page of the service management terminal, and then the service management terminal determines the index rules based on multiple policy configuration parameters received in the editing area, and deploys the index rules to the index server, thereby expanding the query function of the index server, and supporting multiple index rules without upgrading the index server or using multiple index servers, effectively improving the scalability of the index service.

[0346] Since index rules often involve multi-dimensional policy content such as what data to extract, how to process data, store data, and what kind of query interface to provide, etc. If only one editing area is provided for all policy contents, it is often not conducive to checking and modifying the input content, which will cause low accuracy of index rules. Based on this, the embodiment of the present disclosure provides a policy configuration scheme based on multiple editing areas, which can provide different editing areas for different policy contents, so as to edit and modify the policy contents and improve the editing accuracy of index rules.

[0347] In the embodiment of the present disclosure, the editing area includes a plurality of editing sub-areas. The indexing rules include transaction information to be recorded on the chain, transaction processing strategy information, and interface deployment strategy information.

[0348] The transaction information to be recorded on the chain is used to indicate the transaction that should be recorded on the index server and the transaction type of the transaction.

[0349] The transaction processing strategy information is used to indicate the specific processing method and storage method of the transaction.

[0350] The interface deployment strategy information is used to indicate the interface function and interface form of the interface to be deployed.

[0351] Please refer to Fig.18 , Figure 19A-19BIn some embodiments, based on the multiple policy configuration parameters received in the editing area, the process of determining the indexing rule includes but is not limited to the following steps 1810-1840:

[0352] Step 1810: Determine the transaction information to be recorded on the chain based on the policy configuration parameters received on the edit sub-area corresponding to the transaction information to be recorded on the chain;

[0353] Step 1820: Determine the transaction processing policy information based on the policy configuration parameters received on the editing sub-area corresponding to the transaction processing policy information;

[0354] Step 1830: Determine the interface deployment policy information based on the policy configuration parameters received on the edit sub-area corresponding to the interface deployment policy information;

[0355] Step 1840: Integrate the transaction information to be recorded on the chain, the transaction processing strategy information, and the interface deployment strategy information into index rules.

[0356] Steps 1810-1840 are described in detail below.

[0357] In step 1810, the policy configuration parameters received on the editing sub-area corresponding to the transaction processing policy information are used as the transaction processing policy information.

[0358] In step 1820, the policy configuration parameters received in the editing sub-area corresponding to the interface deployment policy information are used as the interface deployment policy information.

[0359] In step 1830, the policy configuration parameters received in the edit sub-area corresponding to the transaction information to be recorded on the chain are used as the transaction information to be recorded on the chain.

[0360] In step 1840, the transaction information to be recorded on the chain, the transaction processing strategy information, and the interface deployment strategy information are integrated into index rules according to the logical order.

[0361] For example, when you want to obtain all resource transfer records of an object B under a smart contract A, if you directly obtain the resource transfer records from the blockchain, you need to traverse multiple blocks, which will consume a lot of time. Therefore, an index rule is defined on the index server to record all resource transfer records of object B and provide an efficient query service. Based on this, since a smart contract will generate a resource transfer transaction every time a resource transfer is performed, the resource transfer transaction can be expressed as event Transfer(address indexed_from, addressindexed_to, uint256_value). At this time, for this query requirement, the index rule is "starting from a certain block height, extract all resource transfer transactions of smart contract A on the blockchain. After extracting the resource transfer transaction, store the query index from, to, and value in the relational mapping table of the relational database, and record the transaction association information of each resource transfer transaction in the relational mapping table. Further, a resource transfer transaction query interface is displayed to the outside, and it is specified that the resource transfer transaction query interface can query the required resource transfer transaction by specifying the blockchain address associated with from or the blockchain address associated with t".

[0362] like Fig.19A As shown, the service management system of the service management end displays a first content page, which is the interface corresponding to the index rule construction process. In the first content page, three sub-editing areas are displayed, which are the editing sub-area corresponding to the "on-chain transaction information to be recorded", the editing sub-area corresponding to the "transaction processing strategy", and the editing sub-area corresponding to the "interface deployment strategy information". At this time, the relevant personnel enter "record resource transfer address, resource transfer address, and transfer resource amount" in the editing sub-area corresponding to the "transaction processing strategy", enter "resource transfer transaction generated by contract M" in the editing sub-area corresponding to the "on-chain transaction information to be recorded", and enter "new resource transfer query interface, limit the query condition to condition 1" in the editing sub-area corresponding to the "interface deployment strategy information". Based on this, the relevant personnel click the "OK" button to determine the predetermined index strategy as "for the resource transfer transaction generated by contract M, record the resource transfer address, resource transfer address, and transfer resource amount, and add a new resource transfer query interface, and limit the query condition to condition 1".

[0363] like Fig.19BAs shown, after the relevant personnel clicks the "OK" button, the service management system will determine the index rules based on the multiple policy configuration parameters received, and display a prompt window on the first content page. The prompt window displays a prompt field "Hint: Index rules have been generated, do you want to deploy them to the index server?", as well as "Yes" and "No" buttons. At this time, the relevant personnel clicks "Yes" to deploy the index rules to the index server, so that the index server performs transaction processing and interface creation according to the index rules.

[0364] Through the above steps 1810-1840, the embodiment of the present disclosure performs policy configuration based on multiple editing areas, and provides different editing areas for different policy contents, so as to edit and modify the policy contents, thereby improving the editing accuracy of the index rules.

[0365] Detailed description of query interface deployment by index service according to an embodiment of the present disclosure

[0366] Different query interfaces on the index server generally implement different query services. For example, the resource transfer query interface is generally used to query resource transfer transactions, while the identity authentication interface is generally used to query identity information. If one query interface is used to provide query services to the outside, there is often a high possibility of errors in the query process. Based on this, the embodiment of the present disclosure provides a solution for deploying query interfaces based on different predetermined index strategies, so that each query interface can independently provide query services to the outside, which can reduce the probability of query errors.

[0367] Please refer to Fig. 20 , Fig.21 In one embodiment, after recording multiple transactions on the blockchain according to a predetermined indexing strategy, the blockchain transaction search method further includes but is not limited to the following steps 2010-2020:

[0368] Step 2010: The index server determines the interface deployment information based on the index rule;

[0369] Step 2020: Deploy candidate query interfaces based on the interface deployment information.

[0370] Steps 2010-2020 are described in detail below.

[0371] In step 2010, the indexing server determines the interface deployment information based on the indexing rule.

[0372] The interface deployment information is used to indicate the data format, transmission protocol, implemented query functions, etc. of the query interface.

[0373] In the specific implementation of this embodiment, the index server extracts the set interface deployment information from the index rule, wherein the interface deployment information can be expressed as a code program.

[0374] In step 2020, candidate query interfaces are deployed based on the interface deployment information.

[0375] In the specific implementation of this embodiment, a preset framework is used to create and deploy a candidate query interface according to the code segment in the interface deployment information. The preset framework includes but is not limited to Flask, Django or Pyramid.

[0376] like Fig.21 As shown, based on different indexing rules, the indexing server 130 externally deploys three candidate query interfaces, wherein the candidate query interfaces are a resource transfer query interface for querying resource transfer transactions recorded on the blockchain, a contract query interface for querying smart contracts recorded on the blockchain, and an object identity information query interface for querying object identity information recorded on the blockchain.

[0377] Through the above steps 2010-2020, the embodiment of the present disclosure determines the interface deployment information based on the index rules, and deploys the candidate query interface according to the interface deployment information, so as to implement the corresponding query service by using the candidate query interface, and implements the deployment of query interfaces based on different index rules, so that each query interface can independently provide query services to the outside world, which can reduce the probability of query errors.

[0378] When there are multiple candidate query interfaces, different candidate query interfaces generally provide different query services. If a transaction query request is randomly input into a candidate query interface, it is often impossible to query or the query reports an error, which will reduce the reliability of the transaction query. Based on this, a query interface screening solution is provided in the embodiment of the present disclosure, which can input the transaction query request into a query interface that meets the requirements, thereby improving the reliability of the transaction query.

[0379] Please refer to Fig. 22 In one embodiment, the process of sending a blockchain transaction query request of a target object by the object terminal includes but is not limited to the following steps 2210-2220:

[0380] Step 2210: determining a target query interface from a plurality of candidate query interfaces;

[0381] Step 2220: Send the blockchain transaction query request to the index server through the target query interface.

[0382] Steps 2210-2220 are described in detail below.

[0383] In step 2210, the query function of each candidate query interface is first determined. Then, based on the query function, a candidate query interface that meets the transaction query requirement is selected as a target query interface.

[0384] In step 2220, the object terminal can directly send the blockchain transaction query request to the index server through the target query interface.

[0385] Through the above steps 2210-2220, in the embodiment of the present disclosure, the object terminal can determine the target query interface from multiple candidate query interfaces based on the query service provided by the candidate query interface, and send the blockchain transaction query request to the index server through the target query interface, and can input the blockchain transaction query request into the query interface that meets the requirements, thereby reducing the possibility of being unable to query or querying errors, thereby improving the reliability of transaction queries.

[0386] Detailed description of the implementation details of the blockchain transaction search method of the present disclosure embodiment

[0387] Refer to the following Fig.23 , details a specific implementation process of the blockchain transaction search method of the embodiment of the present disclosure, which process includes but is not limited to the following steps 2301 to 2312.

[0388] Step 2301: the service management terminal 120 deploys the generated predetermined indexing rules to the indexing service 130;

[0389] Step 2302: The indexing service 130 determines, for each transaction type, a transaction signature and an associated blockchain address of the transaction based on the indexing rule corresponding to the transaction type;

[0390] Step 2303, the indexing service 130 determines the transaction recorded on the blockchain network 150 based on the transaction signature and the associated blockchain address starting from the predetermined block height;

[0391] Step 2304, index service 1302304. Add an index to the transaction, and form an index data sub-library in index database 160 based on the transaction to which the index is added;

[0392] Step 2305: The indexing service 130 determines the interface deployment information based on the indexing rule;

[0393] Step 2306: The indexing service 130 deploys a candidate query interface based on the interface deployment information;

[0394] Step 2307: The object sends a blockchain transaction query request to the query interface of the index service 130 through the object terminal 140;

[0395] Step 2308: The index service 130 determines the target index data sub-database in the index database;

[0396] Step 2309: read and write the index entries corresponding to the target index data sub-library to the target;

[0397] Step 2310, the object specifies a target index for the index entry;

[0398] Step 2311: The index service 130 obtains the transaction corresponding to the target index in the target index database as a search result;

[0399] Step 2312: Indexing service 130 2312. Feeds the search results back to the target object.

[0400] It can be understood that the specific process of step 2301 is similar to the specific process of steps 1710-1730 in the above embodiment. The specific process of step 2302 is similar to the specific process of step 410 in the above embodiment. The specific process of step 2303 is similar to the specific process of step 420 in the above embodiment. The specific process of step 2304 is similar to the specific process of step 440 in the above embodiment. The specific process of steps 2305-2306 is similar to the specific process of steps 2010-2020 in the above embodiment. The specific process of step 2307 is similar to the specific process of step 310 in the above embodiment. The specific process of steps 2308-2310 is similar to the specific process of steps 320-330 in the above embodiment. The specific process of steps 2311-2312 is similar to the specific process of step 340 in the above embodiment. In order to save space, it will not be repeated here.

[0401] Description of the apparatus and device of the present disclosure

[0402] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0403] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.

[0404] Fig.24 A schematic diagram of the structure of a blockchain transaction search device 2400 provided in an embodiment of the present disclosure. The blockchain transaction search device 2400 includes:

[0405] A receiving unit 2410 is configured to receive a blockchain transaction query request of a target object, where the blockchain transaction query request includes a target transaction type of the transaction to be queried;

[0406] The determining unit 2420 is configured to determine, in the index database, a target index data sub-library corresponding to the target transaction type, wherein the index database includes a plurality of index data sub-libraries corresponding to a plurality of transaction types, and the index data sub-library corresponding to each transaction type is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to an index rule specific to the transaction type;

[0407] Display unit 2430, used to display the index entry corresponding to the target index data sub-library, and receive the target index specified by the target object as the index entry;

[0408] The acquisition unit 2440 is used to acquire the transaction corresponding to the target index in the target index data sub-library as the search result.

[0409] Optionally, the index data sub-library corresponding to each transaction type is generated in the following way:

[0410] Based on the index rules corresponding to the transaction type, determine the transaction signature and the associated blockchain address of the transaction;

[0411] For each transaction type, starting from a predetermined block height, determine the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address;

[0412] Add indexes to the searched transactions according to the indexing rules specific to the transaction type;

[0413] Based on multiple transactions for adding indexes, generate index data sub-databases corresponding to the transaction types.

[0414] Optionally, the transaction signature is generated by:

[0415] For each transaction, determine the transaction type and the transaction parameter type associated with the transaction;

[0416] Perform a digest operation on the concatenation result of the transaction type and the transaction parameter type to obtain a digest result;

[0417] The digest result is determined as the transaction signature of the transaction.

[0418] Optionally, determining a transaction recorded on a blockchain based on a transaction signature and an associated blockchain address includes:

[0419] Starting from a predetermined block height, multiple candidate transactions recorded on the blockchain are determined;

[0420] For each candidate on-chain transaction, determine the first transaction signature and the first blockchain address of the candidate on-chain transaction;

[0421] Based on the comparison between the first transaction signature and the transaction signature, and the comparison between the first blockchain address and the associated blockchain address, a transaction is determined from multiple candidate on-chain transactions.

[0422] Optionally, based on the comparison of the first transaction signature with the transaction signature and the comparison of the first blockchain address with the associated blockchain address, determining the transaction from multiple candidate on-chain transactions includes:

[0423] Integrate the candidate on-chain transactions that have the same first transaction signature as the transaction signature into a first transaction set;

[0424] Integrate the candidate on-chain transactions that have the same first blockchain address as the associated blockchain address into a second transaction set;

[0425] The candidate on-chain transactions included in both the first transaction set and the second transaction set are determined as transactions.

[0426] Optionally, the predetermined block height is determined by:

[0427] Determining transaction timestamps of multiple transactions with transaction signatures in a blockchain;

[0428] Determine the target block where the transaction with the earliest transaction timestamp is located;

[0429] The block height of the target block is determined as the predetermined block height.

[0430] Optionally, the index rule includes a first index, a second index, and a resource identifier; the transaction association information of the transaction includes a first address associated with the first index, a second address associated with the second index, and an associated resource of the transaction;

[0431] Based on multiple index-added transactions, generate index data sub-databases corresponding to the transaction types, including:

[0432] Based on the first index, storing the first address to a first position of the index data sub-library, wherein the first position is a position indicated by an index consistent with the first index;

[0433] Based on the second index, storing the second address in a second position of the index data sub-library, wherein the second position is a position indicated by an index consistent with the second index;

[0434] Based on the resource identifier, the associated resource is stored in a third position of the index data sub-library, wherein the third position is a position indicated by an index that is consistent with the resource identifier.

[0435] Optionally, the blockchain transaction search device 2400 further includes a resource accumulation unit (not shown), and the resource accumulation unit (not shown) is used to:

[0436] Based on the first address associated with the first index, performing resource accumulation on the associated resources pointed to by the first address associated with the first index;

[0437] Based on the second address associated with the second index, resources are accumulated for associated resources pointed to by the second address associated with the second index.

[0438] Optionally, the acquisition unit 2440 is specifically configured to:

[0439] In the target index data sub-database, compare the target index with multiple indexes;

[0440] The transactions corresponding to the index consistent with the target index are extracted as search results.

[0441] Optionally, the determining unit 2420 is specifically configured to:

[0442] For each index data sub-database, compare the transaction type of the index data sub-database with the target transaction type;

[0443] The index data sub-library whose transaction type is consistent with the target transaction type is determined as the target index data sub-library.

[0444] Optionally, the index entry has multiple content editing areas;

[0445] The target index is specified in the following way:

[0446] Receiving content determined by the target object in each content editing area;

[0447] Assemble multiple query conditions based on content and index entries;

[0448] Determine the target index based on the logical operation relationship of multiple query conditions.

[0449] Optionally, the blockchain transaction query request includes a transaction query time interval;

[0450] The acquisition unit 2440 is specifically used for:

[0451] In the target index data sub-database, obtain the transaction corresponding to the target index as the filtered and chained transaction;

[0452] Determine the transaction timestamp of each filtered transaction on the chain;

[0453] The filtered on-chain transactions whose transaction timestamps are within the transaction query time interval are used as search results.

[0454] Optionally, the indexing rules are deployed by the service manager to the indexing server in the following ways:

[0455] Displaying a first content page, the first content page having an editing area;

[0456] For each transaction type, based on a plurality of policy configuration parameters received in the editing area, determine an index rule corresponding to the transaction type;

[0457] Deploy indexing rules to the indexing server.

[0458] Optionally, the index rule includes transaction information to be recorded on the chain, transaction processing strategy information, and interface deployment strategy information; the editing area includes multiple editing sub-areas;

[0459] Based on multiple policy configuration parameters received in the editing area, indexing rules are determined, including:

[0460] Determine the transaction information to be recorded on the chain based on the policy configuration parameters received on the editing sub-area corresponding to the transaction information to be recorded on the chain;

[0461] Determining the transaction processing policy information based on the policy configuration parameters received on the editing sub-area corresponding to the transaction processing policy information;

[0462] Determining the interface deployment policy information based on the policy configuration parameters received on the editing sub-area corresponding to the interface deployment policy information;

[0463] Integrate the transaction information to be recorded on the chain, transaction processing strategy information, and interface deployment strategy information into index rules.

[0464] Optionally, the blockchain transaction search device 2400 further includes an interface generation unit (not shown), and the interface generation unit (not shown) is used to:

[0465] The index server determines the interface deployment information based on the index rules;

[0466] Based on the interface deployment information, a candidate query interface is deployed, where the candidate query interface is used to receive blockchain transaction query requests.

[0467] Optionally, the blockchain transaction query request of the target object is sent by the object terminal in the following manner:

[0468] Determine a target query interface from multiple candidate query interfaces;

[0469] The blockchain transaction query request is sent to the index server through the target query interface.

[0470] Reference Fig.25 , Fig.25 The structural block diagram of the terminal part of the blockchain transaction search method for implementing the embodiment of the present disclosure includes: Radio Frequency (RF) circuit 2510, memory 2515, input unit 2530, display unit 2540, sensor 2550, audio circuit 2560, wireless fidelity (WiFi) module 2570, processor 2580, and power supply 2590. Those skilled in the art can understand that Fig.25 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0471] RF circuit 2510 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to processor 2580 for processing; in addition, the designed uplink data is sent to the base station.

[0472] The memory 2515 may be used to store software programs and modules. The processor 2580 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 2515 .

[0473] The input unit 2530 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 2530 may include a touch panel 2531 and other input devices 2532.

[0474] The display unit 2540 may be used to display input information or provided information and various menus of the target terminal. The display unit 2540 may include a display panel 2541.

[0475] The audio circuit 2560, the speaker 2561, and the microphone 2562 can provide an audio interface.

[0476] In this embodiment, the processor 2580 included in the terminal can execute the blockchain transaction search method of the previous embodiment.

[0477] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.

[0478] Fig.26 A block diagram of the structure of a portion of a server for implementing the blockchain transaction search method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 2622 (e.g., one or more processors) and memory 2632, and one or more storage media 2130 (e.g., one or more mass storage devices) storing application programs 2642 or data 2644. Among them, the memory 2632 and the storage medium 2630 may be short-term storage or permanent storage. The program stored in the storage medium 2630 may include one or more modules (not shown in the figure), each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 2622 may be configured to communicate with the storage medium 2630 and execute a series of instruction operations in the storage medium 2630 on the server.

[0479] The server may also include one or more power supplies 2626, one or more wired or wireless network interfaces 2650, one or more input and output interfaces 2658, and / or one or more operating systems 2641, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0480] The central processor 2622 in the server can be used to execute the blockchain transaction search method of the embodiment of the present disclosure.

[0481] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store program code, and the program code is used to execute the blockchain transaction search method of each of the aforementioned embodiments.

[0482] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned transaction on-chain.

[0483] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0484] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0485] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.

[0486] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0487] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple 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.

[0488] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0489] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0490] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.

[0491] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A blockchain transaction search method, characterized in that: The method comprises: Receive a blockchain transaction query request of a target object, wherein the blockchain transaction query request includes a target transaction type of the transaction to be queried; In an index database, determining a target index data sub-library corresponding to the target transaction type, wherein the index database includes a plurality of index data sub-libraries corresponding to a plurality of transaction types, and the index data sub-library corresponding to each of the transaction types is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to an index rule specific to the transaction type; Displaying the index entry corresponding to the target index data sub-library, and receiving the target index specified by the target object for the index entry; In the target index database sub-library, the transaction corresponding to the target index is obtained as a search result.

2. The method according to claim 1, characterized in that The index data sub-library corresponding to each transaction type is generated in the following manner: Determine a transaction signature and an associated blockchain address of the transaction based on an index rule corresponding to the transaction type; For each of the transaction types, starting from a predetermined block height, determining the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address; Adding an index to the searched transaction according to an index rule specific to the transaction type; Based on the multiple transactions to which the index is added, the index data sub-library corresponding to the transaction type is generated.

3. The method according to claim 2, characterized in that The transaction signature is generated in the following way: For each of the transactions, determining a transaction type of the transaction and a transaction parameter type associated with the transaction; Performing a digest operation on the concatenation result of the transaction type and the transaction parameter type to obtain a digest result; The digest result is determined as the transaction signature of the transaction.

4. The method according to claim 2, characterized in that: The determining the transaction recorded on the blockchain based on the transaction signature and the associated blockchain address comprises: Starting from the predetermined block height, determining a plurality of candidate on-chain transactions recorded on the blockchain; For each of the candidate on-chain transactions, determine a first transaction signature and a first blockchain address of the candidate on-chain transaction; Based on the comparison between the first transaction signature and the transaction signature, and the comparison between the first blockchain address and the associated blockchain address, the transaction is determined from the multiple candidate on-chain transactions.

5. The method according to claim 4, characterized in that The determining the transaction from the plurality of candidate on-chain transactions based on the comparison of the first transaction signature with the transaction signature and the comparison of the first blockchain address with the associated blockchain address includes: Integrate the candidate on-chain transactions that have the first transaction signature consistent with the transaction signature into a first transaction set; Integrate the candidate on-chain transactions that are consistent with the first blockchain address and the associated blockchain address into a second transaction set; The candidate on-chain transactions included in both the first transaction set and the second transaction set are determined as the transactions.

6. The method according to claim 2, characterized in that The predetermined block height is determined by: determining, in the blockchain, transaction timestamps of a plurality of the transactions having the transaction signatures; Determine the target block where the transaction with the earliest transaction timestamp is located; The block height of the target block is determined as the predetermined block height.

7. The method according to claim 2, characterized in that The index rule includes a first index, a second index, and a resource identifier; the transaction association information of the transaction includes a first address associated with the first index, a second address associated with the second index, and an associated resource of the transaction; The generating the index data sub-library corresponding to the transaction type based on the multiple transactions with added indexes includes: Based on the first index, storing the first address to a first position of the index data sub-library, wherein the first position is a position indicated by the index that is consistent with the first index; Based on the second index, storing the second address to a second position of the index data sub-library, wherein the second position is a position indicated by the index that is consistent with the second index; Based on the resource identifier, the associated resource is stored in a third location of the index data sub-library, wherein the third location is a location indicated by the index that is consistent with the resource identifier.

8. The method according to claim 7, characterized in that After generating the index data sub-library corresponding to the transaction type based on the transactions with multiple added indexes, the method further includes: Based on the first address associated with the first index, performing resource accumulation on the associated resource pointed to by the first address associated with the first index; Based on the second address associated with the second index, resource accumulation is performed on the associated resource pointed to by the second address associated with the second index.

9. The method according to claim 1, characterized in that: The acquiring, in the target index database sub-library, the transaction corresponding to the target index as a search result includes: In the target index database sub-library, comparing the target index with a plurality of the indexes; The transaction corresponding to the index consistent with the target index is extracted as a search result.

10. The method according to claim 1, characterized in that The step of determining, in the index database, a target index data sub-library corresponding to the target transaction type comprises: For each of the index data sub-libraries, comparing the transaction type of the index data sub-library with the target transaction type; The index data sub-library whose transaction type is consistent with the target transaction type is determined as the target index data sub-library.

11. The method according to claim 1, characterized in that The index entry has a plurality of content editing areas; The target index is specified in the following way: Receiving the content determined by the target object in each of the content editing areas; Assembling a plurality of query conditions based on the content and the index entries; The target index is determined based on a logical operation relationship of a plurality of the query conditions.

12. The method according to claim 1, characterized in that The blockchain transaction query request includes a transaction query time interval; The acquiring, in the target index database sub-library, the transaction corresponding to the target index as a search result includes: In the target index data sub-database, the transaction corresponding to the target index is obtained as the filtered and on-chain transaction; Determine the transaction timestamp of each of the filtered transactions on the chain; The filtered on-chain transactions whose transaction timestamps are within the transaction query time interval are used as the search results.

13. The method according to claim 1, characterized in that The indexing rules are deployed by the service management end to the indexing service end in the following manner: displaying a first content page, the first content page having an editing area; For each of the transaction types, based on a plurality of policy configuration parameters received in the editing area, determining the index rule corresponding to the transaction type; Deploy the indexing rules to the indexing server.

14. The method according to claim 13, characterized in that The index rules include transaction information to be recorded on the chain, transaction processing strategy information, and interface deployment strategy information; The editing area includes a plurality of editing sub-areas; The step of determining the indexing rule based on a plurality of policy configuration parameters received in the editing area comprises: Determine the transaction information to be recorded on the chain based on the policy configuration parameter received on the editing sub-area corresponding to the transaction information to be recorded on the chain; determining the transaction processing policy information based on the policy configuration parameters received on the editing sub-area corresponding to the transaction processing policy information; Determining the interface deployment policy information based on the policy configuration parameters received on the editing sub-area corresponding to the interface deployment policy information; The to-be-recorded on-chain transaction information, transaction processing strategy information, and interface deployment strategy information are integrated into the index rule.

15. The method according to claim 13, characterized in that After the service management end deploys the index rule to the index service end, the method further includes: The index server determines the interface deployment information based on the index rule; Based on the interface deployment information, a candidate query interface is deployed, wherein the candidate query interface is used to receive a blockchain transaction query request.

16. The method according to claim 15, characterized in that The blockchain transaction query request of the target object is sent by the object terminal in the following way: Determine a target query interface from the plurality of candidate query interfaces; The blockchain transaction query request is sent to the index server through the target query interface.

17. A blockchain transaction search device, characterized in that: The device comprises: A receiving unit, configured to receive a blockchain transaction query request from a target object, wherein the blockchain transaction query request includes a target transaction type of a transaction to be queried; a determining unit, configured to determine, in an index database, a target index data sub-library corresponding to the target transaction type, wherein the index database includes a plurality of index data sub-libraries corresponding to a plurality of transaction types, and the index data sub-library corresponding to each of the transaction types is generated by searching for transactions of the transaction type on the blockchain and indexing the searched transactions according to an index rule specific to the transaction type; A display unit, used to display the index entry corresponding to the target index data sub-library, and receive the target index specified by the target object for the index entry; The acquisition unit is used to acquire the transaction corresponding to the target index as a search result in the target index data sub-library.

18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the blockchain transaction search method described in any one of claims 1 to 16 is implemented.

19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the blockchain transaction search method described in any one of claims 1 to 16 is implemented.

20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain transaction search method described in any one of claims 1 to 16.