Blockchain data query and data on-chain method, device, equipment and medium

By obtaining and verifying the audit status identifier of blockchain data, and combining with content security audit, the security risks of illegal data dissemination in blockchain information services are solved, and the security of data query and on-chain is improved.

CN115098541BActive Publication Date: 2024-12-20ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210673684.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-14
Publication Date
2024-12-20
Estimated Expiration
2042-06-14

AI Technical Summary

Technical Problem

Blockchain information services pose security risks, especially in the dissemination of illegal and bad information and illegal and criminal acts in the Internet, and existing technologies are difficult to effectively manage and control.

Method used

By obtaining the audit status identification of the target data in the blockchain system, data can only be obtained and sent from the blockchain node when the data meets the preset audit status. Combined with the content security audit mechanism, it is ensured that the data meets the upload and query. Safety standards.

Benefits of technology

It effectively avoids the spread of illegal data, improves the security of blockchain information services, ensures that the data obtained by the initiator meets the conditions, and enhances the security control of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098541B_ABST
    Figure CN115098541B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method, device, equipment and medium for blockchain data query and data on-chain. The scheme includes: obtaining a query request for target data in a blockchain system; the query request includes a data identifier of the target data; obtaining an audit status identifier for the target data; if the audit status identifier indicates that the target data meets a preset audit status, obtaining the target data from a blockchain node; and sending the target data to the initiator of the query request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and medium for blockchain data query and data uploading. Background Art

[0002] With the development of computer technology, blockchain technology has also been applied to various fields, and blockchain information security has also been called the focus of information supervision. Among them, blockchain information services, as a form of Internet information services, have the same security risks as Internet information services in terms of spreading illegal and negative information, committing network crimes, and destroying the network ecological order. Due to the unique characteristics of blockchain technology, it increases the difficulty of information content security management such as information tracing and handling of illegal and negative information.

[0003] Therefore, how to improve the security of blockchain information services is a technical problem that needs to be solved urgently. Summary of the invention

[0004] The embodiments of this specification provide a method, device, equipment and medium for blockchain data query and data on-chain, which are used to improve the security of blockchain information services.

[0005] To solve the above technical problems, the embodiments of this specification are implemented as follows:

[0006] A method for querying blockchain data provided by an embodiment of this specification includes:

[0007] Obtaining a query request for target data in a blockchain system; the query request includes a data identifier of the target data;

[0008] Based on the data identifier, obtaining a review status identifier for the target data;

[0009] If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node;

[0010] The target data is sent to the initiator of the query request.

[0011] A method for uploading data to a chain is provided in an embodiment of this specification, including:

[0012] Obtaining a data uplink request for target data; the data uplink request includes the target data;

[0013] Sending the target data to an audit server; the audit server is used to perform content security audit on the target data;

[0014] If the first audit result indicating that the audit is passed is received from the audit server within the preset time, or if the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system;

[0015] If a first audit result indicating that the audit has failed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system.

[0016] The embodiment of this specification provides a blockchain data query device, including:

[0017] A request acquisition module, used to acquire a query request for target data in the blockchain system; the query request includes a data identifier of the target data;

[0018] An identification acquisition module, used to acquire a review status identification for the target data based on the data identification;

[0019] A data acquisition module, configured to acquire the target data from a blockchain node if the audit status identifier indicates that the target data meets a preset audit status;

[0020] A data sending module is used to send the target data to the initiator of the query request.

[0021] An embodiment of the present specification provides a device for uploading data to a link, including:

[0022] An uplink request acquisition module, used to acquire a data uplink request for target data; the data uplink request includes the target data;

[0023] An audit sending module is used to send the target data to an audit server; the audit server is used to perform a content security audit on the target data;

[0024] An uplink module, configured to upload the target data to the blockchain system if a first audit result indicating that the audit is passed is received from the audit server within a preset time or if the first audit result is not received from the audit server within the preset time;

[0025] The on-chain termination module is used to refuse to upload the target data to the blockchain system if a first audit result indicating that the audit failed is received from the audit server within a preset time.

[0026] A blockchain data query device provided in an embodiment of this specification includes:

[0027] at least one processor; and,

[0028] a memory communicatively connected to the at least one processor; wherein,

[0029] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0030] Obtaining a query request for target data in a blockchain system; the query request includes a data identifier of the target data;

[0031] Based on the data identifier, obtaining a review status identifier for the target data;

[0032] If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node;

[0033] The target data is sent to the initiator of the query request.

[0034] A data uplink device provided in an embodiment of this specification includes:

[0035] at least one processor; and,

[0036] a memory communicatively connected to the at least one processor; wherein,

[0037] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0038] Obtaining a data uplink request for target data; the data uplink request includes the target data;

[0039] Sending the target data to an audit server; the audit server is used to perform content security audit on the target data;

[0040] If the first audit result indicating that the audit is passed is received from the audit server within the preset time, or if the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system;

[0041] If a first audit result indicating that the audit has failed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system.

[0042] An embodiment of this specification provides a computer-readable medium on which computer-readable instructions are stored. The computer-readable instructions can be executed by a processor to implement a method for querying blockchain data or a method for uploading data to a blockchain.

[0043] An embodiment of this specification can achieve the following beneficial effects:

[0044] In the embodiments of the present specification, when querying target data from the blockchain system, the audit status identifier of the target data can be obtained. Only when the audit status identifier indicates that the target data meets the preset audit status, the target data obtained from the blockchain system can be sent to the initiator of the query request, so that it can be limited by the audit status identifier whether the target data in the blockchain system can be provided to the initiator, which can ensure that the data obtained by the initiator is qualified data, thereby avoiding obtaining unqualified illegal data from the blockchain data, avoiding the spread of illegal data through the blockchain system, and improving the security of blockchain information services.

[0045] On the other hand, in the method of uploading data to the chain provided in the embodiments of this specification, it is also necessary to conduct a content security review of the target data requested to be uploaded to the chain, so as to avoid uploading data that has failed the review, and to avoid the spread of illegal data through the blockchain system, thereby improving the security of blockchain information services. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0047] Figure 1 It is a schematic diagram of an application scenario of a method for blockchain data query and data on-chain provided in an embodiment of this specification;

[0048] Figure 2 A flowchart of a method for querying blockchain data provided by an embodiment of this specification;

[0049] Figure 3 A flowchart of a method for uploading data to a chain provided in an embodiment of this specification;

[0050] Figure 4 A swim lane diagram of a method for uploading data to a blockchain provided in an embodiment of this specification;

[0051] Figure 5 A swim lane diagram of a method for querying blockchain data provided in an embodiment of this specification;

[0052] Figure 6 A schematic diagram of the structure of a blockchain data query device provided in an embodiment of this specification;

[0053] Figure 7 A schematic diagram of the structure of a device for uploading data to a link provided in an embodiment of this specification;

[0054] Figure 8 A schematic diagram of the structure of a blockchain data query device and a data upload device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of one or more embodiments of this specification clearer, the technical solutions of one or more embodiments of this specification will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this description, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of one or more embodiments of this specification.

[0056] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0057] In order to solve the defects in the prior art, this solution provides the following embodiments:

[0058] Figure 1 This is a schematic diagram of an application scenario of a method for blockchain data query and data on-chain provided in an embodiment of this specification. Figure 1 As shown, the scheme may include a query server 1 providing query services, a blockchain system 2, a chain server 3 providing data chaining, and an audit server 4 for content security auditing of data. Among them, the query server 1 can obtain a query request for target data sent by a user through a terminal such as a mobile phone or a computer. The query request may include a data identifier of the target data, and the audit status identifier of the target data may be obtained through the data identifier. The audit status identifier may indicate whether the target data is safe and compliant data that meets preset conditions. When it is determined that the target data meets the preset audit status, the target data can be obtained from the blockchain system 2, and the obtained target data can be sent to the initiator of the query request.

[0059] In order to ensure the security of the information uploaded to the chain in the embodiments of this specification, the uplink server 3 providing the data uplink service can call the audit server 4 with a content security audit function to audit the target data after obtaining the data uplink request containing the target data. If the first audit result indicating that the audit failed is fed back by the audit server 4 within the preset time, the target data can be refused to be uploaded to the blockchain system, thereby avoiding uploading of data that fails the content security audit to the chain.

[0060] Next, a method for querying blockchain data and uploading data to the blockchain provided in the embodiment of the specification will be specifically described with reference to the accompanying drawings:

[0061] Figure 2 A flowchart of a method for querying blockchain data provided in an embodiment of this specification. From a program perspective, the execution subject of the process can be a program or application client mounted on an application server that can query data stored in the blockchain system. In actual applications, the block nodes in the blockchain system can include: regulatory consensus nodes, consensus nodes, and ordinary full nodes according to functional authority. Among them, the regulatory consensus node can be used as the highest-level node, with the ability to synchronize all ledger data and participate in blockchain consensus, and can also be responsible for managing and authorizing blockchain access platforms and entities; consensus nodes can synchronize all ledger data and can also participate in blockchain consensus; ordinary full nodes, which can also be called read-only nodes, can synchronize all ledger data. The execution subject of the method provided in the embodiment of this specification can also be a server corresponding to the regulatory consensus node, or a server corresponding to the platform or entity that accesses the blockchain, and the server has the function of querying blockchain data.

[0062] like Figure 2 As shown, the process may include the following steps:

[0063] Step 202: Obtain a query request for target data in the blockchain system; the query request includes a data identifier of the target data.

[0064] In the embodiment of this specification, the query server with the function of querying blockchain data can obtain the query request for target data sent by the query user, and can obtain the required target data from the blockchain system based on the query request.

[0065] Step 204: Based on the data identifier, obtain the review status identifier for the target data.

[0066] In the embodiments of this specification, the audit status identifier can be used to indicate the audit status of the target data, and the audit status can be an audit status indicating that the target data has not passed the audit, has passed the audit, has not completed the audit, etc. Among them, the target data can be audited by an audit server capable of performing content security audit on the data, and the audit status information of the target data can be determined according to the audit results.

[0067] Step 206: If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node.

[0068] Among them, the preset review status can indicate that the target data is in a state that can be off-chain. For example, if the content information corresponding to the target data complies with the provisions of relevant laws and regulations, the target data can be obtained from the blockchain node.

[0069] Step 208: Send the target data to the initiator of the query request.

[0070] In the embodiments of the present specification, the audit status of the target data can be determined according to the audit status identifier of the target data before sending the target data to the initiator of the query request, and the target data that meets the preset audit status can be provided to the initiator of the query request, thereby ensuring that the initiator obtains data that meets the regulations from the blockchain system.

[0071] It should be understood that the order of some steps in the methods described in one or more embodiments of this specification can be interchanged according to actual needs, or some steps can be omitted or deleted.

[0072] Figure 2 In the method, when querying target data from the blockchain system, the audit status identifier of the target data can be obtained. When the audit status identifier indicates that the target data meets the preset audit status, the target data obtained from the blockchain system can be sent to the initiator of the query request, so that it can be limited by the audit status identifier whether the target data in the blockchain system can be provided to the initiator, which can ensure that the data obtained by the initiator is qualified data, thereby avoiding obtaining unqualified illegal data from the blockchain data, avoiding the spread of illegal data through the blockchain system, and improving the security of blockchain information services.

[0073] based on Figure 2 The method, the examples of this specification also provide some specific implementation plans of the method, which are described below.

[0074] Blockchain technology, blockchain is a new decentralized protocol that can safely store digital currency transactions or other data. The information cannot be forged or tampered with. The transaction confirmation on the blockchain is completed by all nodes on the blockchain, and its consistency is guaranteed by the consensus algorithm. A public ledger is maintained on the blockchain. The public ledger is located at any node on the storage block, so as to ensure that it cannot be forged or tampered with. The world state is the sum of the state information generated by the blockchain system based on the account model after the transaction is executed, including the account information of all accounts in the blockchain, including the balance, and the state information of all smart contracts. The call of a smart contract or the transfer operation without calling a contract will cause the world state to change. The latest world state generated after the execution of each block's transaction is the basis for the execution of the next block's transaction. The execution of each transaction will continue to be modified based on the latest world state after the execution of the previous transaction.

[0075] The blockchain is organized into a network in the form of nodes. All nodes start from the same initial state and execute the transactions in the block that have been agreed upon by each node in turn, thereby driving the state of each node to change continuously according to the same operation sequence (addition, deletion, modification), so that all nodes are in the same state after executing the same transaction in the block. This state is called the world state. Each node of the blockchain integrates a KV database (Key-Value database) to store various information, such as account balances, smart contract bytecodes, customized data of each smart contract, and configuration parameters of the blockchain. After the blockchain executes the consensus transaction in the block, each node involved in the transaction will transmit its transaction data to other nodes involved in the transaction for data update, so that each node involved in the transaction is in a consistent world state.

[0076] The blockchain ledger maintained by the nodes in the blockchain system in the embodiments of this specification may include a blockchain database and a world state database. The blockchain database may be used to record blocks of each data stored in the blockchain system, and the world state database may be used to record the audit status identifier or audit status information of the data stored in the blockchain system.

[0077] Optionally, obtaining the review status identifier for the target data in the embodiments of this specification may specifically include:

[0078] The audit status identifier for the target data is obtained from a world status database of the blockchain system.

[0079] Among them, a smart contract can be deployed in the server, and the audit status identifier of the target data can be pulled from the world state database of the blockchain system through the smart contract.

[0080] In practical applications, content security can be used to identify and block the spread of harmful information and illegal content, such as pornographic content, criminal content, terrorist and reactionary content. It mainly uses algorithms, models and other technical means to identify risks for objects in the form of pictures, texts, videos, audio and other forms.

[0081] In actual applications, due to changes in the basis for content security review of data in laws and regulations, in the embodiments of this specification, an audit server with an audit function can be used to perform regular or irregular content security reviews on the data that has been uploaded to the chain, and the audit status identifier of the target data already saved in the blockchain system can be updated according to the latest audit results, so as to timely adjust the management of out-of-chain data to ensure that only data with secure content can be uploaded.

[0082] In order to more effectively determine the audit status of the target data, before obtaining the audit status identifier for the target data from the world state database of the blockchain system in the embodiment of this specification, the following may also be included:

[0083] Determine whether the audit status identifier for the target data in the world status database of the blockchain system is the latest audit status identifier.

[0084] In actual applications, the world state database can store audit status identifiers obtained by auditing the target data multiple times, and can also update the previous audit status identifier based on the audit status identifier obtained from the latest audit.

[0085] Among them, when the world state database can store audit status identifiers obtained by auditing the target data multiple times, it is possible to judge whether the generation time of the audit status identifier for the target data is the generation time with the shortest distance from the current time based on the timestamp of the audit status identifier. If the generation time of the audit status identifier is the shortest distance from the current time, it can be determined that the audit status identifier is the latest audit status identifier.

[0086] In order to avoid storing too much audit status identification information in the world state database and reduce the space occupied by block nodes, the previous audit status identification in the world state database is also updated according to the audit status identification obtained from the latest audit.

[0087] In the embodiment of this specification, after the audit server completes the audit of the target data, it can deliver the audit status information to the oracle server with the oracle function, and then determine the audit status identifier for the target data in the world state database of the blockchain system according to the audit status information of the oracle server. After receiving the audit status information sent by the audit server, the oracle server can generate an audit record identifier of the audit status information, and the audit record identifier can indicate whether the audit status identifier of the target data in the blockchain system has been updated according to the audit status information.

[0088] In the embodiment of this specification, the audit record identifier of the target data in the oracle server can be used to determine whether the audit status identifier of the target data in the blockchain system is the latest audit status identifier. Optionally, the determination of whether the audit status identifier of the target data in the world state database of the blockchain system is the latest audit status identifier in the embodiment of this specification can specifically include:

[0089] Obtaining a first audit record identifier of the target data from a oracle server having a oracle function;

[0090] Determine whether the first audit record identifier is the first identifier; the first identifier is used to indicate that the audit status of the target data in the oracle server has been synchronized to the world status database of the blockchain system;

[0091] The obtaining the audit status identifier for the target data from the world status database of the blockchain system may specifically include:

[0092] If the first audit record identifier is the first identifier, the audit status identifier for the target data is obtained from the world status database of the blockchain system.

[0093] In the embodiments of this specification, the audit status identifier in the world state database of the blockchain system can be updated based on the audit status information in the oracle server based on the smart contract. After the blockchain system obtains the audit status information from the oracle server, the first audit record identifier of the audit status information in the oracle server can be marked as the first identifier indicating that the audit status of the target data in the oracle server has been synchronized to the world state database of the blockchain system, for example, it can be marked as "marked" and the like. When the first audit record identifier in the oracle server is the first identifier, it can be determined that the audit status identifier of the target data in the blockchain system is the latest audit status identifier, and it can be determined whether the target information can be sent to the initiator of the query request based on the audit status identifier in the blockchain system.

[0094] In the embodiments of this specification, after the audit server has audited the audit result, it can deliver the audit result to the oracle server, which can store the latest audit result and other information indicating the audit status of the target data. After receiving the audit result and other status information delivered by the audit server, the oracle server can mark the audit record identifier of the audit status information as the second identifier, which can indicate that the audit status of the target data in the oracle server has not been synchronized to the world state database, for example, it can be marked as "pending update"; after the blockchain system retrieves the audit result and other information that can indicate the audit status from the oracle server, the audit record identifier of the information indicating the audit status in the oracle server can be marked as the first identifier.

[0095] Optionally, after determining whether the audit record identifier is the first identifier in the embodiment of this specification, the following steps may also be included:

[0096] If the first audit record identifier is the second identifier, the audit status information of the target data is obtained from the oracle server; the second identifier is used to indicate that the audit status of the target data in the oracle server is not synchronized to the world state database;

[0097] The audit status identifier of the target data in the world state database of the blockchain system is updated based on the audit status information of the target data obtained from the oracle server.

[0098] Among them, after the blockchain system retrieves the audit results and other information that can represent the audit status from the oracle server, it can update the audit status identifier of the target data in the world state database of the blockchain system according to the latest information obtained, and the audit record identifier corresponding to the audit status information in the oracle server can also be changed from the second identifier to the first identifier to indicate that the audit status of the target data in the world state database of the blockchain system is consistent with the audit status of the target data recorded in the oracle server.

[0099] After the audit status identifier of the target data in the blockchain system is updated according to the audit status information representing the target data in the oracle server, the latest audit status identifier of the target data can be obtained from the blockchain system, and it can be determined whether to provide the target data to the initiator of the query request based on the latest audit status identifier.

[0100] In the embodiments of this specification, the audit status information in the blockchain system can be updated in a timely manner according to the audit status information in the oracle server, so as to ensure that the data sent to the initiator of the query request is in compliance with security control, which can prevent users from obtaining illegal data from the blockchain system and improve the security of blockchain information services. In addition, obtaining the audit status identifier of the target data from the blockchain system can also make full use of the stability of the blockchain system. When some nodes fail, the audit status identifier of the target data can also be obtained from other nodes to audit the target data, which can avoid the failure of query request processing caused by the failure to obtain the audit status identifier of the target data in time.

[0101] In order to reduce the pressure on the blockchain system in the embodiments of this specification, the audit status identifier of the target data may also be obtained from an oracle server having an oracle function. Optionally, the obtaining of the audit status identifier for the content of the target data may specifically include:

[0102] Sending an audit query request for obtaining the audit status of the target data to an oracle server having an oracle function;

[0103] Obtain a first review status identifier for the target data fed back by the oracle server.

[0104] Among them, after the audit server with content security audit audits the target data, the audit status information can be sent to the oracle server with oracle function, and the oracle server can save the first audit status identifier of the target data based on the received audit status information.

[0105] To ensure that the latest audit status information can also be saved in the blockchain system, optionally, after obtaining the first audit status identifier for the content of the target data fed back by the oracle in the embodiment of this specification, the following may also be included:

[0106] Acquire a second audit status identifier of the target data from a world status database of the blockchain system;

[0107] Determining whether the audit status indicated by the first audit status identifier is consistent with the audit status indicated by the second audit status identifier;

[0108] If they are inconsistent, the second audit status identifier in the world status database of the blockchain system is updated according to the first audit status identifier.

[0109] A smart contract is a computer protocol designed to disseminate, verify or execute contracts in an information-based manner. In practical applications, smart contracts allow for trusted transactions without a third party, and these transactions are traceable and irreversible. In the embodiments of this specification, the audit status identifier in the blockchain system can be updated through a smart contract for marking the audit status; the target data can also be obtained from the blockchain system through a smart contract for information out-of-chain.

[0110] In the embodiments of this specification, the preset audit status can represent the audit status of passing the content security audit, wherein, when it is determined that the target data has passed the content security audit according to the audit status identifier of the target data, the target data can be fed back to the initiator of the query request so that the initiator can obtain secure and compliant data from the blockchain system. In the embodiments of this specification, it is also possible to refuse to send data that has not passed the audit to the request initiator, wherein, if the audit status identifier indicates that the target data does not meet the preset audit status, the process of sending the target data to the initiator of the query request is terminated.

[0111] In the embodiments of this specification, when the target data is terminated from being sent to the initiator of the query request, a prompt message indicating that the query failed can be sent to the initiator, and the prompt message can also include a description of the reason for the query failure, such as prompt messages such as "the query object contains illegal information and is not queried". In actual applications, the specific content and format of the prompt message can be set according to actual needs, and are not specifically limited here.

[0112] Considering that the working efficiency of the audit server may be different from that of the on-chain server that uploads the data to the chain, for the audit server, it may take a long time to audit a large or complex amount of data. In order to ensure the efficiency of information on the chain, the audit status of the target data and the audit result corresponding to the target data may be allowed to be asynchronously uploaded to the chain in the embodiments of this specification. The unaudited data may be uploaded to the chain first, and then the audit status corresponding to the completed audit may be uploaded to the chain after the audit server completes the audit. Among them, for the data contained in the blockchain system that has been sent to the audit server for audit but has not yet received the audit result fed back by the audit server, the audit status identifier of such data may be marked as an identifier indicating an incomplete audit status, for example, it may be marked with words such as "incomplete audit" and "pending confirmation". The specific content and format of the identifier in the embodiments of this specification can be set according to actual needs and are not specifically limited here.

[0113] In the embodiment of this specification, the audit status identifier may include an identifier indicating an audit status of an unfinished audit. If, when querying data, the current audit status of the target data is still in an unfinished audit status, the user may be prompted to access it later, so that after the audit of the target data is completed, it can be determined whether the target data can be provided to the user based on the audit result obtained after the audit is completed. Optionally, the audit status identifier in the example of this specification includes an identifier indicating an audit status of an unfinished audit; before terminating the process of sending the target data to the initiator of the query request, it may also include:

[0114] Sending a prompt message indicating a later access to the initiator of the query request.

[0115] In actual applications, the initiator can initiate a query request for the target data after a period of time after obtaining the prompt information. To simplify the operation of the initiator, the terminal application that sends the query request in the embodiment of this specification can also automatically initiate a query request for the target data based on the previously received query request after a preset time period, such as 5 seconds, 10 seconds, etc.

[0116] In the embodiments of this specification, after the content security audit of the on-chain data is completed, the audit status identifier corresponding to the data in the blockchain system can be updated according to the audit results. If the audit status identifier of the target data obtained according to the query request initiated again indicates that the target data is in an audit state that has passed the content security audit, the target data can be sent to the initiator; if the audit status identifier of the target data obtained according to the query request initiated again indicates that the target data is in an audit state that has not passed the content security audit and does not meet the requirements of the security audit, the process of sending the target data to the initiator can be terminated.

[0117] Based on the same idea, the embodiments of this specification also provide a method for uploading data to the chain, and the target data queried in the above-mentioned blockchain data query method can be uploaded to the chain based on this method.

[0118] Figure 3 A flowchart of a method for uploading data to a blockchain provided in an embodiment of this specification. From a program perspective, the execution subject of the process can be a program or application client mounted on an application server that can upload data to the blockchain system. Similarly, the execution subject of the method provided in an embodiment of this specification can also be a server corresponding to a regulatory consensus node, or a server corresponding to a platform or subject that accesses the blockchain, which has the function of uploading data to the blockchain system.

[0119] like Figure 3 As shown, the process may include the following steps:

[0120] Step 302: Obtain a data uplink request for target data; the data uplink request includes the target data.

[0121] In the embodiment of this specification, the server that uploads data to the blockchain system can obtain the data upload request for the target data sent by the user. The data upload request can include the target data to be uploaded.

[0122] Step 304: Send an audit request for the target data to an audit server; the audit server is used to perform a content security audit on the target data.

[0123] In the embodiments of this specification, the audit server can perform content security audit on the target data to be uploaded to the chain. The uploaded server can send an audit request to the audit server and call the audit server to audit the target data. The audit server can feed back the audit result indicating whether the audit passed or failed to the uploaded server.

[0124] Step 306: If the first audit result indicating that the audit is passed is received from the audit server within the preset time or the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system.

[0125] Step 308: If a first audit result indicating that the audit failed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system.

[0126] In actual applications, when the audit server audits data with a large amount of data or more complex data, it may take a long time to audit. In order to reduce the impact on the efficiency of the chain server in the embodiments of this specification, if the audit result fed back by the audit server is not received within the preset time, the data can be uploaded to the chain first, and then the audit result can be sent to the blockchain information after the audit result comes out. Among them, the preset time can be determined according to the performance of the chain server, and is not specifically limited here.

[0127] In the embodiments of this specification, the target data requested to be uploaded to the chain is audited for content security, so that data that has not passed the audit can be prevented from being uploaded to the chain, and illegal data can be prevented from being spread through the blockchain system, which can improve the security of blockchain information services. In addition, the uploaded data and audit results can be processed asynchronously, and data that has not obtained the audit results within the preset time can be uploaded to the chain first, without spending a long time waiting for the audit to be recorded, which can avoid the impact on the efficiency of the upload.

[0128] The blockchain system in the embodiments of this specification may include a blockchain database and a world state database, wherein uploading the target data to the blockchain system may specifically include: uploading the target data to the blockchain database of the blockchain system.

[0129] In the embodiments of this specification, the user can call the information chain application program interface, through which the information chain contract can be called, and based on the information chain contract, the target data can be saved in the blockchain database of the blockchain system.

[0130] In the embodiment of this specification, the audit status of the target data may also be saved in the world status database of the blockchain system. Optionally, the method in the embodiment of this specification may also include:

[0131] Determine a first audit status identifier of the target data based on the first audit result indicating audit passing fed back by the audit server received within the preset time or the first audit result fed back by the audit server not received within the preset time;

[0132] The first audit status identifier of the target data is saved to the blockchain system so that the audit status information of the target data is saved in the blockchain system.

[0133] In the embodiments of this specification, the first audit status identifier may be a status identifier indicating that the target data has passed the audit or a status identifier indicating that the audit of the target data has not been completed. If the audit result received from the audit service within the preset time indicates that the target data has passed the audit, it means that the target data meets the requirements of the content security audit, and the first audit status identifier may be an identifier indicating that the target data has passed the audit; if the audit result is not received from the audit service within the preset time after the target data is sent to the audit server, that is, the audit result is not received from the audit server indicating that the target data has passed the audit or failed the audit, the first audit status identifier may be an identifier indicating that the audit of the target data has not been completed.

[0134] For example, the target data that has passed the review can be marked as "reviewed", and the target data that has not completed the review can be marked as "review pending confirmation", and the review status identification can be saved in the world state database of the blockchain system. The specific identification content and method are not specifically limited here.

[0135] In the embodiments of this specification, a oracle server with a oracle function can also be used to save the audit results of the target data, and the audit status of the target data in the blockchain system is determined based on the audit results in the oracle server. Optionally, in the method in the embodiments of this specification, the oracle server with a oracle function is used to receive the first audit result sent by the audit server, and the method can also include:

