CN108509523B - Method and device for structured processing of block chain data and readable storage medium - Google Patents
Method and device for structured processing of block chain data and readable storage medium Download PDFInfo
- Publication number
- CN108509523B CN108509523B CN201810202499.2A CN201810202499A CN108509523B CN 108509523 B CN108509523 B CN 108509523B CN 201810202499 A CN201810202499 A CN 201810202499A CN 108509523 B CN108509523 B CN 108509523B
- Authority
- CN
- China
- Prior art keywords
- log
- block chain
- structured
- information
- log information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Engineering & Computer Science (AREA)
- Finance (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Marketing (AREA)
- Economics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a block chain data structuring processing method, which comprises the following steps: creating a log burying point in an intelligent contract and issuing the log burying point to a block chain; triggering a buried point log to generate log information in the execution process of the intelligent contract; acquiring the log information, and converting the log information into a structured query statement; inserting the structured query statement into a local structured query database. The invention also discloses a block link point device and a computer readable storage medium. The invention realizes the structuralization of the block chain data, supports the structuralization query and improves the data query efficiency.
Description
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method for structured processing of block chain data, a block chain link point device, and a computer-readable storage medium.
Background
The structured data is specifically data logically expressed and realized by a two-dimensional table structure, and can be more easily understood by a user when combined with a specific application scene, in the prior art, a block chain system does not support structured query, and queried data needs to be stored in a contract first and then queried by calling a contract interface, so that the block chain data query efficiency is low, and the long-term development of a block chain technology is not facilitated.
Disclosure of Invention
The invention mainly aims to provide a block chain data structuring processing method, a block chain node device and a computer readable storage medium, aiming at solving the technical problem that the existing block chain system does not support structured query.
In order to achieve the above object, the present invention provides a method for processing blockchain data in a structured manner, where the method for processing blockchain data in a structured manner includes the following steps:
creating a log burying point in an intelligent contract and issuing the log burying point to a block chain;
triggering a buried point log to generate log information in the execution process of the intelligent contract;
acquiring the log information, and converting the log information into a structured query statement;
inserting the structured query statement into a local structured query database.
Optionally, the blockchain comprises a federation chain.
Optionally, the method for processing the block chain data in a structured manner further includes:
when multi-party transaction is carried out through the block chain, the embedded point log is triggered to generate transaction log information in the execution process of the intelligent contract.
Optionally, the method for processing the block chain data in a structured manner further includes:
when the buried point log generates log information, the log information is stored in the block information of the block chain in an application binary interface format.
Optionally, the method for processing the block chain data in a structured manner further includes:
and when the log information is stored in the block information of the block chain, acquiring the block information of the block chain and analyzing to obtain the log information.
Optionally, the block information of the block chain is obtained through a remote procedure call protocol interface.
Optionally, the method for processing the block chain data in a structured manner further includes:
receiving a structured query request initiated by external equipment;
based on the query request, a local structured query database is queried and a set of query results matching the query request is returned to the external device.
Further, to achieve the above object, the present invention also provides a block chain node device, which includes a memory, a processor, and a structured processing program of block chain data stored on the memory and executable on the processor, wherein the structured processing program of block chain data, when executed by the processor, implements the steps of the method for structured processing of block chain data as described in any one of the above.
Further, to achieve the above object, the present invention also provides a computer readable storage medium, on which a structured processing program of blockchain data is stored, and when the structured processing program of blockchain data is executed by a processor, the method of structured processing of blockchain data as described in any one of the above steps is implemented.
In the invention, a log burying point is created in an intelligent contract in advance and issued to a block chain, and the acquisition of required data can be realized through the log burying point; and then triggering a buried point log to generate log information in the execution process of the intelligent contract, wherein the log information is data information required to be acquired by passing through a buried point, then acquiring the log information, converting the log information into a structured query statement, and finally inserting the structured query statement into a local structured query database, so that the structured processing of the required data in a block chain is realized, the structured query of the data of the block chain can be supported, and the query efficiency is improved.
Drawings
FIG. 1 is a schematic structural diagram of an apparatus hardware operating environment according to an embodiment of the block-link point apparatus of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for structured processing of blockchain data according to the present invention;
fig. 3 is a flowchart illustrating a second embodiment of a method for structured processing of blockchain data according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an apparatus hardware operating environment according to an embodiment of the block-link point apparatus of the present invention.
The block chain node equipment in the embodiment of the invention refers to network node equipment participating in transaction and data exchange in a block chain network, and all the node equipment are mutually connected through a TCP/IP protocol. The blockchain node device can be a computer, a server and the like.
As shown in fig. 1, the block link point apparatus may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a memory device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the hardware configuration of the block chain node device shown in fig. 1 does not constitute a limitation of the block chain node device, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer-readable storage medium, may include therein a structured processing program of an operating system, a network communication module, a user interface module, and blockchain data. The operating system is a program for managing and controlling the block chain link point equipment and software resources, and supports the operation of a network communication module, a user interface module, a block chain data structured processing program and other programs or software; the network communication module is used for managing and controlling the network interface 1002; the user interface module is used to manage and control the user interface 1003.
In the hardware structure of the block chain node device shown in fig. 1, the network interface 1004 is mainly used for connecting to a system background and performing data communication with the system background; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; the blockchain node device calls a structured processing program of blockchain data stored in the memory 1005 by the processor 1001 and performs the following operations:
creating a log burying point in an intelligent contract and issuing the log burying point to a block chain;
triggering a buried point log to generate log information in the execution process of the intelligent contract;
acquiring the log information, and converting the log information into a structured query statement;
inserting the structured query statement into a local structured query database.
Further, the block chain link point device, by the processor 1001, calls the structured processing program of the block chain data stored in the memory 1005 to further perform the following operations:
when multi-party transaction is carried out through the block chain, the embedded point log is triggered to generate transaction log information in the execution process of the intelligent contract.
Further, the block chain link point device, by the processor 1001, calls the structured processing program of the block chain data stored in the memory 1005 to further perform the following operations:
when the buried point log generates log information, the log information is stored in the block information of the block chain in an application binary interface format.
Further, the block chain link point device, by the processor 1001, calls the structured processing program of the block chain data stored in the memory 1005 to further perform the following operations:
and when the log information is stored in the block information of the block chain, acquiring the block information of the block chain and analyzing to obtain the log information.
Further, the block chain link point device, by the processor 1001, calls the structured processing program of the block chain data stored in the memory 1005 to further perform the following operations:
receiving a structured query request initiated by external equipment;
based on the query request, a local structured query database is queried and a set of query results matching the query request is returned to the external device.
Based on the hardware structure of the above-mentioned blockchain node device, the following embodiments of the method for structured processing of blockchain data according to the present invention are provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for structured processing of blockchain data according to a first embodiment of the present invention.
In this embodiment, the method for processing block chain data in a structured manner includes the following steps:
step S10, creating a log burying point in the intelligent contract and issuing the log burying point to a block chain;
the intelligent contract referred to in this embodiment is preferably a service program written in the policy language and implementing specific logic, and is issued on the blockchain in a binary manner, so that the contract participant can execute a call on the blockchain at a certain time point and obtain a result.
Optionally, the chunk chain in this embodiment may be a federation chain, or may be a public chain or a private chain.
In this embodiment, it is considered that all the mainstream blockchains implement transactions by using an intelligent contract, and therefore, collection of data required in the blockchains is achieved by creating a log buried point in the intelligent contract.
The log burying point in this embodiment is a professional term in the field of data acquisition, and specifically refers to a related technology and an implementation process thereof for capturing, processing and sending a specific user behavior or event by using a log creating mode, and the specific implementation mode of the log burying point is not limited in this embodiment.
Step S20, triggering the buried point log to generate log information in the executing process of the intelligent contract;
in this embodiment, in the execution process of the intelligent contract, the buried point log is also correspondingly triggered to be executed, so as to generate log information, wherein the content of the log information is specifically determined according to data required to be collected by the buried point of the log, and a plurality of buried points of the log can be created in the same intelligent contract.
It should be further noted that, if the structured processing is directed to federation chain data, the data required to be collected by the log burying point may be data of any one or more parties participating in the contract.
Step S30, obtaining the log information and converting the log information into a structured query statement;
step S40, inserting the structured query statement into a local structured query database.
In this embodiment, after the log information is generated in the embedded point log, the log information is obtained and converted into a structured query statement, that is, an SQL statement, and finally the structured query statement obtained by converting the log information is inserted into the local structured query database, so that the block chain data is structured and the block chain system supports structured query.
In the embodiment, a log burying point is created in the intelligent contract in advance and issued to the block chain, and the required data can be acquired through the log burying point; and then triggering a buried point log to generate log information in the execution process of the intelligent contract, wherein the log information is data information required to be acquired by passing through a buried point, then acquiring the log information, converting the log information into a structured query statement, and finally inserting the structured query statement into a local structured query database, so that the structured processing of the required data in a block chain is realized, the structured query of the data of the block chain can be supported, and the query efficiency is improved.
Further, in another embodiment of the block chain data structured processing method of the present invention, when a multi-party transaction is performed through a block chain, in the execution process of the intelligent contract, a buried point log is triggered to generate transaction log information, so that structured query of the transaction information can be realized.
The application scene one: inquiring historical transaction condition of certain user
Carrying out log embedding in an intelligent contract for user transaction so as to generate a user transaction log; when the user transaction is carried out through the intelligent contract, a buried point log in the contract is triggered to generate transaction logs of recharging, consuming, cashing, order canceling and the like of the user; then, the transaction log is obtained and converted into a structured query statement, and then the structured query statement is inserted into a structured query database; the external equipment can search the historical transaction condition of the user through the structured query statement.
Scene two: inquiring historical transaction statistics of a certain merchant
Performing log embedding in an intelligent contract for merchant transaction to generate a merchant transaction log; when a merchant transacts through an intelligent contract, triggering a buried point log in the contract to generate transaction logs of recharging, consuming, cashing, order canceling and the like of the merchant; then, the transaction log is obtained and converted into a structured query statement, and then the structured query statement is inserted into a structured query database; the external equipment can search the historical transaction condition of the merchant through the structured query statement.
Further, in an embodiment of the method for processing the block chain data in a structured manner, when the buried point log generates the log information, the log information is stored in the block information of the block chain in the format of the api.
Application Binary Interface (ABI), describes a low Interface between an Application and an operating system, between an Application and its libraries, or between components of an Application.
In this embodiment, the generated log information is stored in the block information of the block chain in the format of the api.
Further, in an embodiment, the block information of the block chain is obtained through a Remote Procedure Call Protocol (RPC) interface of a bottom layer platform and is analyzed to obtain the log information. An RPC interface is a protocol that requests services from a remote computer program over a network without knowledge of the underlying network technology. The remote procedure call procedure is that a client sends out a request for executing a plurality of procedures to a server, and the execution result is returned to the client by using the parameters provided by the client.
Referring to fig. 3, fig. 3 is a flowchart illustrating a method for structured processing of blockchain data according to a second embodiment of the present invention.
In this embodiment, the method for processing block chain data in a structured manner further includes:
step S50, receiving a structured query request initiated by an external device;
step S60, based on the query request, querying the local structured query database and returning a query result set matching the query request to the external device.
In this embodiment, after the corresponding log information is obtained by burying the point in the log and the data in the log information is converted into the structured query statement, the structured query statement is inserted into the local structured query database, so that the external device can access the structured query statement.
When a structured query request initiated by external equipment is received, whether a result set meeting the query request exists in a local structured query database is queried, if so, a query result set matched with the query request is returned to the external equipment, so that the structured query of the external equipment to the block chain system is realized, and due to the adoption of a structured query mode, data required by a user can be directly obtained, and the query efficiency of the block chain data is improved.
The invention also provides a computer readable storage medium.
In this embodiment, a computer readable storage medium stores a block chain data structured processing program, and when the block chain data structured processing program is executed by a processor, the block chain data structured processing program implements the steps of the block chain data structured processing method described in any one of the above embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM), and includes instructions for causing a terminal (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The present invention is described in connection with the accompanying drawings, but the present invention is not limited to the above embodiments, which are only illustrative and not restrictive, and those skilled in the art can make various changes without departing from the spirit and scope of the invention as defined by the appended claims, and all changes that come within the meaning and range of equivalency of the specification and drawings that are obvious from the description and the attached claims are intended to be embraced therein.
Claims (9)
1. A method for structured processing of blockchain data is characterized in that the method for structured processing of blockchain data comprises the following steps:
creating a log burying point in the intelligent contract and issuing the log burying point to a block chain, wherein the log burying point is used for capturing, processing and sending specific user behaviors or events in a log creating mode;
triggering a buried point log to generate log information in the executing process of the intelligent contract, wherein the log information is determined according to data required to be acquired by the buried point of the log, and the data required to be acquired by the buried point of the log is data of any one or more parties participating in the intelligent contract;
acquiring the log information, and converting the log information into a structured query statement, wherein block information of the block chain is acquired through an RPC interface of a bottom platform, and the block information is analyzed to acquire the log information, wherein the log information comprises a transaction log of a user or a transaction log of a merchant;
inserting the structured query statement into a local structured query database.
2. The method of structured processing of blockchain data according to claim 1, wherein the blockchain comprises a federation chain.
3. The method as claimed in claim 1, wherein the method further comprises:
when multi-party transaction is carried out through the block chain, the embedded point log is triggered to generate transaction log information in the execution process of the intelligent contract.
4. The method as claimed in claim 3, wherein the method further comprises:
when the buried point log generates log information, the log information is stored in the block information of the block chain in an application binary interface format.
5. The method as claimed in claim 4, wherein the method further comprises:
and when the log information is stored in the block information of the block chain, acquiring the block information of the block chain and analyzing to obtain the log information.
6. The method as claimed in claim 5, wherein the block information of the blockchain is obtained through a remote procedure call protocol interface.
7. The method as claimed in claim 1, wherein the method further comprises:
receiving a structured query request initiated by external equipment;
based on the query request, a local structured query database is queried and a set of query results matching the query request is returned to the external device.
8. A blockchain link node device, characterized in that the blockchain node device comprises a memory, a processor and a structured processing program of blockchain data stored on the memory and executable on the processor, which when executed by the processor implements the steps of the structured processing method of blockchain data according to any one of claims 1 to 7.
9. A computer-readable storage medium, on which a structured processing program of blockchain data is stored, which when executed by a processor implements the steps of the method for structured processing of blockchain data according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810202499.2A CN108509523B (en) | 2018-03-13 | 2018-03-13 | Method and device for structured processing of block chain data and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810202499.2A CN108509523B (en) | 2018-03-13 | 2018-03-13 | Method and device for structured processing of block chain data and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108509523A CN108509523A (en) | 2018-09-07 |
CN108509523B true CN108509523B (en) | 2021-06-25 |
Family
ID=63377500
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810202499.2A Active CN108509523B (en) | 2018-03-13 | 2018-03-13 | Method and device for structured processing of block chain data and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108509523B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109559227A (en) * | 2018-11-29 | 2019-04-02 | 咪咕文化科技有限公司 | Cross-block chain network transaction method, device and storage medium |
EP3549028A4 (en) * | 2018-11-30 | 2020-01-15 | Alibaba Group Holding Limited | Blockchain data relationship structuring scheme based on binary log replication |
CN109977089A (en) * | 2019-03-13 | 2019-07-05 | 深圳壹账通智能科技有限公司 | Blog management method, device, computer equipment and computer readable storage medium |
CN110086790A (en) * | 2019-04-17 | 2019-08-02 | 江苏全链通信息科技有限公司 | Log storing method and system based on data center |
CN110275798A (en) * | 2019-05-08 | 2019-09-24 | 深圳壹账通智能科技有限公司 | Block chain data processing method, device, server and storage medium |
CN110096381B (en) * | 2019-05-10 | 2021-05-07 | 百度在线网络技术(北京)有限公司 | Method, device, equipment and medium for realizing remote procedure call |
CN110502500A (en) * | 2019-07-22 | 2019-11-26 | 福建智恒优水科技有限公司 | A kind of decentralization database implementation method and device based on block chain |
CN110765193B (en) * | 2019-10-22 | 2024-03-15 | 深圳前海微众银行股份有限公司 | Block chain data export method and device |
CN111061685B (en) * | 2019-11-21 | 2022-07-22 | 腾讯科技(深圳)有限公司 | Log query method and device, node equipment and storage medium |
US11269863B2 (en) * | 2020-01-23 | 2022-03-08 | International Business Machines Corporation | Index structure for blockchain ledger |
JP2023517049A (en) * | 2020-03-04 | 2023-04-21 | リュビデックス,エルエルシー | cipher data input blockchain data structure |
CN111526047B (en) * | 2020-04-15 | 2022-11-08 | 杭州溪塔科技有限公司 | Block chain-based message queue design method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106874440B (en) * | 2017-02-07 | 2019-11-12 | 杭州秘猿科技有限公司 | A kind of block chain state storage method based on SQL database |
CN107274186A (en) * | 2017-05-11 | 2017-10-20 | 上海点融信息科技有限责任公司 | The method and apparatus that intelligent contract-defined interface is obtained in block chain |
CN107507005B (en) * | 2017-08-01 | 2020-09-11 | 众安信息技术服务有限公司 | Off-link data access method and system based on alliance chain |
CN107767265A (en) * | 2017-11-07 | 2018-03-06 | 中积有限公司 | A kind of data sharing method and server |
-
2018
- 2018-03-13 CN CN201810202499.2A patent/CN108509523B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN108509523A (en) | 2018-09-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108509523B (en) | Method and device for structured processing of block chain data and readable storage medium | |
CN110008045B (en) | Method, device and equipment for aggregating microservices and storage medium | |
US8386420B2 (en) | Framework for web services exposing line of business applications | |
CN111414381B (en) | Data processing method and device, electronic equipment and storage medium | |
US8745088B2 (en) | System and method of performing risk analysis using a portal | |
CN111752799A (en) | Service link tracking method, device, equipment and storage medium | |
CN107368407B (en) | Information processing method and device | |
CN113127335B (en) | System testing method and device | |
CN111767157A (en) | Request processing method and device based on service grid | |
CN110661850B (en) | Edge calculation method, system, computer equipment and storage medium | |
CN114301970B (en) | Service calling method, device, electronic equipment and storage medium | |
CN110113384A (en) | Network request processing method, device, computer equipment and storage medium | |
CN113761433B (en) | Service processing method and device | |
CN116781780A (en) | Request processing method, device, server and storage medium | |
US20200301816A1 (en) | Code profiling system and associated methods | |
CN113377371B (en) | Multi-scene configuration method, system, equipment and medium | |
CN113779374B (en) | Page query management method and device | |
CN112328324B (en) | DataFetcher implementation system and method capable of configuring data source | |
CN111695986B (en) | Method and device for controlling accumulated gold image | |
CN114143065B (en) | Security event processing method, device, equipment and medium | |
CN110351767B (en) | Wi-Fi connection management method and device, electronic terminal and storage medium | |
CN117215807A (en) | Caching method and device of interface query result, storage medium and computer equipment | |
CN118170467A (en) | Interface calling method and device, electronic equipment and storage medium | |
CN115049408A (en) | Task information query method and device | |
CN108062327B (en) | Matching method and device for client |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |