CN116089463A - Full text searching method and device in block chain - Google Patents

Full text searching method and device in block chain Download PDF

Info

Publication number
CN116089463A
CN116089463A CN202211738172.XA CN202211738172A CN116089463A CN 116089463 A CN116089463 A CN 116089463A CN 202211738172 A CN202211738172 A CN 202211738172A CN 116089463 A CN116089463 A CN 116089463A
Authority
CN
China
Prior art keywords
data
service
business
transaction
block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211738172.XA
Other languages
Chinese (zh)
Inventor
印明亮
余珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202211738172.XA priority Critical patent/CN116089463A/en
Publication of CN116089463A publication Critical patent/CN116089463A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The embodiment of the specification provides a full text searching method and device in a blockchain, which are applied to a service program deployed on a blockchain service platform; comprising the following steps: acquiring a service model configured for each block of the blockchain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data; respectively carrying out data analysis on transaction data stored in each block of the block chain based on the acquired service model, and establishing a query index for the service data obtained by the data analysis; and sending the business data with the established query index to a full-text search engine which is in butt joint with the blockchain service platform, so that the full-text search engine executes data query on the business data based on the query index.

Description

Full text searching method and device in block chain
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a full text searching method and device in a block chain.
Background
Blockchains are a decentralized, distributed ledger that does not require trust from a third party. The blockchain technology has the characteristics of multiparty writing, transparent disclosure, non-falsification and the like. Blockchains can be categorized into public chains, alliance chains, and private chains, depending on the admission mechanism. For the public chain, any node may join the blockchain network. The alliance chain has an access control function, and only authorized nodes can join the alliance chain network, so that the alliance chain is more safe and efficient than a public chain network, and is mainly used for mutual cooperation among enterprises or institutions.
In practical applications, as the blockchain accumulates data during operation, more and more business parties begin to search for data on the blockchain. Therefore, how to use the existing data searching capability to perform data searching on the data continuously accumulated on the blockchain according to the service requirement of the service party is a problem to be solved in the blockchain field.
Disclosure of Invention
One or more embodiments of the present disclosure provide the following technical solutions:
the specification provides a full text searching method in a blockchain, which is applied to a service program deployed on a blockchain service platform; comprising the following steps:
Acquiring a service model configured for each block of the blockchain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
respectively carrying out data analysis on transaction data stored in each block of the block chain based on the acquired service model to obtain service data with service semantics contained in the transaction data, and establishing a query index for the service data obtained by data analysis;
and sending the business data with the established query index to a full-text search engine which is in butt joint with the blockchain service platform, so that the full-text search engine responds to a data query request for the business data triggered by a data query party, and executes data query for the business data based on the query index.
The specification also provides a full text searching device in the blockchain, which is applied to a service program deployed on a blockchain service platform; comprising the following steps:
the acquisition module acquires a service model configured for each block of the block chain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
The analysis module is used for respectively carrying out data analysis on transaction data stored in each block of the block chain based on the acquired service model so as to obtain service data with service semantics contained in the transaction data, and establishing a query index for the service data obtained by data analysis;
and the sending module is used for sending the business data with the built query index to a full-text search engine which is in butt joint with the blockchain service platform, so that the full-text search engine responds to a data query request which is triggered by a data query party and aims at the business data, and data query is executed on the basis of the query index.
The specification also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory stores machine readable instructions, and the processor performs the method of any of the above by invoking the machine readable instructions.
The present specification also provides a machine-readable storage medium storing machine-readable instructions which, when invoked and executed by a processor, implement a method as claimed in any one of the preceding claims.
In the above technical solution, on one hand, after the service requirement, a service model may be configured for the related block, and the service model is adopted to analyze the transaction data stored in each block to obtain the service data with service semantics, so as to complete the service search on the data on the chain, thereby making the whole searching mode more flexible.
On the other hand, the full-text search engine can be utilized to search the full text of the service data with specific semantics contained in the original data in real time according to the content of the data on the basis of the complete original data stored on the blockchain, and the data query party does not need to intervene in the data uplink stage to perform data transfer on the service data stored in each block of the blockchain, so that the complexity of searching the service data with the service semantics stored in each block of the blockchain can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a grid pattern illustrating a full text search for business data stored in a blockchain in accordance with an exemplary embodiment of the present description;
FIG. 2 is another networking architecture diagram illustrating a full text search for business data stored in a blockchain in accordance with an exemplary embodiment of the present description;
FIG. 3 is another networking architecture diagram illustrating a full text search for business data stored in a blockchain in accordance with an exemplary embodiment of the present description;
FIG. 4 is a flowchart illustrating a method of full text searching in a blockchain according to an exemplary embodiment of the present description;
FIG. 5 is a schematic diagram illustrating one method of creating a query index for business data according to an exemplary embodiment of the present disclosure;
FIG. 6 is a schematic block diagram of an electronic device shown in accordance with an exemplary embodiment of the present disclosure;
FIG. 7 is a block diagram of a consensus node in a blockchain system as illustrated in accordance with an exemplary embodiment of the present description.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with aspects of one or more embodiments of the present description as detailed in the accompanying claims.
It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than described in this specification. Furthermore, individual steps described in this specification, in other embodiments, may be described as being split into multiple steps; while various steps described in this specification may be combined into a single step in other embodiments.
In a public chain, a search for information on the chain, account address, contract address, etc., and a query for associated transactions may typically be provided. For example, a search engine such as the public chain Blockchair, amberdata, etherscan may provide search functions for on-chain block Hash, transaction Hash, account address, smart contract entry and exit.
In the alliance chain, because the data on the chain is more complex than the public chain, the data on the chain has stronger business semantics, the privacy requirement of the alliance chain on the uplink data is higher, and the visibility requirement of the data with the business semantics on the chain among different alliance members usually has certain difference. This results in some public-link based data search schemes that cannot be directly adapted to federated link environments.
In the related art, in order to perform data search on service data having service semantics included in on-chain data, it is generally possible to intervene in a data uplink stage, extract service data having service semantics stored in each block on the chain, then transfer the extracted service data to a database, and then perform data search on the service data based on the database.
However, by means of data transfer, not only the complexity of searching for service data is increased, but also because the transferred data is not the original full-size data, full-text searching for service data with specific semantics contained in the original data according to the content of the data cannot be performed on the basis of the original full-size data directly stored on the blockchain.
In view of this, the present description provides a solution for full text searching for business data stored on a blockchain with business semantics.
When the method is realized, a service program for carrying out data analysis on the data on the chain can be deployed on the block chain service platform; the service program can acquire a service model configured for each block of the block chain when carrying out data analysis on the data on the chain; wherein, each block of the block chain can store business data with business semantics; the business model can be specifically used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
Then, data analysis can be performed on transaction data stored in each block of the block chain based on the acquired service model, so as to obtain service data with service semantics contained in the transaction data, and a query index is established for the service data obtained by the data analysis; and then the service data with the built query index is sent to a full text search engine which is in butt joint with the blockchain service platform. And when the full-text search engine receives a data query request for the service data triggered by a data query party, maliciously responding to the data query request, and executing data query for the service data based on the query index.
In the above technical solution, on one hand, after the service requirement, a service model may be configured for the related block, and the service model is adopted to analyze the transaction data stored in each block to obtain the service data with service semantics, so as to complete the service search on the data on the chain, thereby making the whole searching mode more flexible.
On the other hand, the full-text search engine can be utilized to search the full text of the service data with specific semantics contained in the original data in real time according to the content of the data on the basis of the complete original data stored on the blockchain, and the data query party does not need to intervene in the data uplink stage to perform data transfer on the service data stored in each block of the blockchain, so that the complexity of searching the service data with the service semantics stored in each block of the blockchain can be reduced.
Referring to fig. 1, fig. 1 is a networking architecture diagram illustrating a full text search for traffic data stored in a blockchain according to an exemplary embodiment of the present disclosure.
As shown in fig. 1, the networking architecture may include the following parts:
1: block chain node
A blockchain node for storing and maintaining raw blockdata generated on the blockchain.
2: business model management service
The service model management service, which may be specifically a service program deployed on a blockchain service platform (such as a bias platform), is responsible for managing the service models configured for the blocks of the blockchain, and provides storage and query functions for the service models.
Wherein, each block of the block chain can store business data with business semantics issued by different business parties.
The business model can be used for carrying out data analysis on the transaction data stored in each block of the block chain according to the business semantics to obtain the business data.
For example, business data with business semantics that a business party has on a blockchain typically consists of a number of Key-Value pairs that contain business semantics, which can typically be contained in the "data" field in the transaction, and in the transaction receipt (receipt) that is generated after the transaction execution is successful, and so on. The business model can analyze the transaction data such as transaction and transaction receipt contained in the block according to the business semantics, and restore the Key-Value Key Value pair with the business semantics.
3: data resolution service
The data analysis service (i.e. the data deriving service shown in fig. 1) may be a service program deployed on the blockchain service platform, which is responsible for acquiring original blocks from the block link points in real time, then using a business model managed by the business model management service to perform data analysis on transaction data contained in the original blocks, creating a query index for the business data obtained by the analysis, and then submitting the query index to a full text search engine in butt joint with the blockchain service platform.
For example, in one example, a standardized data export service is typically deployed on a blockchain service platform, where the data export service may be used to export data from and parse the data from the chain; in this case, the data analysis service may be specifically the data export service program.
4: full text search engine
The full text search is to perform global search according to the content of data on the basis of the entire original data without local transfer of the data. The full-text data search engine is particularly responsible for receiving a query request sent by a search console, responding to the query riding business data carrying a query index submitted by the data analysis service, and performing full-text search.
The specific type of the full-text data search engine is not particularly limited in the present specification; for example, in one example, the full text data search engine may specifically employ a search engine such as an elastiscearch search engine.
5: search gateway
The search gateway is responsible for receiving a query request triggered by a data query party on a search console, submitting the query request to a full-text search engine to initiate full-text search, and then sending a query result returned by the full-text search engine to the search console.
6: search console
And the search control console is in charge of receiving a query request triggered by the data querying party, sending the query request to the search gateway, receiving a query result returned by the search gateway, and then presenting the query result to the data querying party through the web page.
It should be noted that, in practical application, the network architecture shown in fig. 1 may also be extended to a network architecture supporting aggregated searching for multiple blockchains.
Referring to fig. 2, fig. 2 is another networking architecture diagram illustrating a full text search for traffic data stored in a blockchain according to an exemplary embodiment of the present disclosure.
In fig. 2, the data derivation service may obtain data from multiple blockchains to perform data analysis, create a query index for the analyzed service data, and write the query index into a search engine to implement data aggregation search of multiple chains.
Referring to fig. 3, fig. 3 is another networking architecture diagram illustrating a full text search for traffic data stored in a blockchain according to an exemplary embodiment of the present disclosure.
In fig. 3, the data aggregation searching of multiple blockchains in different network environments can be realized by aggregating the search results of different search gateways through the search gateway proxy.
Referring to fig. 4, fig. 4 is a flowchart illustrating a method of full text searching in a blockchain according to an exemplary embodiment of the present disclosure, which may be applied to a service program deployed on a blockchain service platform for data parsing of data on the chain; the method comprises the following steps:
step 402, obtaining a service model configured for each block of the blockchain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
the service program for performing data analysis on the data on the chain may specifically be the data analysis service shown in fig. 1. The data analysis service generally refers to a service program having a data analysis capability for in-chain data in terms of functions.
For example, in one example, a standardized data export service is typically deployed on a blockchain service platform, where the data export service may be used to export data from and parse the data from the chain; in this case, the data analysis service may be specifically the data export service program.
Transaction data stored in each block of the blockchain may include business data with business semantics that each business party accessing the blockchain has stored on the blockchain.
In practical applications, the service data with service semantics, which is stored in the blockchain by the service party accessing the blockchain, is generally composed of a plurality of Key-Value pairs containing service semantics, and the Key-Value pairs with service semantics can be generally contained in a "data" field in a transaction, and contained in a transaction receipt (receipt) generated after successful execution of the transaction, and the like.
For example, taking the example of the transaction data being stored by invoking a smart contract, in which case the transaction may be a smart contract invocation transaction, the transaction data may generally include invocation input data (i.e., input parameters at the time of initiating a contract invocation) contained in a "data" field (i.e., transaction payload) of the smart contract invocation transaction, smart contract execution results contained in a transaction receipt, and smart contract events generated after the smart contract invocation contained in the transaction receipt is completed.
As another example, the transaction may be a primary certification transaction other than a smart contract invoking transaction, where the transaction may typically include transaction content data contained in a "data" field of the transaction, as well as a transaction execution result contained in a transaction receipt.
In practical applications, the service semantics of the service data that are stored in the blockchain by each service party are generally related to the service of each service party, and the services of different service parties generally have obvious differences, which results in the service semantics of the service data that are stored in the blockchain by different service parties, and generally have obvious difference methods. For example, a key-value key pair with special business semantics that a business party has demonstrated on a chain, even if presented in plain text to other business parties, the other business parties typically cannot learn the true business meaning.
Based on this, in order to ensure that the service data of each service party stored on the blockchain can be accurately analyzed, each service party can store the service data related to the own service and having specific service semantics on the blockchain, and can also respectively configure service models for the blocks storing the service data. For example, referring to fig. 1, each business party may configure a business model for a block for which business data is stored through the above-mentioned business model management service.
The business model can be specifically used for carrying out data analysis on transaction data stored in each block of the block chain according to business semantics of the business data so as to correctly restore the business data.
The specific form of the data model is not particularly limited in the present specification.
In the illustrated embodiment, the service model may specifically be a data model for describing the service semantics, where the data model may specifically include description data corresponding to a data structure related to the service semantics. For example, the description data may specifically be a data type corresponding to the transaction data included in the transaction data stored in the block, a data sequence of the transaction data included in the transaction data, and so on. In addition, since the transaction data stored in each block of the blockchain is generally subjected to data encoding processing according to a preset encoding mode, the data model may further include a decoding mode corresponding to the preset encoding mode.
For example, where business data is stored by invoking a smart contract, the transaction may be an intelligent contract invocation transaction, and the business model may be a contract interface description file generated by the intelligent contract at about compile time. Of course, in the case of storing the service data by means of the original certificate, the transaction may be a primary certificate storing transaction other than the smart contract invoking transaction, and in this case, the service model may be a description file related to the processing flow of the primary certificate storing transaction.
In the present specification, when a service party is configured with a service model for each block for which service data is stored, the data analysis service may obtain, in real time, block data corresponding to the blocks and the service model configured for the blocks;
for example, referring to fig. 1, the data parsing service may acquire the block data of the blocks from the blockchain node in real time, and may acquire the service models configured for the blocks from the service model management service program deployed on the blockchain service platform.
Step 404, respectively performing data analysis on transaction data stored in each block of the block chain based on the acquired service model to obtain the service data with service semantics contained in the transaction data, and establishing a query index for the service data obtained by data analysis;
after the service model is acquired, the data analysis service can respectively analyze the transaction data stored in each block based on the acquired service model so as to obtain service data with service semantics.
In one embodiment, as mentioned above, the service model may specifically include description data corresponding to the data structure related to the service semantics; in this case, when the data parsing service parses the transaction data stored in each block, the data structure of the transaction data stored in each block may be parsed based on the description data included in the obtained service model, so as to obtain service data having service semantics included in the transaction data.
In the illustrated embodiment, as described above, since the transaction data stored in each block of the blockchain is generally subjected to data encoding processing according to a preset encoding mode, the data model may include, in addition to the description data corresponding to the data structure related to the service semantics, a decoding mode corresponding to the preset encoding mode; in this case, when the data analysis service performs data analysis on the transaction data stored in each block, the data analysis service may specifically decode the transaction data stored in each block based on the decoding method included in the acquired service model, and after decoding is completed, analyze the data structure of the transaction data stored in each block based on the description data included in the service model.
After the data analysis is completed, the data analysis service may also create a query index for the service data obtained by the analysis.
In one embodiment, the query index created for the service data may specifically include a basic query index created for a key field included in the transaction data; and establishing a service query index for the service data obtained by data analysis. The key field may be a basic field included in a data format of the transaction; such as from field, to field, etc. in the transaction format.
By simultaneously creating the basic query index and the service query index for the service data, when the query is initiated for the service data based on the query index, the query initiated at the service layer can be assisted based on the basic query index in addition to the query initiated for the service data at the service layer, and the accurate query is realized.
For example, the from field and the to field in the data format of the transaction refer to an account initiating the transaction and a transaction receiver account respectively, and when a query is initiated for service data based on the basic query index of the from field and the to field and the service query index, the accurate query of the service data with service semantics carried in the transaction initiated for a specific account can be realized; otherwise, if the basic query index corresponding to the from field and the to field is not established, fuzzy query can only be performed on the business data with business semantics carried in the transaction, and the query scope cannot be limited to a specific transaction initiated by a certain account.
Of course, in practical applications, the query index created for the service data may not specifically include the basic query index created for the key field included in the transaction data, and is not particularly limited in this specification.
In one embodiment, the service party may also pre-designate the validation interval for the service model configured for each block in which the service data is stored; the effective interval may be a block number interval, which may be denoted as [ N, M ]. Wherein N represents a start block number at which the service model starts to take effect, and M represents an end block number at which the service model fails. In practical application, the service party can set the effective interval according to the evidence storage condition of the service data of the service party on the blockchain.
For example, assuming that the business party knows from the receipt of the business data that its own business data exists in the nth through mth blocks, the validation interval may be set to [ N, M ].
In practical application, a business model configured by a business party may be dynamically changed; for example, the service party configures a new service model at a certain block number, or updates an original service model at a certain block number. Therefore, in order to cope with the dynamic change of the business model, the above data parsing service may create and update index data in a manner of batch re-indexing in the data parsing and index building process.
In one embodiment shown, please refer to fig. 5, it is assumed that a new service model is configured in the T-th block, or the original service model is updated in the T-th block; wherein, the value of T is larger than N and smaller than M.
In this case, the data analysis service may perform data analysis on the transaction data stored in each block in the interval [ T, M ] based on the continuously running first task, and establish a query index for the service data obtained by the data analysis; in addition, the data analysis service may dynamically create a second task, operate the second task to analyze the transaction data stored in each block in the interval [ N, T ] respectively, build a query index for the service data obtained by the data analysis, and then end the second task after the index is built. The first task and the second task may specifically be a task thread created by the data parsing service.
In this way, after the second task is executed, the query index obtained finally includes the query index corresponding to the service data included in each block in the effective interval of the service model.
And step 406, sending the service data with the established query index to a full text search engine which is in butt joint with the blockchain service platform, so that the full text search engine responds to a data query request for the service data triggered by a data query party and executes data query for the service data based on the query index.
After creating the query index for the service data obtained by data analysis, the data analysis service can send the service data with the built query index to a full text search engine which is in butt joint with the blockchain service platform. After receiving a data query request for the service data triggered by the data query party, the subsequent full-text search engine can respond to the data query request and execute data query for the service data based on the query index.
In the embodiment shown, in addition to creating a query index for the service data obtained by data analysis, the data analysis service may further add an attribute identifier to the service data obtained by data analysis in order to control the viewing authority of the service data; for example, the attribute identification may specifically include a model identification of a business model, or a chain identification of a blockchain, and so on.
Wherein the attribute identifier specifically can be associated with a data viewing authority for the business data; in practical application, the attribute identifier added to the service data may be specifically an attribute identifier added to the service data on the basis of the query index, or may be a part of the query index (for example, may be a specific attribute value in the query index), which is not particularly limited in this specification.
The business data with the query index established and the attribute identification added can then be sent to a full text search engine interfacing with the blockchain service platform. After receiving a data query request for the service data triggered by a data query party, the subsequent full-text search engine can respond to the data query request to check whether the data query party has data viewing authority associated with the attribute identification; if yes, further executing data query on the service data based on the query index, and returning a query result to a data query party for output display; for example, referring to fig. 1, the query results may be sent to a search console for output presentation to a data querying party through a search gateway. Of course, if it is determined through verification that the data querying party does not have the data viewing authority associated with the attribute identifier, the query result may be masked and not returned to the data querying party.
For example, in one example, if the blockchain is a federated chain, the data inquirer may be a federated member of the federated chain, in such a way that visibility of business data having business semantics between different federated members may be rights controlled.
In the above technical solution, on one hand, after the service party has a service requirement, the service party can configure a service model for the relevant block, and analyze the transaction data stored in each block by adopting the service model to obtain the service data with service semantics, so as to complete the service search of the data on the chain, thereby making the whole searching mode more flexible.
On the other hand, the full-text search engine can be utilized to search the full text of the service data with specific semantics contained in the original data in real time according to the content of the data on the basis of the complete original data stored on the blockchain, and the data query party does not need to intervene in the data uplink stage to perform data transfer on the service data stored in each block of the blockchain, so that the complexity of searching the service data with the service semantics stored in each block of the blockchain can be reduced.
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment. Referring to fig. 6, at the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile storage 610, although other hardware required by other services is possible. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 602 reading a corresponding computer program from the non-volatile memory 610 into the memory 608 and then running. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic module, but may also be a hardware or logic device.
FIG. 7 is a block diagram of a full text search apparatus in a blockchain as shown in the present specification, as applied to a service deployed on a blockchain service platform, according to an exemplary embodiment; the device can be applied to the electronic equipment shown in fig. 6 to realize the technical scheme of the specification. The device comprises:
An acquisition module 702, configured to acquire a service model configured for each block of the blockchain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
the parsing module 704 performs data parsing on transaction data stored in each block of the blockchain based on the acquired service model, so as to obtain service data with service semantics contained in the transaction data, and establishes a query index for the service data obtained by data parsing;
and the sending module 706 sends the service data with the built query index to a full-text search engine docked with the blockchain service platform, so that the full-text search engine responds to a data query request for the service data triggered by a data querying party and executes data query for the service data based on the query index.
The specific details of the respective modules of the above apparatus have been described in the foregoing method flows, and thus are not described herein.
Correspondingly, the specification also provides electronic equipment, which comprises a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of all of the method flows described previously.
Accordingly, the present specification also provides a computer-readable storage medium having stored thereon executable instructions; wherein the instructions, when executed by the processor, implement the steps of the overall method flow described previously.
For the device embodiments, they essentially correspond to the method embodiments, so that reference is made to the description of the method embodiments for relevant points.
The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the technical scheme of the specification.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by the computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The foregoing description of the preferred embodiment(s) is (are) merely intended to illustrate the embodiment(s) of the present invention, and it is not intended to limit the embodiment(s) of the present invention to the particular embodiment(s) described.

Claims (17)

1. A full text searching method in a block chain is applied to a service program deployed on a block chain service platform; comprising the following steps:
acquiring a service model configured for each block of the blockchain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
respectively carrying out data analysis on transaction data stored in each block of the block chain based on the acquired service model, and establishing a query index for the service data obtained by the data analysis;
and sending the business data with the established query index to a full-text search engine which is in butt joint with the blockchain service platform, so that the full-text search engine responds to a data query request for the business data triggered by a data query party, and executes data query for the business data based on the query index.
2. The method of claim 1, the service comprising a data export service deployed on the blockchain service platform for data exporting blockdata in the blockchain.
3. The method of claim 1, the full text search engine being an elastesearch search engine.
4. The method of claim 2, wherein a business model management service program for managing the business model is further deployed on the blockchain service platform;
acquiring a service model configured for each block of the blockchain, including:
a business model configured for each block of the blockchain is obtained from the business model management service deployed on the blockchain service platform.
5. The method of claim 1, the business model comprising description data corresponding to data structures related to the business semantics;
respectively carrying out data analysis on transaction data stored in each block of the blockchain based on the acquired service model to obtain the service data with service semantics contained in the transaction data, wherein the data comprises the following steps:
and analyzing the data structure of transaction data stored in each block of the blockchain based on the obtained description data contained in the service model to obtain the service data with service semantics contained in the transaction data.
6. The method of claim 5, wherein transaction data stored in each block of the blockchain is subjected to data encoding processing according to a preset encoding mode; the service model also comprises a decoding mode corresponding to the preset encoding mode;
analyzing the data structure of transaction data stored in each block of the blockchain based on the obtained description data contained in the service model to obtain the service data with service semantics contained in the transaction data, wherein the method comprises the following steps:
and decoding transaction data stored in each block of the blockchain based on the obtained decoding mode contained in the service model, and analyzing the data structure of the transaction data stored in each block of the blockchain based on the description data contained in the service model after decoding is completed so as to obtain the service data with service semantics contained in the transaction data.
7. The method of claim 1, establishing a query index for the service data obtained by data parsing, comprising:
establishing a basic query index for key fields contained in the transaction data; the method comprises the steps of,
And establishing a service query index for the service data obtained by data analysis.
8. The method of claim 7, wherein the transaction data includes transactions stored in respective blocks of the blockchain and transaction receipts generated after execution of the transactions.
9. The method of claim 8, wherein if the transaction is a smart contract invocation transaction, the business data includes invocation input data included in a transaction payload of the smart contract invocation transaction, smart contract execution results included in the transaction receipt, and smart contract events included in the transaction receipt;
if the transaction is a native transaction other than a smart contract invoking transaction, the transaction data includes transaction content data included in a transaction payload of the transaction, and a transaction execution result included in the transaction receipt.
10. The method of claim 9, wherein if the transaction is an intelligent contract invocation transaction, the business model is a contract interface description file generated at about compile time for the intelligent contract.
11. The method of claim 1, wherein the business data having business semantics comprises key-value key value pairs having business semantics.
12. The method of claim 1, the business model being configured with an validation interval [ N, M ]; wherein, N represents a start block number at which the service model starts to take effect, and M represents an end block number at which the service model fails;
respectively carrying out data analysis on transaction data stored in each block of the blockchain based on the acquired service model, and establishing a query index for the service data obtained by data analysis comprises the following steps:
if the business model is configured in the T-th block in the blockchain or updated in the T-th block, respectively carrying out data analysis on transaction data stored in each block in a section [ T, M ] based on a continuously running first task, and establishing a query index for the business data obtained by data analysis; the method comprises the steps of,
dynamically creating a second task, operating the second task to respectively analyze data of transaction data stored in each block in the interval [ N, T ], establishing a query index for the service data obtained by data analysis, and ending the second task after the index establishment is completed; wherein the value of T is larger than N and smaller than M.
13. The method of claim 1, further comprising, prior to sending the business data for which the query index is established to a full text search engine interfaced with the blockchain service platform:
adding attribute identification for the service data obtained by data analysis; wherein the attribute identifier associates a data viewing right for the business data;
the sending the service data with the established query index to a full text search engine in butt joint with the blockchain service platform, so that the full text search engine responds to a data query request for the service data triggered by a data query party, and performs data query for the service data based on the query index, and the method comprises the following steps:
sending the business data with the built query index and the added attribute identifier to a full-text search engine in butt joint with the blockchain service platform, so that the full-text search engine responds to a data query request for the business data triggered by a data querying party, and whether the data querying party has data viewing authority for the business data associated with the attribute identifier is checked; and if so, further executing data query on the service data based on the query index, and returning a query result to the data query party for output display.
14. The method of claim 1, the blockchain being a coalition chain; the data inquirer is a federation member in the federation chain.
15. A full text search device in a block chain is applied to a service program deployed on a block chain service platform; comprising the following steps:
the acquisition module acquires a service model configured for each block of the block chain; wherein, each block of the block chain stores business data with business semantics; the business model is used for carrying out data analysis on transaction data stored in each block of the block chain according to the business semantics to obtain the business data;
the analysis module is used for respectively carrying out data analysis on transaction data stored in each block of the block chain based on the acquired service model so as to obtain service data with service semantics contained in the transaction data, and establishing a query index for the service data obtained by data analysis;
and the sending module is used for sending the business data with the built query index to a full-text search engine which is in butt joint with the blockchain service platform, so that the full-text search engine responds to a data query request which is triggered by a data query party and aims at the business data, and data query is executed on the basis of the query index.
16. An electronic device comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory stores machine readable instructions, the processor executing the method of any of claims 1 to 14 by invoking the machine readable instructions.
17. A machine-readable storage medium storing machine-readable instructions which, when invoked and executed by a processor, implement the method of any one of claims 1 to 14.
CN202211738172.XA 2022-12-30 2022-12-30 Full text searching method and device in block chain Pending CN116089463A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211738172.XA CN116089463A (en) 2022-12-30 2022-12-30 Full text searching method and device in block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211738172.XA CN116089463A (en) 2022-12-30 2022-12-30 Full text searching method and device in block chain