[0136] The first audit result is obtained from the oracle server; the audit record identifier of the first audit result in the oracle server is marked as a second identifier; the second identifier is used to indicate that the audit status information of the target data in the oracle server is not synchronized to the blockchain system;

[0137] After obtaining the first audit result from the oracle server, the audit record identifier of the first audit result in the oracle server is marked as a first identifier; the first identifier is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system.

[0138] In actual applications, after the audit server completes the audit of the target data, it can deliver the audit results to an oracle server with an oracle function, or the on-chain server can also deliver the audit results to the oracle server after obtaining the audit results. The audit results may include an audit result indicating whether the audit passed or failed.

[0139] In the embodiments of this specification, the first audit result may include the audit result completed by the audit server within a preset time. For the convenience of subsequent management, the oracle server may mark the first audit result after the oracle server receives the first audit result, and mark the oracle server audit record identifier of the first audit result with a second identifier, such as an identifier with the word "to be updated", which is used to indicate that the audit status information of the target data in the oracle server has not been synchronized to the blockchain system, and the audit status information of the target data in the blockchain system needs to be updated.

[0140] For data that has not been reviewed within the preset time, the oracle server may not store the review status information of such data, or it may indicate that the information has not been reviewed and an audit mark is set. The specific situation is also set according to actual needs and is not specifically limited.

[0141] In the embodiment of the present description, after receiving the target data, the blockchain system can query the audit result information of the target data from the oracle server, and then determine the audit status information of the target data based on the queried audit result information; alternatively, the on-chain server can also send the acquired audit result to the blockchain system, and the blockchain system can also determine the audit status information of the target data based on the audit result sent by the on-chain server, and save the determined audit status information in the world state database.

[0142] Among them, after the blockchain system retrieves the first audit result from the oracle server, the audit record identification mark of the first audit result in the oracle server can be changed to a first identification, such as an identification with the word "marked". The first mark can be used to indicate that the audit status of the target data in the oracle server has been synchronized to the world state database, that is, it can indicate that the audit status information in the world state database can indicate the current latest audit status of the target data.

[0143] In the embodiment of this specification, for target data that has not been reviewed when it is uploaded to the chain, after the review server completes the review of the target data, the recorded review status information can also be updated according to the obtained review result. Optionally, in the embodiment of the specification, when the first review result fed back by the review server is not received within the preset time, the method can also include:

[0144] After uploading the target data to the blockchain system, obtaining a second audit result for the target data; the second audit result is the audit result fed back by the audit server after completing the audit of the target data after the preset time period;

[0145] Based on the second audit result, determining a second audit status identifier of the target data;

[0146] The second review status identifier is saved in the blockchain system.

[0147] The second audit result may be an audit result indicating that the audit was passed or failed.

[0148] In order to reduce the storage space occupied by the blockchain system in the embodiments of this specification, the first audit status information previously stored in the blockchain system may be updated based on the second audit status information. Optionally, the second audit status identifier is saved to the blockchain system in the embodiments of this specification, which may specifically include:

[0149] The first audit status identifier is updated based on the second audit status identifier.

[0150] In the embodiments of this specification, an asynchronous method is adopted for chaining, and the data to be chained or the data that has not been reviewed within a preset time can be chained first, and then the review status information of the chained data can be determined according to the review results obtained after chaining, so that there is no need to spend too much time waiting for the review results, which can improve the efficiency of data chaining. In addition, after the data is chained, the review status identifier of the chained target data of the blockchain system can be updated in time according to the review results of the review server. The updated review status identifier can be a status identifier indicating whether the target data has passed the review, so that it can be determined whether the data can be removed from the chain according to the latest review status identifier, and it can also ensure that users obtain safe data from the blockchain system.

[0151] For example, after the target data that has not been reviewed is uploaded to the chain, the review status mark of the target data can be marked as a review mark indicating that the review has not been completed, such as the words "review status to be determined"; when the review server completes the review of the target data, assuming that the review result is a result indicating that the review has passed, the review status mark "review status to be determined" of the target data in the blockchain system can be updated to a review status mark indicating that the review has passed, such as the words "review passed"; assuming that the review result is a result indicating that the review has not passed, the review status mark "review status to be determined" of the target data in the blockchain system can be updated to a review status mark indicating that the review has not passed, such as the words "review has not passed". When the subsequent information is off-chain, it can be determined whether the target data can be provided to the user who requested the off-chain based on the review status mark.

[0152] Assuming that for target data that has not completed the review when it is uploaded to the chain, the final review result is that the target data has failed the review. The review status identifier of the target data in the blockchain system can also be updated to an identifier indicating that the target data has failed the review. Then, when the user requests data to be exported from the chain, the user can be prohibited from obtaining the data that has failed the review based on the review status identifier, and the spread of illegal data through the blockchain system can be avoided.

[0153] The audit server of the embodiment of this specification may also deliver the audit results of the target data that has not completed the audit to the oracle server with the oracle function, and based on the obtained audit results, update the audit status mark that indicates that the audit is not completed. Optionally, the oracle server with the oracle function in the embodiment of this specification is used to receive the second audit result sent by the audit server, and the acquisition of the second audit result for the target data may specifically include: acquiring the second audit result from the oracle server; marking the audit record identifier of the second audit result in the oracle server as the second identifier; the second mark is used to indicate that the audit status information of the target data in the oracle server has not been synchronized to the blockchain system.

[0154] The method in the embodiment of this specification may also include: after obtaining the second audit result from the oracle server, marking the audit record identifier of the second audit result in the oracle server as a first identifier; the first identifier is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system.

[0155] Assume that when the target data is sent to the blockchain system, the audit server has not completed the audit of the target data, and the oracle server does not have the audit result of the target data; when the audit server completes the audit of the target data, the audit result can be sent to the oracle server. Here, the second audit result represents the audit result fed back after the audit server completes the audit of the target data after the preset time period. After receiving the second audit result, the oracle server can first mark the audit record identifier of the second audit result as a second identifier, such as "to be updated", which is used to indicate that the audit status information of the target data in the oracle server has not been synchronized to the blockchain system, and the audit status information corresponding to the second audit result needs to be sent to the blockchain system later.

[0156] In the embodiments of this specification, if there is audit status information marked with a second identifier, such as "to be updated", in the oracle server, the oracle server may also send a request to update the audit status to the blockchain system, and upload the audit status identifier corresponding to the audit status information marked with "to be updated" in the oracle server to the world status database of the blockchain system by calling the audit status marking contract, so that the audit status information in the world status database can be updated in time.

[0157] The blockchain system can query the second audit result marked with the second mark from the oracle server, and can save the second audit status information corresponding to the second audit result to the blockchain system. After the blockchain system retrieves the second audit result from the oracle server, the audit record identifier of the second audit result in the oracle server can be marked as the first identifier, such as "marked", which is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system, and the audit status information saved in the blockchain system is the latest audit status information.