Publications (1)

Publication Number Publication Date
CN116089463A true CN116089463A (en) 2023-05-09

Family

ID=86200417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211738172.XA Pending CN116089463A (en) 2022-12-30 2022-12-30 Full text searching method and device in block chain

Country Status (1)

Country Link
CN (1) CN116089463A (en)

Similar Documents

Publication Publication Date Title
US10949447B2 (en) Blockchain-based data synchronizing and data block parsing method and device
US11875400B2 (en) Systems, methods, and apparatuses for dynamically assigning nodes to a group within blockchains based on transaction type and node intelligence using distributed ledger technology (DLT)
US11876910B2 (en) Systems, methods, and apparatuses for implementing a multi tenant blockchain platform for managing Einstein platform decisions using distributed ledger technology (DLT)
US11003646B2 (en) Data isolation in a blockchain network
CN110032599B (en) Data structure reading and updating method and device, and electronic equipment
US11853291B2 (en) Privacy preserving architecture for permissioned blockchains
CN111898139B (en) Data reading and writing method and device and electronic equipment
CN110032598B (en) Method and device for updating field and electronic equipment
CN112749749B (en) Classification decision tree model-based classification method and device and electronic equipment
CN112241506B (en) User behavior backtracking method, device, equipment and system
CN111538786B (en) Block chain data desensitization and tracing storage method and device
US11281438B2 (en) Platform for web services development and method therefor
CN104346365A (en) Device and method for determining specific service associated logs
CN111815454B (en) Data uplink method and device, electronic equipment and storage medium
US11775507B2 (en) Methods and apparatuses for reading and updating data structures, and electronic devices
CN113297433A (en) Method and system for accessing graph database
CN108694664A (en) Checking method and device, the electronic equipment of operation system
CN116089463A (en) Full text searching method and device in block chain
CN111914065B (en) Short message content verification method, device, computer system and computer readable medium
US11922278B1 (en) Distributed ledger based feature set tracking
CN110889040B (en) Method and device for pushing information
CN116932529A (en) Data processing method and device, storage medium and program product
Priya et al. Performance Comparison of On-Chain and Off-Chain Data Storage Model Using Blockchain Technology
CN116069861A (en) Data processing method, system and electronic equipment
CN114625899A (en) Information processing method, information processing apparatus, electronic device, and storage medium

Legal Events

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