[0158] The audit basis in the audit server in the embodiment of this specification can be generated according to the current laws, regulations, and regulatory systems. As the industry develops, some regulations may change, and the audit basis will also change accordingly, so that the audit results of the previously audited data on the chain may be different from the previous audit results according to the new regulations. In this regard, the audit status information of the on-chain data can also be updated in time according to the changes in the audit strategy in the embodiment of this specification, so as to more accurately prevent the spread of illegal information through the blockchain system.

[0159] Optionally, the method in the embodiments of this specification may further include:

[0160] Acquire a third audit result for the target data; the third audit result is an audit result obtained by the audit server auditing the target data based on the changed audit policy;

[0161] Determining whether the third audit result is consistent with the audit result indicated by the first audit mark;

[0162] If they are inconsistent, the first audit status identifier in the blockchain system is updated based on the third audit result.

[0163] Among them, after the audit server audits the target data according to the updated audit policy, it obtains the third audit result, and can also deliver the third audit result to the oracle server with oracle function. The oracle server can record the first audit result obtained by auditing according to the audit policy before the update. If the third audit result is inconsistent with the audit result represented by the first audit result, for example, the first audit result indicates that the target data has passed the audit, and the third audit result indicates that the target data has failed the audit; for example, the first audit result indicates that the target data has failed the audit, and the third audit result indicates that the target data has passed the audit, then the first audit status identifier in the world state database of the blockchain system can be updated according to the third audit result.

[0164] In the embodiments of the present specification, a server that performs content security management on the data that has been uploaded to the chain can be used to execute a process of auditing the data that has been uploaded to the chain after the audit policy sends a change. In order to reduce the consensus efficiency of the consensus nodes in the blockchain system, the data that needs to be audited can be obtained from the read-only nodes of the blockchain system.

[0165] Similar to the audit record identifier described above, if the third audit result is inconsistent with the audit result represented by the first audit result, the oracle server can update the first audit result that has been recorded according to the third audit result, and then mark the audit record identifier of the third audit result as the second identifier to indicate that the third audit result has not yet been obtained in the blockchain system, and the audit result of the target data in the blockchain system needs to be updated. The third audit result can be retrieved from the oracle server by calling the audit status marking contract, and the audit result information in the blockchain system is updated according to the third audit result. After the audit status marking contract retrieves the third audit result from the oracle server, the audit record identifier of the third audit result in the oracle server can be changed to the first identifier to indicate that the audit result in the blockchain system has been synchronized with the audit result in the oracle server and is the latest audit result.

[0166] In actual applications, a request to audit the target data based on the updated audit policy can be initiated by a server that performs content security management on the data already on the chain. The server can determine the data that needs to be audited according to the updated audit policy among the data already on the chain. Here, it is assumed that the target data is the data that needs to be audited according to the updated audit policy.

[0167] To more clearly illustrate the blockchain data query and data upload methods provided in the examples of this manual, Figure 4 A swim lane diagram of a method for uploading data to a blockchain provided in an embodiment of this specification. The solution may include a data acquisition phase, a review phase, and an uploading phase, which may specifically include:

[0168] Step 402: The uplink server with data uplink function obtains a data uplink request for target data, and the request includes the target data to be uplinked.

[0169] Step 404: The on-chain server may generate an audit request for the target data based on the acquired target data, and send the audit request to the audit server, calling the audit server to perform a content security audit on the target data.

[0170] Step 406: The audit server may perform a content security audit on the target data.

[0171] Step 408: After completing the audit, the audit server feeds back the first audit result to the uplink server.

[0172] In the implementation and application, the audit server may need a long time to complete the audit because the target data to be audited is large or complex. In order to reduce the impact on the uplink service of the uplink server in the embodiment of this specification, it is allowed to process the data that has not been audited yet on the chain first.

[0173] Step 410: Determine whether the uplink server has fed back a first audit result indicating that the target data has passed or failed the audit within a preset time after sending the request.

[0174] Step 412: If the first audit result fed back by the audit server is not received within the preset time, the target data can be sent to the blockchain system to execute the data chain process.

[0175] Among them, if the first audit result fed back by the audit server is not received within the preset time, the audit status of the target data can be determined as an incomplete audit state, and the first audit status identifier indicating that the target data is in an incomplete audit state can be used to represent the current status of the target data.

[0176] Step 414: If the first audit result fed back by the audit server is received within a preset time, it can be determined whether the first audit result is an audit result indicating that the audit is passed.

[0177] Step 416: If the first audit result indicates an audit result that fails the audit, uploading the target data to the blockchain system may be refused.

[0178] If the first audit result indicates a passed audit result, step 412 may be executed to send the target data to the blockchain system to execute the on-chain process. The current state of the target data may also be indicated by a first audit status identifier indicating that the target data is in a state of passed audit.

[0179] Step 418: The audit server may also send the first audit result for the target data to an oracle server with an oracle function. In actual applications, the first audit result in the oracle server may also be sent by the uplink server, and the specific sending method is not specifically limited here.

[0180] Step 420: After obtaining the first audit result, the oracle server may mark the audit record identifier of the first audit result as a second identifier to indicate that the audit status information of the target data in the oracle server has not been synchronized to the blockchain system.

[0181] Step 422: After the on-chain server sends the target data to the blockchain system, the blockchain system can receive the target data

[0182] Step 424: After obtaining the target data, the blockchain system may send a request for retrieving the audit result of the target data.

[0183] Step 426: The oracle server sends the first audit result to the blockchain system, and the blockchain system retrieves the first audit result from the oracle server.

[0184] Among them, if the audit server has not completed the audit of the target data, the oracle server may not contain the audit results of the target data, and the blockchain system cannot retrieve the audit results from the oracle server. It can be determined that the audit status of the target data is an incomplete audit state; or, if the audit server has not completed the audit of the target data, the oracle server can determine that the target data is in an incomplete audit state based on the audit notification received by the audit server for the target data. The oracle server can also record audit status information indicating that the target data is in an incomplete audit state. The blockchain system can retrieve the audit status information indicating that the target data is in an incomplete audit state and determine that the audit status of the target data is an incomplete audit state.

[0185] After the subsequent audit server completes the audit of the target data, the audit result can be sent to the oracle server. The blockchain system can obtain the audit result from the oracle server and update the audit status identifier of the target data in the blockchain based on the audit result.

[0186] Step 428: The blockchain system may determine the first audit status information of the target data according to the obtained first audit result, and save the first audit status identifier corresponding to the first audit status information into the world status database.

[0187] Step 430: After the oracle server retrieves the audit result in the blockchain system, the audit record identifier of the first audit result in the oracle server may be marked as the first identifier, which is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system.

[0188] Step 432: The blockchain system may save the received target data into a blockchain database of the blockchain system.

[0189] Figure 5 A swim lane diagram of a method for querying blockchain data provided in an embodiment of this specification. Figure 5 As shown, the solution may include a request acquisition phase, a query phase, and a result sending phase. Specifically, it may include:

[0190] Step 502: A query server capable of processing query requests for querying blockchain data may obtain a query request for target data in a blockchain system; the query request includes a data identifier of the target data.

[0191] Step 504: The query server may obtain the audit status identifier for the target data based on the data identifier. The audit status identifier corresponding to the on-chain data may be stored in the world state database of the blockchain system, and the audit status identifier corresponding to the target data may be queried from the world state database based on the data identifier.

[0192] Step 506: The query server may also send a request for querying the audit record identifier corresponding to the audit status identifier of the target data to the oracle server, so as to determine whether the audit status identifier of the target data in the blockchain system is the latest audit status identifier. The oracle server may store the audit result sent by the audit server, and may also mark the audit record identifier on the audit result based on whether the blockchain system has retrieved the audit result.

[0193] Step 508: Based on the request, the oracle server can determine the audit record identifier corresponding to the target data and send the audit record identifier to the query server.

[0194] Step 510: The query server obtains the audit record identifier corresponding to the target data from the oracle server.

[0195] Step 512: According to the audit record identifier corresponding to the target data, determine whether the audit status identifier is the latest audit status identifier.

[0196] Step 514: If the audit status identifier is not the latest audit status identifier, a request for obtaining the latest audit status identifier may be sent to the oracle server.

[0197] Step 516: The oracle server may determine the latest audit status identifier of the target data and send the latest audit status identifier to the blockchain system.

[0198] Step 518: The blockchain system obtains the latest audit status identifier from the oracle server.

[0199] Step 520: Update the audit status identifier of the target data in the blockchain system.

[0200] Step 522: Determine whether the target data meets the preset audit status according to the audit identifier. If the audit status identifier obtained in step 510 is the latest audit status identifier, it is possible to determine whether the target data meets the preset audit status according to the audit status identifier. If the audit status identifier in the world state database is updated according to the latest audit status information obtained from the oracle server, it is also possible to determine whether the target data meets the preset audit status according to the updated audit status identifier.

[0201] Step 524: The target data meets the preset review status and can be obtained from the blockchain node of the blockchain system.

[0202] Step 526: Send the target data to the initiator of the query request.

[0203] Step 528: If the target data does not meet the preset review status, the target data may be refused to be removed from the chain.

[0204] In the embodiments of this specification, the query server can be a server outside the blockchain system, or it can be a server corresponding to a node with a query function in the blockchain system. This is only to illustrate that the method in the embodiments of this specification distinguishes the query server from the blockchain system. The execution subject of the above steps can be set according to actual needs. This is only a schematic description without specific limitations. Similarly, the above-mentioned query server, chain server, audit server, and oracle server can be the same server or different servers; they can be servers in the blockchain system or servers outside the blockchain system. The use and distribution of specific servers can be set according to actual needs and are not specifically limited here. Among them, when the query server is a server in the blockchain system, the query process for the target data can be executed based on the smart contract.

[0205] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method. Figure 6 This is a schematic diagram of the structure of a blockchain data query device provided in an embodiment of this specification. Figure 6 As shown, the device may include:

[0206] A request acquisition module 602 is used to acquire a query request for target data in the blockchain system; the query request includes a data identifier of the target data;

[0207] An identification acquisition module 604 is used to acquire a review status identification for the target data based on the data identification;

[0208] The data acquisition module 606 is used to acquire the target data from the blockchain node if the audit status identifier indicates that the target data meets the preset audit status.

[0209] The data sending module 608 is used to send the target data to the initiator of the query request.

[0210] Figure 7 This is a schematic diagram of the structure of a data uplink device provided in an embodiment of this specification. Figure 7 As shown, the device may include:

[0211] The uplink request acquisition module 702 is used to acquire a data uplink request for target data; the data uplink request includes the target data;

[0212] The audit sending module 704 is used to send the target data to the audit server; the audit server is used to perform content security audit on the target data;

[0213] The uplink module 706 is configured to upload the target data to the blockchain system if the first audit result indicating that the audit is passed is received from the audit server within a preset time or if the first audit result is not received from the audit server within the preset time;

[0214] The on-chain termination module 708 is used to refuse to upload the target data to the blockchain system if a first audit result indicating that the audit failed is received from the audit server within a preset time.

[0215] Based on the same idea, the embodiments of this specification also provide a device corresponding to the above method.

[0216] Figure 8 The following is a schematic diagram of the structure of a device for querying blockchain data and a device for uploading data to the blockchain provided in the embodiments of this specification. The device for querying blockchain data and the device for uploading data to the blockchain may have the same structure. Figure 8 As shown, the device 800 may include:

[0217] at least one processor 810; and,

[0218] A memory 830 in communication with the at least one processor; wherein,

[0219] The memory 830 stores instructions 820 executable by the at least one processor 810.

[0220] Corresponding to the embodiment of this specification Figure 2 In the method for querying blockchain data, the instruction is executed by the at least one processor 810 so that the at least one processor 810 can:

[0221] Obtaining a query request for target data in a blockchain system; the query request includes a data identifier of the target data;

[0222] Based on the data identifier, obtaining a review status identifier for the target data;

[0223] If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node;

[0224] The target data is sent to the initiator of the query request.

[0225] Corresponding to the embodiment of this specification Figure 3 In the method for uploading data to a link, the instruction is executed by the at least one processor 810 so that the at least one processor 810 can:

[0226] Obtaining a data uplink request for target data; the data uplink request includes the target data;

[0227] Sending the target data to an audit server; the audit server is used to perform content security audit on the target data;

[0228] If the first audit result indicating that the audit is passed is received from the audit server within the preset time, or if the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system;

[0229] If a first audit result indicating that the audit has failed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system.

[0230] Based on the same idea, the embodiment of this specification also provides a computer-readable medium corresponding to the above method. The computer-readable medium stores computer-readable instructions, which can be executed by a processor to implement the above blockchain data query method or data on-chain method.

[0231] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. Figure 8 As for the device shown, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0232] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0233] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0234] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0235] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0236] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0237] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0238] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0239] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0240] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0241] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0242] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media 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, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0243] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0244] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0245] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0246] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for querying blockchain data, comprising: Obtain query requests for target data in the blockchain system; The query request includes the data identifier of the target data; Determine whether the audit status of the target data in the oracle server has been synchronized to the blockchain system; If yes, obtaining a review status identifier for the target data based on the data identifier; If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node; The target data is sent to the initiator of the query request.

2. According to the method of claim 1, the step of obtaining the audit status identifier for the target data comprises: The audit status identifier for the target data is obtained from a world status database of the blockchain system.

3. The method according to claim 2, before obtaining the audit status identifier for the target data from the world status database of the blockchain system, further comprises: Determine whether the audit status identifier for the target data in the world status database of the blockchain system is the latest audit status identifier.

4. According to the method of claim 3, the determining whether the audit status identifier for the target data in the world status database of the blockchain system is the latest audit status identifier specifically comprises: Obtaining a first audit record identifier of the target data from a oracle server having a oracle function; Determining whether the first audit record identifier is the first identifier; The first identifier is used to indicate that the review status of the target data in the oracle server has been synchronized to the world status database of the blockchain system; The obtaining the audit status identifier for the target data from the world status database of the blockchain system specifically includes: If the first audit record identifier is the first identifier, the audit status identifier for the target data is obtained from the world status database of the blockchain system.

5. The method according to claim 4, after determining whether the audit record identifier is the first identifier, further comprising: If the first audit record identifier is the second identifier, obtaining the audit status information of the target data from the oracle server; The second identifier is used to indicate that the review status of the target data in the oracle server is not synchronized to the world state database; The audit status identifier of the target data in the world state database of the blockchain system is updated based on the audit status information of the target data obtained from the oracle server.

6. According to the method of claim 1, the step of obtaining the audit status identifier for the target data comprises: Sending an audit query request for obtaining audit status information of the target data to an oracle server having an oracle function; Obtain a first review status identifier for the target data fed back by the oracle server.

7. According to the method of claim 6, after obtaining the first review status identifier of the content of the target data fed back by the oracle, the method further comprises: Acquire a second audit status identifier of the target data from a world status database of the blockchain system; Determining whether the audit status indicated by the first audit status identifier is consistent with the audit status indicated by the second audit status identifier; If they are inconsistent, the second audit status identifier in the world status database of the blockchain system is updated according to the first audit status identifier.

8. The method according to claim 1, further comprising: If the audit status identifier indicates that the target data does not conform to the preset audit status, the process of sending the target data to the initiator of the query request is terminated.

9. The method according to claim 8, wherein the audit status identifier includes an identifier indicating an audit status in which the audit is not completed; Before terminating the process of sending the target data to the initiator of the query request, the method further includes: Sending a prompt message indicating a later access to the initiator of the query request.

10. A method for uploading data to a blockchain, comprising: Obtaining a data uplink request for target data; the data uplink request includes the target data; Sending a review request for the target data to a review server; The audit server is used to perform content security audit on the target data; If the first audit result indicating that the audit is passed is received from the audit server within the preset time, or if the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system; If a first audit result indicating that the audit has not passed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system; the first audit result is stored in the oracle server; When the audit status information of the target data in the oracle server has been synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the first identifier; When the audit status information of the target data in the oracle server is not synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the second identifier.

11. The method according to claim 10, wherein uploading the target data to the blockchain system specifically comprises: The target data is uploaded to the blockchain database of the blockchain system.

12. The method according to claim 10, further comprising: Determining a first audit status identifier of the target data based on the first audit result indicating audit passing fed back by the audit server received within the preset time or the first audit result fed back by the audit server not received within the preset time; The first audit status identifier of the target data is saved in the blockchain system.

13. According to the method of claim 10, the oracle server having a oracle function is used to receive the first audit result sent by the audit server, and the method further includes: Obtaining the first audit result from the oracle server; The audit record identifier of the first audit result in the oracle server is marked as a second identifier; The second identifier is used to indicate that the review status information of the target data in the oracle server is not synchronized to the blockchain system; After obtaining the first audit result from the oracle server, the audit record identifier of the first audit result in the oracle server is marked as a first identifier; the first identifier is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system.

14. The method according to claim 10, when the first audit result fed back by the audit server is not received within the preset time, the method further comprises: After uploading the target data to the blockchain system, obtaining a second audit result for the target data; The second audit result is the audit result fed back after the audit server completes the audit of the target data after the preset time period; Based on the second audit result, determining a second audit status identifier of the target data; The second review status identifier is saved in the blockchain system.

15. According to the method of claim 14, the step of saving the second audit status identifier to the blockchain system specifically comprises: The first audit status identifier is updated based on the second audit status identifier.

16. According to the method of claim 14, the oracle server with a oracle function is used to receive the second audit result sent by the audit server, and the obtaining of the second audit result for the target data specifically includes: Obtaining the second audit result from the oracle server; marking the audit record identifier of the second audit result in the oracle server as a second identifier; The second mark is used to indicate that the audit status information of the target data in the oracle server is not synchronized to the blockchain system; The method further comprises: After obtaining the second audit result from the oracle server, the audit record identifier of the second audit result in the oracle server is marked as the first identifier; the first identifier is used to indicate that the audit status information of the target data in the oracle server has been synchronized to the blockchain system.

17. The method according to claim 12, further comprising: Obtaining a third audit result for the target data; The third audit result is an audit result obtained by the audit server auditing the target data based on the changed audit policy; Determining whether the third audit result is consistent with the audit result indicated by the first audit mark; If they are inconsistent, the first audit status identifier in the blockchain system is updated based on the third audit result.

18. A device for querying blockchain data, comprising: A request acquisition module is used to obtain query requests for target data in the blockchain system; The query request includes the data identifier of the target data; An identification acquisition module, used to determine whether the audit status of the target data in the oracle server has been synchronized to the blockchain system; if so, based on the data identifier, obtain the audit status identifier for the target data; A data acquisition module, configured to acquire the target data from a blockchain node if the audit status identifier indicates that the target data meets a preset audit status; A data sending module is used to send the target data to the initiator of the query request.

19. A device for uploading data to a link, comprising: An uplink request acquisition module, used to acquire a data uplink request for target data; the data uplink request includes the target data; An audit sending module, used for sending the target data to an audit server; The audit server is used to perform content security audit on the target data; An uplink module, configured to upload the target data to the blockchain system if a first audit result indicating that the audit is passed is received from the audit server within a preset time or if the first audit result is not received from the audit server within the preset time; The on-chain termination module is used to refuse to upload the target data to the blockchain system if a first audit result indicating that the audit has not passed is received from the audit server within a preset time; the first audit result is stored in the oracle server; When the audit status information of the target data in the oracle server has been synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the first identifier; When the audit status information of the target data in the oracle server is not synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the second identifier.

20. A device for querying blockchain data, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtaining a query request for target data in a blockchain system; the query request includes a data identifier of the target data; Determine whether the audit status of the target data in the oracle server has been synchronized to the blockchain system; If yes, obtaining a review status identifier for the target data based on the data identifier; If the audit status identifier indicates that the target data meets the preset audit status, the target data is obtained from the blockchain node; The target data is sent to the initiator of the query request.

21. A device for uploading data to a blockchain, comprising: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to: Obtaining a data uplink request for target data; the data uplink request includes the target data; Sending the target data to an audit server; the audit server is used to perform content security audit on the target data; If the first audit result indicating that the audit is passed is received from the audit server within the preset time, or if the first audit result is not received from the audit server within the preset time, the target data is uploaded to the blockchain system; If a first audit result indicating that the audit has failed is received from the audit server within a preset time, the target data is refused to be uploaded to the blockchain system; the first audit result is stored in the oracle server; when the audit status information of the target data in the oracle server has been synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the first identifier; when the audit status information of the target data in the oracle server has not been synchronized to the blockchain system, the audit record identifier of the first audit result is marked as the second identifier.

22. A computer-readable medium having computer-readable instructions stored thereon, wherein the computer-readable instructions can be executed by a processor to implement the method for blockchain data query described in any one of claims 1 to 9 or the method for uploading data to a blockchain described in any one of claims 10 to 17.

Citation Information

Patent Citations

  • Uplink method, uplink device and node equipment

    CN112711777A

  • Data auditing method and device based on block chain, server and storage medium

    CN112965900A