Data processing method and device based on block chain, equipment, medium and product
By generating random numbers and verifying data processing requests in the blockchain system, the problem of accurate determination of blockchain node service reliability is solved, achieving more accurate service reliability determination and improved network security.
Patent Information
- Application Number
- CN202410499160.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-19
- Publication Date
- 2025-10-24
AI Technical Summary
In existing blockchain systems, blockchain nodes may choose to minimize resource usage and ignore the quality of services such as data query, resulting in an inability to accurately determine their service reliability.
By querying the target block height of the blockchain to generate a random number, the data processing method is randomly determined, and a data processing request carrying the random number and proof content is sent to the second blockchain node. The response result is received and verified to determine the service reliability of the node.
It achieves accurate judgment of the reliability of blockchain node services, improves the transparency and security of the blockchain network, prevents interference from malicious nodes, and ensures the fairness and integrity of data processing.
Smart Images

Figure CN120832379A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchains, and in particular to a data processing method and device based on a blockchain, equipment, a medium and a product. BACKGROUND
[0002] With the advent of the technology era and the development of mobile Internet, the pace of network revolution is also getting faster and faster, and the process of realizing information fusion in the same field or multiple fields and providing customers with all-round information solutions also faces new challenges such as improvement of system architecture and transfer of support focus. Therefore, the blockchain technology gradually becomes the preferred way of storing and trading data in various fields due to its natural advantages in storing and managing data.
[0003] At present, the blockchain can realize the trusted consensus of blocks, but usually cannot guarantee that the blockchain node can provide reliable services. For example, in some traditional blockchain systems, the blockchain node may choose to minimize resource usage and only maintain the most basic functions related to the consensus mechanism, while ignoring the quality of services such as data query. Therefore, in order to guarantee that the blockchain node can provide reliable services, it is necessary to regularly or irregularly check the service reliability of the blockchain node, and the service reliability of the blockchain node is closely related to the response of the blockchain node to the data processing request, and how to determine the response of the blockchain node to the data processing request is a problem to be solved. SUMMARY
[0004] The embodiments of the present application provide a data processing method and device based on a blockchain, equipment, a medium and a product, which can accurately determine the response determination result of the blockchain node to the data processing request, thereby facilitating accurate determination of the service reliability of the blockchain node.
[0005] In one aspect, the embodiments of the present application provide a data processing method based on a blockchain, which comprises:
[0006] querying a target block height of the blockchain, and generating a first random number according to the target block height;
[0007] determining data processing instruction information according to the first random number, a data interface provided by the first blockchain node and parameters input in the data interface;
[0008] sending a data processing request carrying the data processing instruction information to a second blockchain node;
[0009] receiving a request result returned by the second blockchain node in response to the data processing request, and determining a response determination result of the second blockchain node according to the request result;
[0010] If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the data processing request is used to request the second blockchain node to return the first content and the second content, the second content including the second proof content in the proof list of the second blockchain node and the second random number corresponding to the second proof content.
[0011] If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the data processing request is used to request the second blockchain node to return the first content and the second content, the second content including the second proof content in the proof list of the second blockchain node and the second random number corresponding to the second proof content.
[0012] Correspondingly, an embodiment of the present application provides a data processing device based on a blockchain, which comprises:
[0013] a processing unit configured to query a target block height of the blockchain, generate a first random number according to the target block height, and determine data processing indication information according to the first random number, a data interface provided by a first blockchain node, and parameters transmitted in the data interface;
[0014] a transceiving unit configured to send a data processing request carrying the data processing indication information to a second blockchain node, and receive a request result returned by the second blockchain node for the data processing request;
[0015] the processing unit is further configured to determine a response determination result of the second blockchain node according to the request result;
[0016] If the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is a blockchain node corresponding to the data processing device, and the data processing request further carries the first random number and first proof content of the first random number, the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return the first content after the first random number is verified, the first content including a result obtained by executing the data processing indicated by the data processing indication information.
[0017] If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the data processing request is used to request the second blockchain node to return the first content and the second content, and the second content includes the second proof content in the proof list of the second blockchain node and the second random number corresponding to the second proof content.
[0018] Correspondingly, an embodiment of the present application provides a computer device, which comprises:
[0019] a processor adapted to implement a computer program;
[0020] a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being adapted to be loaded and executed by the processor to perform the above-mentioned blockchain-based data processing method.
[0021] Correspondingly, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, the computer program being read and executed by the processor of the computer device to cause the computer device to perform the above-mentioned blockchain-based data processing method.
[0022] Correspondingly, an embodiment of the present application provides a computer program product, the computer program product comprising a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program to cause the computer device to perform the above-mentioned blockchain-based data processing method.
[0023] In the embodiment of the present application, the first random number is generated according to the target block height of the blockchain, and the data processing indication information is determined according to the first random number, the data interface provided by the first blockchain node and the parameters transmitted in the data interface, so that the data processing mode can be randomly determined based on the random number; the data processing request carrying the data processing indication information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request, that is, the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request carrying the random data processing mode, which is different from the way of determining the response determination result of the second blockchain node according to the request result returned by the second blockchain node for the data processing request carrying the fixed data processing mode, so that the request result of the second blockchain node for different data processing modes can be randomly verified, and better universality and verification integrity can be achieved, so that a more accurate response determination result can be obtained. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined. BRIEF DESCRIPTION OF DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0025] Figure 1 is a structural schematic diagram of a data sharing system provided by an embodiment of the present application;
[0026] Figure 2 is a structural schematic diagram of a blockchain node provided by an embodiment of the present application;
[0027] Figure 3 is an architectural schematic diagram of a data processing system provided by an embodiment of the present application;
[0028] Figure 4 is a flow schematic diagram of a data processing method based on a blockchain provided by an embodiment of the present application;
[0029] Figure 5 is a schematic diagram of a normal response ratio of a data processing request provided by an embodiment of the present application;
[0030] Figure 6 is a flow schematic diagram of another data processing method based on a blockchain provided by an embodiment of the present application;
[0031] Figure 7 is an interaction schematic diagram of a passive proof module of a blockchain node based on VRF provided by an embodiment of the present application;
[0032] Figure 8 is a flow schematic diagram of a target blockchain node passively receiving a VRF spot check data interface of other blockchain nodes and performing verification provided by an embodiment of the present application;
[0033] Figure 9 is a flow schematic diagram of still another data processing method based on a blockchain provided by an embodiment of the present application;
[0034] Figure 10 is an interaction schematic diagram of an active proof module of a blockchain node based on VRF provided by an embodiment of the present application;
[0035] Figure 11 is a flow schematic diagram of a target blockchain node actively providing VRF proof, and other blockchain nodes calling corresponding data interfaces for query and verification provided by an embodiment of the present application;
[0036] Figure 12 is a structural schematic diagram of a data processing device based on a blockchain provided by an embodiment of the present application;
[0037] Figure 13 is a schematic diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0039] The terms used in the following embodiments of the present application are only for the purpose of describing the specific embodiments, and are not intended to be limiting to the present application. As used in the specification and the appended claims of the present application, the singular forms “a,” “an,” and “the” are intended to include plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in the present application means and includes any or all possible combinations of one or more listed items.
[0040] It should be noted that the “first”, “second”, and the like described in the embodiments of the present application are only for the purpose of description, and cannot be understood as indicating or implying the relative importance of the indicated technical features or implicitly indicating the number of the indicated technical features. Therefore, the technical features limited by “first” and “second” can explicitly or implicitly include at least one of the features.
[0041] In order to more clearly understand the technical solutions provided by the embodiments of the present application, some technical terms related to the technical solutions are introduced here:
[0042] (1) Blockchain:
[0043] Blockchain is a distributed ledger technology in the field of information technology, which generally consists of consensus, transaction blocks, and state data storage, cryptography identity security, etc. Since the ledger is distributed and the blocks are consensus-based, it has the characteristics of non-tamperability, traceability, and common maintenance.
[0044] State data is a data structure used in blockchain systems to represent the current state of the system. This data includes the balances of all accounts, the status of smart contracts, and other relevant information. State data is continuously updated as transactions are executed, reflecting the global state of the blockchain system at a given point in time. In blockchain systems, state data is typically stored in the form of Merkle trees or other encrypted data structures to ensure its integrity and security.
[0045] (2) Blockchain network:
[0046] The blockchain network is a point-to-point connected network. Based on a specific type of network protocol, the blockchain network does not require a central node to maintain the network status between the blockchain nodes. Instead, each blockchain node maintains the node status of the entire network and the connection status between its adjacent nodes through broadcast interactions with adjacent nodes.
[0047] The blockchain network can be understood as Figure 1 The data sharing system 100 shown is shown. The data sharing system 100 refers to a system for sharing data between nodes. The data sharing system may include multiple (multiple may include two or more) blockchain nodes 101. The multiple blockchain nodes 101 may refer to various clients, terminal devices or servers in the data sharing system. Each blockchain node 101 may receive input information (for example, the data processing request involved in the embodiment of the present application) when performing normal operations, and maintain the shared data in the data sharing system based on the received input information. In order to ensure information intercommunication within the data sharing system, an information connection may exist between each blockchain node in the data sharing system, and information can be transmitted between blockchain nodes through the above-mentioned information connection. For example, when any blockchain node in the data sharing system receives input information, the other nodes in the data sharing system obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all blockchain nodes in the data sharing system are consistent.
[0048] For each blockchain node in the data sharing system, a node identifier corresponding to the blockchain node is provided, and each blockchain node in the data sharing system can store node identifiers of other blockchain nodes in the data sharing system, so as to subsequently broadcast the generated block to other blockchain nodes in the data sharing system according to the node identifiers of the other blockchain nodes. Each blockchain node can maintain a node identifier list as shown in Table 1, and the node name and the node identifier are stored in the node identifier list. The node identifier can be an IP (Internet Protocol) address and any other information that can be used to identify the blockchain node. Table 1 only takes the IP address as an example for illustration:
[0049] Table 1
[0050] Node name Node identification Node 1 000.000.000.000 Node 2 111.111.111.111 … … Node N NNN.NNN.NNN.NNN
[0051] The blockchain nodes in the blockchain network can be servers or terminal devices. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Networks), and big data and artificial intelligence platforms. The terminal device can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The blockchain nodes can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.
[0052] Further, please refer to Figure 2 , Figure 2 It is shown that Figure 1 The blockchain node in the blockchain network shown in FIG. 2 includes a network module 21, a verification module 22, a transaction pool module 23, a consensus module 24, a scheduling module 25, a storage module 26, and a VRF (Verifiable Random Function) module 27.
[0053] The network module 21 is used to process all communications between the blockchain node and other blockchain nodes in the blockchain network. The communication includes sending and receiving of data (for example, data processing requests and request results involved in the embodiments of the present application), connection management, and possible network protocol implementation. The network module 21 can ensure that information can be safely and efficiently transmitted between the blockchain nodes.
[0054] The verification module 22 is a set of verification processes for all incoming requests to the blockchain node, such as data processing requests related to the embodiments of the present application. Among them, the verification module 22 can include two sub-modules of certificate verification and authority verification;
[0055] Certificate verification is used to verify the identity certificate of the data processing request after receiving the data processing request sent by other blockchain nodes, to ensure that both parties of the interaction are trustworthy.
[0056] Authority verification is used to check whether the blockchain node sending the data processing request (i.e. the requestor) has the authority to execute the data processing request. For example, whether it has the authority to view certain data or call certain service providers. Among them, service providers usually refer to various services provided by blockchain nodes to the outside world, such as transaction processing, smart contract execution, data storage and retrieval, etc. These services are crucial for the normal operation of the blockchain network and the user experience. In the embodiments of the present application, service providers can specifically refer to query and data retrieval services provided by blockchain nodes to the outside world, which enable users to query the state of the blockchain, transaction logs and other related information.
[0057] The transaction pool module 23 is used to collect and maintain transactions that have not been packaged into blocks, and to provide candidate transactions for block generators. Among them, the transaction pool is a data structure in the blockchain network, used to store pending transactions that have not been packaged into blocks. When a user submits a new transaction to the blockchain network, the transaction will first enter the transaction pool. When a blockchain node is preparing to generate a new block, it will select a certain number of transactions from the transaction pool for packaging. The transaction pool helps to improve the processing capacity of the blockchain network.
[0058] The consensus module 24 is used to implement the consensus mechanism of the blockchain, to ensure that all blockchain nodes in the blockchain network agree on the state of the blockchain. This may include implementing specific consensus algorithms such as Proof of Work (PoW), Proof of Stake (PoS) or others.
[0059] The scheduling module 25 is responsible for coordinating the core functions of the blockchain node, including block generation and smart contract execution. Among them, the scheduling module 25 can include block generators, virtual machine engines, contract repositories and contract process pools;
[0060] The block generator is used to create new blocks, including selecting transactions, executing transactions, calculating block hashes, etc.
[0061] The virtual machine engine is an environment for executing smart contract code, usually sandboxed to isolate and limit the execution of contract code.
[0062] A contract repository is configured to store the code and related data of deployed smart contracts.
[0063] A contract process pool is configured to manage and execute smart contract processes, and can handle multiple contract calls in parallel.
[0064] A smart contract is a protocol defined in digital form and needs to run in a trusted environment, such as a blockchain platform. A smart contract is a contract that runs in network space relying on a computer, which spreads, verifies or executes in an informationized way, is read and executed by a computer, and has the characteristics of self-service. The decentralization of the blockchain and the tamper-proofing of the data determine that the smart contract is more suitable for implementation on the blockchain. Therefore, the development of blockchain technology has made the smart contract have a broader development prospect. A smart contract is actually a program composed of computer code, and its conclusion process is: first, the parties or multiple users involved in the conclusion agree to jointly formulate an intelligent contract after negotiation; second, the intelligent contract is broadcast and stored to all the nodes of the blockchain network; third, the successfully constructed intelligent contract waits for the conditions to be met and automatically executes the contract content.
[0065] The storage module 26 is configured to store block data and state information (for example, the response determination result involved in the present application), and can include an effective node sliding window, an effective node linked list, a block ledger, and a state database:
[0066] The effective node sliding window is configured to record the response determination result, so as to evaluate the service quality of the blockchain node.
[0067] The effective node linked list is configured to determine the response normal proportion of the blockchain node (any one of the blockchain nodes except the current blockchain node) according to the multiple response determination results of the blockchain node in the effective node sliding window, and determine whether the block of the blockchain node can be accessed according to the response normal proportion of the blockchain node.
[0068] The block ledger is configured to store the chain structure of all confirmed blocks, including transaction logs and block metadata. The block ledger is a core data structure in the blockchain system, used to store and manage all confirmed blocks. The block ledger is organized in a chain structure, and each block contains a set of transactions, a block header (including the hash value of the previous block, a timestamp, and other metadata), and other information. The block ledger provides a public and tamper-proof transaction log record for the blockchain system, ensuring the transparency and consistency of the system.
[0069] The state database is configured to store the current state of the blockchain, such as account balance, smart contract state, etc.
[0070] The VRF module 27 is the core of the VRF. The VRF module 27 can include a VRF random number generator, a VRF verifier, and a proof list.
[0071] The VRF random number generator is configured to generate a random number and proof of the random number by the VRF according to the block height.
[0072] The VRF verifier is configured to verify the validity of the received random number and proof of the random number using the public key of the blockchain node that sent the data processing request.
[0073] The VRF is a cryptographic tool that provides a method for generating random numbers and can provide a proof to verify the correctness of the random numbers. The VRF ensures that the generation of random numbers is both random and unpredictable, while being verifiable. In this application, the VRF is used to randomly select service interfaces and parameters for verification.
[0074] The proof list is configured to store the generated random number and proof of the random number for auditing and verification.
[0075] The data processing system provided by the embodiments of the present application will be described below with reference to the accompanying drawings. The data processing system is suitable for implementing the data processing method based on the blockchain provided by the embodiments of the present application.
[0076] As shown in Figure 3 , the data processing system can include a target blockchain node 301 and at least one second blockchain node 302 in a blockchain network. The embodiments of the present application do not limit the connection mode between the target blockchain node 301 and the second blockchain node 302. The target blockchain node 301 and the second blockchain node 302 can establish a direct communication connection through wired communication, or the target blockchain node 301 and the second blockchain node 302 can establish an indirect communication connection through wireless communication.
[0077] In the data processing system composed of the target blockchain node 301 and the second blockchain node 302, the target blockchain node can be any one of the blockchain nodes in the data sharing system 100; the second blockchain node 302 can be any one of the blockchain nodes in the data sharing system 100 except the target blockchain node.
[0078] Based on the data processing system composed of the target blockchain node 301 and at least one second blockchain node 302, the checking and proving process of the target blockchain node 301 will be described in detail. As shown in Figure 3As shown, the target blockchain node 301 can query the target block height of the blockchain, and generate a random number of the target blockchain node 301 according to the target block height, that is, a first random number; the target blockchain node 301 can determine the data processing indication information according to the first random number, the data interface provided by the target blockchain node 301, and the parameters transmitted in the data interface, that is, randomly determine the data processing mode through the first random number. The target blockchain node 301 sends a data processing request carrying the data processing indication information to the second blockchain node 302. The second blockchain node 302 receives the data processing request carrying the data processing indication information, obtains a request result according to the data processing request, and returns the request result to the target blockchain node 301. The target blockchain node 301 can receive the request result returned by the second blockchain node for the data processing request. The target blockchain node 301 can also include determining a response determination result of the second blockchain node according to the request result, and the response determination result can include a first response determination result or a second response determination result, the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request, and the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request.
[0079] Based on Figure 3 As shown in the data processing system, the response determination result of the blockchain node for the data processing request can be accurately determined, thereby facilitating accurate determination of the service reliability of the blockchain node. It can be understood that the data processing system described in the embodiments of the application is for more clearly illustrating the technical solutions of the embodiments of the application, and does not constitute a limitation on the technical solutions provided by the embodiments of the application. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided by the embodiments of the application are also applicable to similar technical problems.
[0080] The data processing method based on the blockchain network provided by the embodiments of the application will be described in further detail below with reference to the accompanying drawings.
[0081] Please refer to Figure 4 , Figure 4 is a flow diagram of a data processing method based on a blockchain provided by the embodiments of the application, as Figure 4 shown, the data processing method based on the blockchain can be executed by a computer device, for example, the computer device can be a target blockchain node in the data processing system as Figure 3 shown. As Figure 4 shown, the data processing method based on the blockchain can include but is not limited to the following steps S401-S404:
[0082] S401, query the target block height of the blockchain, and generate a first random number according to the target block height.
[0083] In the embodiments of the present application, the target blockchain node queries the current latest block height of the stored blockchain, that is, the maximum block height among the block heights corresponding to the plurality of blocks on the blockchain. For example, the blockchain includes a genesis block, block 1, …, block 100, a total of 101 blocks, and the corresponding block heights are 0, 1, …, 100, respectively. The maximum block height is 100, that is, the target block height of the queried blockchain.
[0084] The target blockchain node processes the target block height by using a VRF to generate a first random number and a first proof content of the first random number, wherein the VRF is a method for generating a random number, and the first random number is a verifiable random number, that is, the first proof content can be used to prove the first random number.
[0085] S402, determining data processing indication information according to the first random number, the data interface provided by the first blockchain node, and the parameters transmitted in the data interface.
[0086] In the embodiments of the present application, the data interface provided by the first blockchain node is all the service interfaces provided by the first blockchain node, which can be a data query interface, a data comparison interface, etc. The parameters transmitted in the data interface can be a block identifier (such as a certain block represented by a block height), a transaction serial number, etc.
[0087] After the target blockchain generates the first random number, in order to ensure that the called data interface and the parameters transmitted in the data interface are random, the target blockchain can determine the data processing indication information according to the first random number, the data interface provided by the first blockchain node, and the parameters transmitted in the data interface. The data processing indication information can include a data processing mode associated with the matching data interface and a data feature associated with the matching parameter.
[0088] In a feasible implementation manner, the target blockchain node numbers the data interfaces provided by the first blockchain node and numbers the parameters transmitted in the data interfaces; then, the target blockchain node takes the number of the data interfaces provided by the first blockchain node as a modulus of the first random number to obtain a first numerical value; the target blockchain node determines a matching data interface from the data interfaces provided by the first blockchain node, the number of which matches the first numerical value, and takes the number of the parameters transmitted in the matching data interface as a modulus of the first random number to obtain a second numerical value; the target blockchain node determines a matching parameter from the parameters transmitted in the matching data interface, the number of which matches the second numerical value; and the target blockchain node determines the data processing indication information according to the data processing mode associated with the matching data interface and the data feature associated with the matching parameter.
[0089] The data processing mode associated with the matching data interface can be data query, data comparison, etc., and the data feature associated with the matching parameter can be block identification (such as block height), transaction serial number, etc. For example, the matching data interface can be a block transaction query interface, the matching parameter includes a block height 100 and a transaction serial number 10, and the data processing indication information is used to indicate the transaction data with the transaction serial number 10 in the block with the block height 100.
[0090] It should be understood that the numbering manner of the target blockchain node for the data interface provided by the first blockchain node and the parameter transmitted in the data interface can be any numbering manner, for example, the numbering manner can be from small to large and start from 0, and the difference between every two adjacent numbers is 5. The specific form of the numbering manner is not limited in the present application.
[0091] In the embodiment of the present application, the target blockchain node randomly determines the data processing mode through the first random number, avoids the reliability verification of the blockchain node according to a single data processing mode for service, reduces the risk of malicious selection of data interfaces for interference by malicious blockchain nodes, and enhances the universality of the response determination result for the data processing mode.
[0092] S403, sending a data processing request carrying data processing indication information to the second blockchain node.
[0093] Correspondingly, the second blockchain node receives the data processing request carrying the data processing information sent by the target blockchain node.
[0094] If the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is the blockchain node to which the method is applied, the data processing request further carries the first random number and the first proof content of the first random number; the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return the first content after the first random number is verified, the first content including the result obtained by executing the data processing indicated by the data processing indication information.
[0095] That is, after receiving the data processing request carrying the data processing information sent by the target blockchain node, the second blockchain node verifies the first random number according to the first proof content, and verifies whether the first random number is a real VRF random number. If the first random number is verified, the second blockchain node returns the first content; if the first random number is not verified, the second blockchain node returns the verification result indicating that the signature random number is not passed.
[0096] If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the data processing request is used to request the second blockchain node to return the first content and the second content, and the second content includes the second proof content in the proof list of the second blockchain node and the second random number corresponding to the second proof content.
[0097] In an implementable embodiment, the second blockchain node performs certificate verification on the identity certificate of the target blockchain node, and the identity certificate of the target blockchain node can be sent by the target blockchain node when sending the data processing request. If the identity certificate fails the certificate verification, the request result returned by the second blockchain node can be a verification result indicating that the certificate verification fails. If the certificate verification on the identity certificate passes, the second blockchain node can perform signature verification on the target blockchain node.
[0098] In an implementable embodiment, the second blockchain node performs signature verification on the signature data of the target blockchain node, and the signature data can be obtained by the target blockchain node by signing the to-be-signed data using the private key of the target blockchain node. The to-be-signed data can be, for example, the data processing request, the data processing indication information, or the first random number.
[0099] The second blockchain node can perform signature verification on the signature data of the target blockchain node in the following manner: after receiving the data processing request sent by the target blockchain node, the second blockchain node obtains the public key corresponding to the target blockchain node, and performs signature verification on the signature data according to the public key corresponding to the target blockchain node to verify the identity of the target blockchain node. If the signature verification on the signature data passes, the second blockchain node performs permission verification on the target blockchain node. If the signature data fails the signature verification, the request result returned by the second blockchain node is a verification result indicating that the signature verification fails.
[0100] In an implementable embodiment, the second blockchain node performs permission verification on the target blockchain node. For example, in the process of permission verification, whether the target blockchain node has the permission to perform the data processing indication information can be determined. If the permission verification on the target blockchain node passes, the second blockchain node performs the data processing indicated by the data processing indication information to obtain the first content. If the target blockchain node fails the permission verification, the request result returned by the second blockchain node is a verification result indicating that the permission verification fails.
[0101] S404, receiving a request result returned by the second blockchain node for the data processing request, and determining a response determination result of the second blockchain node according to the request result.
[0102] In the embodiments of the present application, the request result can include first content, and the response determination result can include a first response determination result or a second response determination result, the first response determination result being used to indicate that the second blockchain node responds abnormally to the data processing request, and the second response determination result being used to indicate that the second blockchain node responds normally to the data processing request.
[0103] In a feasible implementation, if the target blockchain node does not receive the request result returned by the second blockchain node in response to the data processing request, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result.
[0104] In a feasible implementation, after the target blockchain node determines the response determination result of the second blockchain node according to the request result, the target blockchain node can record the response determination result of the second blockchain node; the target blockchain node acquires a plurality of recorded response determination results of the second blockchain node, and determines a normal response proportion of the second blockchain node to the data processing request of the target blockchain node according to the plurality of response determination results; and the target blockchain node processes the second blockchain node according to the normal response proportion.
[0105] In the embodiments of the present application, the number of the plurality of response determination results of the second blockchain node acquired by the target blockchain node can be a preconfigured value. For example, the number of the plurality of response determination results can be 4, and the like. Whenever the target blockchain node acquires 4 response determination results of the second blockchain node, the target blockchain node can determine the normal response proportion of the second blockchain node to the data processing request of the target blockchain node according to the 4 response determination results. It should be understood that the specific value of the plurality of response determination results can be adjusted according to actual conditions, and the present application does not limit the specific value of the plurality of response determination results.
[0106] In a feasible implementation, the recording manner of the target blockchain node for recording the response determination result of any one of the blockchain nodes other than the target blockchain node can be in the form of a table, as shown in Table 2. In Table 2, a plurality of blockchain nodes can be included, such as a blockchain node 2 and a blockchain node n, and the like, n being a positive integer greater than 1. In Table 2, the blockchain node 2 is associated with a plurality of response determination results, and the plurality of response determination results include a response determination result 2-1 to a response determination result 2-m, m being a positive integer greater than 1. The remaining blockchain nodes in Table 2 are similar, and are not described herein.
[0107] Table 2
[0108]
[0109] It should be noted that the response normality ratio can be a ratio obtained by taking the number of second response determination results in the plurality of response determination results as the dividend and the number of the plurality of response determination results as the divisor.
[0110] Further, the target blockchain node processes the second blockchain node according to the response normality ratio, specifically including: if the response normality ratio is less than or equal to the proportion threshold, adding a mark indicating that the second blockchain node is inaccessible to the second blockchain node; disconnecting the connection with the second blockchain node. If the response normality ratio is greater than the proportion threshold, the connection with the second blockchain node is maintained.
[0111] The proportion threshold can be a preconfigured threshold. For example, the proportion threshold can be 90%, etc. It should be understood that the specific value of the proportion threshold can be adjusted according to actual conditions, and the specific value of the proportion threshold is not limited in the present application.
[0112] Further, the target blockchain node can record the response determination results of any one of the blockchain nodes other than the target blockchain node to the valid node sliding window, and then record the response normality ratio of the data processing request of any one of the blockchain nodes other than the target blockchain node to the target blockchain node according to the plurality of response determination results, and finally determine whether the target blockchain node and the blockchain node maintain the connection according to the response normality ratio of any one of the blockchain nodes other than the target blockchain node and the proportion threshold.
[0113] In the case where the proportion threshold is 90%, as shown in Figure 5 , the target blockchain node is the blockchain node 1, which can obtain the response determination results of the plurality of blockchain nodes other than the blockchain node 1 (such as the blockchain node 2, the blockchain node 3, and the blockchain node 4 as shown in Figure 5 ), and record the response determination results of each blockchain node to the valid sliding window. A cuboid in the valid sliding window represents one response determination result, a cuboid filled with white represents a second response determination result, and a cuboid filled with gray represents a first response determination result. Further, the blockchain node 1 obtains the response normality ratio of each blockchain node according to the plurality of response determination results of each blockchain node in the valid sliding window, and stores the response normality ratio of each blockchain node in the valid node link table. As shown in Figure 5 , a cuboid filled with white (the response normality ratio of the blockchain node and the blockchain node) in the valid node link table represents the response normality of the blockchain node, and a cuboid filled with gray (the response normality ratio of the blockchain node and the blockchain node) represents the response abnormality of the blockchain node. In Figure 5In the specific example, the response normality ratio of the blockchain node 2 recorded by the blockchain node 1 is 100%, and the response normality ratio of the blockchain node 2 is greater than the ratio threshold, so the blockchain node 1 keeps connected with the blockchain node 2; the response normality ratio of the blockchain node 2 recorded by the blockchain node 1 is 98%, and the response normality ratio of the blockchain node 3 is greater than the ratio threshold, so the blockchain node 1 keeps connected with the blockchain node 3; the response normality ratio of the blockchain node 4 recorded by the blockchain node 1 is 70%, and the response normality ratio of the blockchain node 2 is less than the ratio threshold, so the blockchain node 1 disconnects with the blockchain node 4. Figure 5 The other blockchain nodes are similar to the above, and details are not repeated here.
[0114] In the embodiment of the application, the first random number is generated according to the target block height of the blockchain, and the data processing indication information is determined according to the first random number, the data interface provided by the first blockchain node and the parameters transmitted in the data interface, so that the data processing mode can be randomly determined based on the random number; the data processing request carrying the data processing indication information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request, that is, the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request carrying the random data processing mode, which is different from the way of determining the response determination result of the second blockchain node according to the request result returned by the second blockchain node for the data processing request carrying the fixed data processing mode, so that the request result of the second blockchain node for different data processing modes can be randomly verified, and better universality and verification integrity can be achieved, so that a more accurate response determination result can be obtained. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined.
[0115] The application scenario of the blockchain-based data processing method provided by the application can include the following six aspects:
[0116] 1. Decentralized resource platform: in the decentralized resource application, users need to have high trust in the execution of smart contracts and the flow of funds. The blockchain-based data processing method provided by the application can ensure that the nodes on the decentralized financial platform not only participate in consensus, but also provide high-quality query services such as account balance, transaction log and smart contract status. The service reliability of the blockchain node is verified through VRF, which improves the transparency and fairness of the platform, thereby increasing the confidence of users in the decentralized resource product.
[0117] 2. Supply chain management system: In supply chain management, blockchain is used to ensure the immutability and traceability of data. The blockchain-based data processing method provided in the application can be used to ensure that each blockchain node participating in the supply chain can provide real-time data access services, such as transaction records. By using VRF random interface parameter proof, the security of the system can be increased to prevent malicious nodes from manipulating data query results. The random interface parameter proof refers to using a random number generated by VRF to randomly select the data interface of the blockchain node and the parameters transmitted in the data interface, and generating a proof content to show that the selection process is random and fair. In the blockchain-based data processing method, the random interface parameter proof ensures the randomness and fairness of the verification process, so that the blockchain node cannot predict the interface and parameters to be verified, thereby increasing the security and credibility of the system.
[0118] 3. Distributed storage network: Distributed storage solutions rely on blockchain nodes in the network to store and retrieve data. The blockchain-based data processing method provided in the application can be used to ensure that the storage blockchain node provides stable and reliable data services, and periodically checks the response ability of the blockchain node through the VRF mechanism. This can improve the availability of data, and by determining the normal proportion of responses of the blockchain node according to multiple response determination results, it is determined whether to disconnect with the blockchain node, thereby improving the security and reliability of the blockchain node.
[0119] 4. Decentralized autonomous organization: A decentralized autonomous organization is a decentralized autonomous organization supported by blockchain and the like. The control and ownership of the decentralized autonomous organization is not concentrated in the hands of a certain part of the members, and each owner of the decentralized autonomous organization can participate in the community "governance" of the decentralized autonomous organization. Any member can communicate and discuss directly through social networks, and any member can vote and decide on proposals by holding tokens, thereby triggering smart contracts. The blockchain-based data processing method provided in the application can be used to ensure that the blockchain node in the decentralized autonomous organization provides necessary services, such as query of voting data and proposal status. By using VRF random interface parameter proof, the operation of the decentralized autonomous organization is transparent and fair.
[0120] 5. Blockchain as a service provider: A blockchain as a service provider can use the present solution to enhance its service quality assurance. By using VRF random interface parameter proof, the blockchain as a service provider can show its blockchain node network high reliability and service quality to customers, thereby improving the competitiveness of the blockchain as a service provider.
[0121] 6. Smart city and Internet of Things applications: In smart city and Internet of Things applications, blockchain can be used to ensure the security and integrity of data. The blockchain-based data processing method provided in the application can ensure that the blockchain nodes in the blockchain network provide real-time data processing and response services, such as collection of environmental sensing data. The VRF random interface parameter proof can ensure the quality of service of the blockchain nodes, thereby improving the reliability and efficiency of the entire system.
[0122] In these application scenarios that require highly reliable services, the blockchain-based data processing method provided in the application not only can accurately determine the response determination result of the blockchain node for the data processing request, thereby facilitating accurate determination of the service reliability of the blockchain node, but also can determine the normal response proportion of the blockchain node through multiple response determination results, and determine whether to disconnect from the blockchain node according to the required normal proportion, thereby improving the security of the blockchain.
[0123] Please refer to Figure 6 , Figure 6 is another flowchart of a blockchain-based data processing method provided by an embodiment of the application, which can be interactively executed by a target blockchain node and a second blockchain node, wherein the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node. As shown in Figure 6 , the blockchain-based data processing method can include but is not limited to the following steps S601-S611:
[0124] S601, the target blockchain node queries the target block height of the blockchain, and generates a first random number according to the target block height.
[0125] The target blockchain node queries the target block height of the blockchain and obtains the public key of the second blockchain node; the target block height and the public key of the second blockchain node are spliced to obtain spliced data; the spliced data is processed by VRF to generate a first random number and a first proof content of the first random number. Different random numbers and proof contents can be generated by splicing the target block height with the public keys of different blockchain nodes, that is, different random numbers are generated for different blockchain nodes.
[0126] In the embodiments of the present application, the target blockchain node queries the current latest block height of the blockchain stored by it, that is, the maximum block height among the block heights corresponding to the plurality of blocks on the blockchain. For example, the blockchain includes a genesis block, block 1,..., block 100, a total of 101 blocks, and the corresponding block heights are 0, 1,..., 100, respectively. The maximum block height is 100, that is, the target block height of the queried blockchain. The spliced data can be the target block height compiled into a block height in the form of a hexadecimal file, and then the block height in the form of the hexadecimal file is spliced with the public key of the second blockchain node to obtain the data. The spliced data can also be the target block height directly spliced with the public key of the second blockchain node. It should be understood that the specific form of the target block height and the public key of the second blockchain node can be adjusted according to actual conditions, and the present application does not limit the specific form of the target block height and the public key of the second blockchain node.
[0127] S602, the target blockchain node determines the data processing indication information according to the first random number, the data interface provided by the second blockchain node, and the parameters transmitted in the data interface.
[0128] The specific implementation of step S602 can refer to the related description in the foregoing embodiments, which will not be described here.
[0129] S603, the target blockchain node sends a data processing request carrying the data processing indication information to the second blockchain node.
[0130] Correspondingly, the second blockchain node receives the data processing request carrying the data processing indication information sent by the target blockchain node.
[0131] In the embodiments of the present application, the data processing request can carry the data processing indication information, the first random number, and the first proof content of the first random number.
[0132] In one embodiment, the data processing request can also carry the identity certificate of the target blockchain node and the signature information, and the signature information is obtained by the target blockchain node using the public key of the target blockchain node to sign the data processing request carrying the data processing indication information.
[0133] The specific implementation of step S603 can refer to the related description in the foregoing embodiments, which will not be described here.
[0134] S604, verifying the first random number according to the first proof content, and returning the first content after the first random number is verified.
[0135] The second blockchain node verifies the first random number by the VRF verifier on the first proof content, and returns the first content if the first random number is verified, the first content including a result obtained by performing data processing indicated by the data processing indication information; and returns a verification result indicating that the first random number is not verified if the first random number is not verified.
[0136] In one embodiment, the second blockchain node performs certificate verification on the identity certificate of the target blockchain node, performs signature verification on the signature data of the target blockchain node after the certificate verification is passed, performs authority verification on the target blockchain node after the signature verification is passed, verifies the first random number according to the first proof content after the authority verification is passed, and returns the first content after the first random number is verified.
[0137] The specific implementation of step S604 can refer to the related description in the foregoing embodiments, which will not be described here.
[0138] S605, the second blockchain node sends a request result of the data processing request to the target blockchain node.
[0139] Correspondingly, the target blockchain node receives the request result returned by the second blockchain node for the data processing request. The request result can include any one of the following results: a verification result indicating that the certificate verification is not passed, a verification result indicating that the signature verification is not passed, a verification result indicating that the authority verification is not passed, a verification result indicating that the first random number is not verified, or the first content.
[0140] S606, the target blockchain node determines a response determination result of the second blockchain node according to the request result.
[0141] The response determination result is used to indicate whether the second blockchain node responds normally to the data processing request. The response determination result can be a first response determination result or a second response determination result, the first response determination result being used to indicate that the second blockchain node responds abnormally to the data processing request, and the second response determination result being used to indicate that the second blockchain node responds normally to the data processing request.
[0142] If the request result includes any one of the following results: a verification result indicating that the certificate verification is not passed, a verification result indicating that the signature verification is not passed, a verification result indicating that the authority verification is not passed, or a verification result indicating that the first random number is not verified, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result, which is used to indicate that the second blockchain node responds abnormally to the data processing request.
[0143] If the request result includes the first content, the target blockchain node acquires third content, and compares the first content and the third content to obtain a comparison result, the third content including a result obtained by the target blockchain node executing data processing indicated by the data processing instruction information. If the comparison result indicates that the first content and the third content match, the target blockchain node determines that the response determination result of the second blockchain node is a second response determination result, the second response determination result being used to indicate that the second blockchain node responds normally to the data processing request; if the comparison result indicates that the first content and the third content do not match, the target blockchain node determines that the response determination result of the second blockchain node is a first response determination result.
[0144] In one embodiment, if the target blockchain node does not receive the request result returned by the second blockchain node in response to the data processing request, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result.
[0145] S607, the target blockchain node records the response determination result of the second blockchain node.
[0146] The specific implementation of step S607 can refer to the related description in the foregoing embodiments, and will not be described here.
[0147] S608, the target blockchain node acquires a plurality of response determination results of the second blockchain node recorded, and determines a response normal proportion of the second blockchain node to the data processing request of the target blockchain node according to the plurality of response determination results.
[0148] The number of the plurality of response determination results of the second blockchain node acquired by the target blockchain node can be a preconfigured value.
[0149] S609, the target blockchain node compares the response normal proportion with a proportion threshold.
[0150] S610, if the response normal proportion is less than or equal to the proportion threshold, the target blockchain node adds a mark indicating that the second blockchain node is inaccessible to the second blockchain node.
[0151] If the response normal proportion is greater than the proportion threshold, the connection with the second blockchain node is maintained, indicating that the second blockchain node can be accessed, i.e., the second blockchain node provides services reliably.
[0152] S611, the target blockchain node disconnects the connection with the second blockchain node.
[0153] The specific implementation of steps S608-S611 can refer to the related description in the foregoing embodiments, and will not be described here.
[0154] In an embodiment of the present application, a first random number is generated according to the target block height of the blockchain, and data processing instruction information is determined according to the first random number, the data interface provided by the first blockchain node, and the parameters passed in the data interface. The data processing method can be randomly determined based on the random number; a data processing request carrying the data processing instruction information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request. That is, the response determination result of the second blockchain node is determined according to the request result of the second blockchain node for the data processing request carrying the random data processing method. Compared with the method of determining the response determination result of the second blockchain node according to the request result of the second blockchain node for the data processing request carrying the fixed data processing method, the request results of the second blockchain node for different data processing methods can be randomly checked, which has better universal adaptability and verification integrity, thereby obtaining a more accurate response determination result. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined.
[0155] The data processing method based on blockchain mentioned above is passive. In order to better understand it, Figure 7 and Figure 8 The above method will be described.
[0156] Next, combine Figure 7 , provides an overall description of the interaction process of the VRF-based passive check proof module of the blockchain node. Figure 7 As shown, each blockchain node will send a data processing request containing data processing instructions, random numbers, and proof content to other blockchain nodes, which will then verify and return the request results. Specifically, Figure 7 Blockchain node 1, blockchain node 2, blockchain node 3, blockchain node 4, and some modules (blockchain ledger, VRF random number generator and VRF validator) of each blockchain node are shown. Figure 7 As shown, the target blockchain node is blockchain node 1. Blockchain node 1 calls the VRF random number generator to generate a random number corresponding to blockchain node 2 and the proof content of the random number, and then determines the data processing instruction information based on the random number. Blockchain node 1 sends a data processing request carrying the data processing instruction information, the random number corresponding to blockchain node 2 and the proof content to blockchain node 2. The data processing instruction information is the query block n1 transaction k1; blockchain node 2 calls the VRF validator to verify the random number according to the verification content of the random number and returns the request result. Figure 7 The rest of the blockchain nodes are similar and will not be described here.
[0157] As shown in FIG. 7, the process in which the blockchain node passively receives the VRF spot-check data interface of other blockchain nodes and performs verification can include the following steps: Figure 8 As shown in FIG. 7, the process can include the following steps: Figure 8
[0158] 0. Start.
[0159] 1. All blockchain nodes in the blockchain network start a timer.
[0160] The timer of the blockchain node can include a pre-set time period, for example, the blockchain node starts passive proof process every 1 hour. It should be noted that the respective time periods of the respective blockchain nodes can be synchronous or asynchronous.
[0161] 2. When the timer arrives, the blockchain node queries the target block height of the stored blockchain.
[0162] The target block height refers to the current latest block height of the stored blockchain, that is, the maximum block height among the block heights corresponding to the plurality of blocks on the blockchain.
[0163] 3. The target blockchain node concatenates the target block height with the public key of other blockchain nodes to obtain concatenated data.
[0164] 4. The target blockchain node processes the concatenated data using VRF to generate a random number of each blockchain node and proof content of the random number.
[0165] 5. The target blockchain node numbers the data interfaces provided by all blockchain nodes.
[0166] 6. The target blockchain node numbers the parameters transmitted in each data interface.
[0167] 7. The target blockchain node uses the random number of each blockchain node to take the modulus of the number of data interfaces provided by each blockchain node to obtain a matching data interface.
[0168] For example, the matching data interface can be a block transaction query interface.
[0169] 8. The target blockchain node uses the random number of each blockchain node to take the modulus of the number of parameters transmitted in the matching data interface corresponding to each blockchain node to obtain a matching parameter matching the second value, so as to determine the data processing instruction information according to the matching data interface and the matching parameter.
[0170] For example, the matching parameter can be a block height of 100, and the data processing indication information is used to indicate the transaction data in the block with a block height of 100. For another example, the matching parameter includes a block height of 100 and a transaction serial number of 10, and the data processing indication information is used to indicate the transaction data with a transaction serial number of 10 in the block with a block height of 100.
[0171] 9. The target blockchain node sends the data processing request carrying the data processing indication information, the random number and the proof content to the corresponding respective blockchain nodes.
[0172] 10. The other blockchain nodes receive the data processing request through the network module.
[0173] 11. The other blockchain nodes perform certificate verification on the identity certificate of the target blockchain node through the verification module, and if the certificate verification is passed, go to step 13, and if the certificate verification is not passed, go to step 12.
[0174] 12. The other blockchain nodes return a verification result indicating that the certificate verification is not passed, and go to step 20.
[0175] 13. The other blockchain nodes perform signature verification on the signature data of the target blockchain node through the verification module, and if the signature verification is passed, go to step 15, and if the signature verification is not passed, go to step 14.
[0176] 14. The other blockchain nodes return a verification result indicating that the signature verification is not passed, and go to step 20.
[0177] 15. The other blockchain nodes perform permission verification on the target blockchain node through the verification module, and if the permission verification is passed, go to step 17, and if the permission verification is not passed, go to step 16.
[0178] 16. The other blockchain nodes return a verification result indicating that the permission verification is not passed, and go to step 20.
[0179] 17. The other blockchain nodes verify the random number according to the proof content of the random number, and if the random number verification is passed, go to step 19, and if the random number verification is not passed, go to step 18.
[0180] 18. The other blockchain nodes return a verification result indicating that the random number verification is not passed, and go to step 20.
[0181] 19. The other blockchain nodes call the corresponding method to return the first content.
[0182] The first content can include the result obtained by executing the data processing indicated by the data processing indication information.
[0183] 20. The target blockchain node receives all the request results.
[0184] 21. The target blockchain node determines whether there is a blockchain node that does not return a request result, and goes to step 22 for the blockchain node that does not return a request result, and goes to step 23 for the blockchain node that returns a request result.
[0185] 22. The target blockchain node determines that the response determination result of the blockchain node that does not return a request result is a first response determination result, and goes to step 25.
[0186] The first response determination result can be used to indicate that the other blockchain nodes respond abnormally to the data processing request.
[0187] 23. The target blockchain node calls its corresponding method and obtains a third content, and compares its third content with the first content of the other blockchain nodes.
[0188] 24. The target blockchain node determines whether the comparison result is consistent, and goes to step 26 if the comparison result indicates that the first content and the third content match, and goes to step 25 if the comparison result indicates that the first content and the third content do not match.
[0189] 25. The target blockchain node adds a record of the first response determination result in the valid node sliding window, and goes to step 27.
[0190] 26. The target blockchain node adds a record of a second response determination result in the valid node sliding window.
[0191] The second response determination result is used to indicate that the other blockchain nodes respond normally to the data processing request.
[0192] 27. The target blockchain node updates the valid node link table.
[0193] 28. The target blockchain node determines whether the proportion of the responses of the blockchain nodes that are normal is lower than a proportion threshold, and goes to step 29 if the proportion of the responses that are normal is less than or equal to the proportion threshold, and goes to step 30 if the proportion of the responses that are normal is greater than the proportion threshold.
[0194] 29. The target blockchain node marks this blockchain node as inaccessible, and disconnects from the blockchain node.
[0195] 30. End.
[0196] See Figure 9 , Figure 9is a flowchart of another blockchain-based data processing method provided by an embodiment of the present application. The blockchain-based data processing method can be executed by interaction between a target blockchain node and a second blockchain node. The first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node. As shown in Figure 9 The blockchain-based data processing method can include, but is not limited to, the following steps S901-S912.
[0197] S901, the target blockchain node queries the target block height of the blockchain, and generates a first random number and first proof content of the first random number according to the target block height.
[0198] In the embodiment of the present application, the target blockchain node queries the current latest block height of the blockchain stored therein, that is, the maximum block height among the block heights corresponding to the plurality of blocks on the blockchain. For example, the blockchain includes a genesis block, block 1,..., block 100, a total of 101 blocks, and the corresponding block heights are 0, 1,..., 100. The maximum block height is 100, that is, the target block height of the queried blockchain.
[0199] S902, the target blockchain node stores the first random number and the first proof content into the proof list of the target blockchain node.
[0200] The proof list refers to a storage space for storing random numbers and proof content.
[0201] S903, the target blockchain node determines data processing instruction information according to the first random number, a data interface provided by the first blockchain node, and parameters transmitted in the data interface.
[0202] The specific implementation of step S903 can refer to the related description in the foregoing embodiments, which will not be described here.
[0203] S904, the target blockchain node sends a data processing request carrying data processing instruction information to the second blockchain node.
[0204] Correspondingly, the second blockchain node receives the data processing request carrying data processing instruction information sent by the target blockchain node.
[0205] In one embodiment, the data processing request can also carry an identity certificate of the target blockchain node and signature information. The signature information is obtained by signing the data processing request carrying the data processing instruction information using the public key of the target blockchain node.
[0206] The specific implementation of step S904 can refer to the related description in the foregoing embodiments, and details are not described herein again.
[0207] S905, the second blockchain node performs data processing indicated by the data processing indication information to obtain the first content and obtain the second content.
[0208] The second content includes second proof content in a proof list of the second blockchain node and a second random number corresponding to the second proof content.
[0209] In one embodiment, the second blockchain node performs certificate verification on the identity certificate of the target blockchain node, performs signature verification on the signature data of the target blockchain node after the certificate verification passes, performs authority verification on the target blockchain node after the signature verification passes, and obtains the first content and the second content according to the data processing indicated by the data processing indication information executed by the second blockchain node after the authority verification passes.
[0210] The specific implementation of step S905 can refer to the related description in the foregoing embodiments, and details are not described herein again.
[0211] S906, the second blockchain node sends a request result of the data processing request to the target blockchain node.
[0212] Correspondingly, the target blockchain node receives the request result returned by the second blockchain node in response to the data processing request. The request result can include any one of the following results: a verification result indicating that the certificate verification fails, a verification result indicating that the signature verification fails, a verification result indicating that the authority verification fails, or both the first content and the second content.
[0213] S907, the target blockchain node determines a response determination result of the second blockchain node according to the request result.
[0214] The response determination result is used to indicate whether the second blockchain node responds normally to the data processing request. The response determination result can be a first response determination result or a second response determination result. The first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request, and the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request.
[0215] If the request result includes any one of the verification result indicating that the certificate verification fails, the verification result indicating that the signature verification fails, or the verification result indicating that the authority verification fails, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result, which is used to indicate that the second blockchain node responds abnormally to the data processing request.
[0216] If the request result includes the first content and the second content, the target blockchain node obtains the third content, and compares the first content and the third content to obtain a comparison result, the third content including a result obtained by the target blockchain node executing the data processing instruction information.
[0217] If the comparison result indicates that the first content and the third content do not match, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result, the first response determination result being used to indicate that the second blockchain node responds abnormally to the data processing request.
[0218] If the comparison result indicates that the first content and the third content match, the target blockchain node verifies the second random number included in the second content according to the second proof content included in the second content. If the verification result indicates that the second random number fails to pass the verification, it is determined that the response determination result of the second blockchain node is the first response determination result; if the verification result indicates that the second random number passes the verification, it is determined that the response determination result of the second blockchain node is the second response determination result, the second response determination result being used to indicate that the second blockchain node responds normally to the data processing request.
[0219] In an embodiment, if the target blockchain node does not receive the request result returned by the second blockchain node for the data processing request, the target blockchain node determines that the response determination result of the second blockchain node is the first response determination result.
[0220] S908, the target blockchain node records the response determination result of the second blockchain node.
[0221] The specific implementation of step S908 can refer to the related description in the foregoing embodiments, which will not be described here again.
[0222] S909, the target blockchain node obtains a plurality of response determination results of the second blockchain node recorded, and determines a response normal proportion of the second blockchain node to the data processing request of the target blockchain node according to the plurality of response determination results.
[0223] The number of the plurality of response determination results of the second blockchain node obtained by the target blockchain node recorded can be a preconfigured value.
[0224] S910, the target blockchain node compares the response normal proportion with a proportion threshold.
[0225] S911, if the response normal proportion is less than or equal to the proportion threshold, the target blockchain node adds a mark indicating that the second blockchain node is inaccessible to the second blockchain node.
[0226] If the response normal ratio is greater than the ratio threshold, the connection with the second blockchain node is maintained, indicating that the second blockchain node is accessible, that is, the service provided by the second blockchain node is reliable.
[0227] S912. The target blockchain node disconnects from the second blockchain node.
[0228] The specific implementation of steps S909-S912 can refer to the relevant description in the aforementioned embodiment and will not be repeated here.
[0229] In an embodiment of the present application, a first random number is generated according to the target block height of the blockchain, and data processing instruction information is determined according to the first random number, the data interface provided by the first blockchain node, and the parameters passed in the data interface. The data processing method can be randomly determined based on the random number; a data processing request carrying the data processing instruction information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request. That is, the response determination result of the second blockchain node is determined according to the request result of the second blockchain node for the data processing request carrying the random data processing method. Compared with the method of determining the response determination result of the second blockchain node according to the request result of the second blockchain node for the data processing request carrying the fixed data processing method, the request results of the second blockchain node for different data processing methods can be randomly checked, which has better universal adaptability and verification integrity, thereby obtaining a more accurate response determination result. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined.
[0230] The data processing method based on blockchain mentioned above is proactive. Figure 10 and Figure 11 The above method will be described.
[0231] Next, combine Figure 10 , provides an overall description of the interaction process of the blockchain node's active check proof module based on VRF. Figure 10 As shown, each blockchain node will generate its own random number and proof content. When calling a blockchain node, it only needs to verify the VRF proof of the target blockchain node and the first content obtained by executing the data processing indicated by the data processing instruction information. Specifically, Figure 10 Blockchain node 1, blockchain node 2, blockchain node 3, blockchain node 4, and some modules (blockchain ledger, VRF random number generator, VRF validator and proof list) of each blockchain node are shown. Figure 10As shown in FIG. 1, the target blockchain node is the blockchain node 1, the blockchain node 1 calls the VRF random number generator to generate the random number corresponding to the blockchain node 1 and the proof content, and stores the random number corresponding to the blockchain node 1 and the proof content into the proof list. Figure 10 The other blockchain nodes generate and store the random number and the proof content in the same way, which is not described here. The blockchain node 1 verifies the random number and the proof content corresponding to the blockchain node 2 in the proof list of the blockchain node 2 by calling the VRF verifier. Figure 10 The blockchain node 1 verifies the random number and the proof content of the other blockchain nodes in the same way, which is not described here.
[0232] As shown in FIG. 1, the target blockchain node actively provides the VRF proof, and the other blockchain nodes query and verify the corresponding data interface in the process Figure 11 As shown in FIG. 1, the target blockchain node actively provides the VRF proof, and the other blockchain nodes query and verify the corresponding data interface in the process Figure 11 As shown in FIG. 1, the target blockchain node actively provides the VRF proof, and the other blockchain nodes query and verify the corresponding data interface in the process
[0233] 0. Start.
[0234] 1. All blockchain nodes in the blockchain network start the check timer.
[0235] The timer of the blockchain node can include a pre-set time period, for example, the blockchain node starts to passively check the proof process every 1 hour. It should be noted that the corresponding time periods of each blockchain node can be synchronous or asynchronous.
[0236] 2. When the timer arrives, the blockchain node queries the target block height of the stored blockchain.
[0237] The target block height refers to the current latest block height of the stored blockchain, that is, the maximum block height among the block heights corresponding to the multiple blocks on the blockchain.
[0238] 3. The blockchain node processes the block height by using the VRF to generate the random number and the proof content of the random number.
[0239] 4. The blockchain node puts the random number and the proof content of the random number into the VRF proof list corresponding to each blockchain node.
[0240] 5. The target blockchain node numbers the data interfaces provided by all the blockchain nodes.
[0241] 6. The target blockchain node numbers the parameters transmitted in each data interface.
[0242] 7. The target blockchain node uses the random number of each blockchain node to take the remainder of the number of data interfaces provided by each blockchain node to obtain the matched data interface.
[0243] For example, the matching data interface can be a block transaction query interface.
[0244] 8. The target blockchain node uses the random number of each blockchain node to take the remainder of the number of parameters in the matching data interface corresponding to each blockchain node, obtains a matching parameter with a number matching the second value, and determines the data processing instruction information according to the matching data interface and the matching parameter.
[0245] For example, the matching parameter can be a block height of 100, and the data processing instruction information is used to indicate the query of transaction data in a block with a block height of 100. For another example, the matching parameter includes a block height of 100 and a transaction serial number of 10, and the data processing instruction information is used to indicate the query of transaction data with a transaction serial number of 10 in a block with a block height of 100.
[0246] 9. The target blockchain node sends a data processing request carrying the data processing instruction information to the corresponding each blockchain node.
[0247] 10. The other blockchain nodes receive the data processing request through the network module.
[0248] 11. The other blockchain nodes perform certificate verification on the identity certificate of the target blockchain node through the verification module, and if the certificate verification is passed, go to step 13, and if the certificate verification is not passed, go to step 12.
[0249] 12. The other blockchain nodes return a verification result indicating that the certificate verification is not passed, and go to step 20.
[0250] 13. The other blockchain nodes perform signature verification on the signature data of the target blockchain node through the verification module, and if the signature verification is passed, go to step 15, and if the signature verification is not passed, go to step 14.
[0251] 14. The other blockchain nodes return a verification result indicating that the signature verification is not passed, and go to step 20.
[0252] 15. The other blockchain nodes perform permission verification on the target blockchain node through the verification module, and if the permission verification is passed, go to step 17, and if the permission verification is not passed, go to step 16.
[0253] 16. The other blockchain nodes return a verification result indicating that the permission verification is not passed, and go to step 20.
[0254] 17. The other blockchain nodes obtain the random number and the proof content in the proof list.
[0255] 18. The other blockchain nodes call the corresponding method to return the first content and the second content.
[0256] That is, the other blockchain nodes can perform the data processing indicated by the data processing indication information to obtain the first content, and further obtain the proof content in the proof list of the blockchain nodes and the random number corresponding to the proof content.
[0257] The first content can include the result obtained by performing the data processing indicated by the data processing indication information, and the second content can include the proof content in the proof list of the other blockchain nodes and the random number corresponding to the proof content.
[0258] 19. The target blockchain node receives all the request results.
[0259] 20. The target blockchain node determines whether there is a blockchain node that does not return the request result, and goes to step 21 for the blockchain node that does not return the request result, and goes to step 22 for the blockchain node that returns the request result.
[0260] 21. The target blockchain node determines that the response determination result of the blockchain node that does not return the request result is the first response determination result, and goes to step 27.
[0261] The first response determination result can be used to indicate that the other blockchain nodes respond abnormally to the data processing request.
[0262] 22. The target blockchain node calls its corresponding method and obtains the third content, and compares the third content of the target blockchain node with the first content of the other blockchain nodes.
[0263] The third content can include the result obtained by performing the data processing indicated by the data processing indication information by the target blockchain node.
[0264] 23. The target blockchain node determines whether the comparison result is consistent, and goes to step 25 if the comparison result indicates that the first content and the third content match, and goes to step 24 if the comparison result indicates that the first content and the third content do not match.
[0265] 24. The target blockchain node returns the comparison result indicating that the first content and the third content do not match, and goes to step 27.
[0266] 25. The target blockchain node verifies the random number according to the proof content of the random number, and goes to step 28 if the random number is verified, and goes to step 26 if the random number is not verified.
[0267] 26. The target blockchain node returns the verification result indicating that the random number is not verified, and goes to step 27.
[0268] 27. The target blockchain node adds a record of the first response determination result in the valid node sliding window, and goes to step 29.
[0269] 28. The target blockchain node adds a record of the second response determination result in the valid node sliding window.
[0270] The second response determination result can be used to indicate that other blockchain nodes respond normally to the data processing request.
[0271] 29. The target blockchain node updates the valid node link table.
[0272] 30. The target blockchain node determines whether the response normal proportion of a blockchain node is lower than the proportion threshold value, and goes to step 31 if the response normal proportion is less than or equal to the proportion threshold value, and goes to step 32 if the response normal proportion is greater than the proportion threshold value.
[0273] 31. The target blockchain node marks the blockchain node as inaccessible, and disconnects from the blockchain node.
[0274] 32. End.
[0275] Based on the above method embodiments, the embodiments of the present application provide a data processing device based on a blockchain. Please refer to Figure 12 , Figure 12 for a structural block diagram of a data processing device based on a blockchain provided by the embodiments of the present application. As shown in Figure 12 , the data processing device can be applied to a blockchain node of a blockchain network. It should be understood that the data processing device can be a computer program (including program code) running in a blockchain node of a blockchain, for example, the data processing device can be an application software; it can be understood that the data processing device can be used to execute the corresponding steps in the method provided by the embodiments of the present application. As shown in Figure 12 , the data processing device can include the following units:
[0276] The processing unit 1201 is configured to query a target block height of the blockchain, generate a first random number according to the target block height, and determine data processing indication information according to the first random number, a data interface provided by a first blockchain node, and parameters transmitted in the data interface.
[0277] The transceiver unit 1202 is configured to send a data processing request carrying the data processing indication information to a second blockchain node, and receive a request result returned by the second blockchain node in response to the data processing request.
[0278] The processing unit 1201 is further configured to determine a response determination result of the second blockchain node according to the request result.
[0279] wherein, if the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is the blockchain node to which the method is applied, and the data processing request further carries the first random number and first proof content of the first random number; the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return the first content after the first random number is verified, wherein the first content includes a result obtained by performing data processing indicated by the data processing indication information;
[0280] if the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the data processing request is used to request the second blockchain node to return the first content and the second content, wherein the second content includes the second proof content in the proof list of the second blockchain node and a second random number corresponding to the second proof content.
[0281] In an implementation manner, the processing unit 1201 is configured to determine the data processing indication information according to the first random number, a data interface provided by the first blockchain node, and a parameter input in the data interface, and specifically configured to perform the following steps:
[0282] numbering the data interface provided by the first blockchain node and the parameter input in the data interface;
[0283] taking the number of the data interface provided by the first blockchain node as a modulus of the first random number to obtain a first numerical value;
[0284] determining a matching data interface from the data interface provided by the first blockchain node, wherein the number of the matching data interface matches the first numerical value, and taking the number of the parameter input in the matching data interface as a modulus of the first random number to obtain a second numerical value;
[0285] determining a matching parameter from the parameter input in the matching data interface, wherein the number of the matching parameter matches the second numerical value;
[0286] determining the data processing indication information according to a data processing manner associated with the matching data interface and a data feature associated with the matching parameter.
[0287] In an implementation manner, the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; the processing unit 1201 is configured to generate the first random number according to the target block height, and specifically configured to perform the following steps:
[0288] Obtaining a public key of the second blockchain node, and splicing the target block height and the public key of the second blockchain node to obtain splicing data;
[0289] Processing the splicing data by using a verifiable random function VRF to generate a first random number and first proof content of the first random number.
[0290] In an implementation manner, the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; the processing unit 1201 is configured to, when determining the response determination result of the second blockchain node according to the request result, specifically perform the following steps:
[0291] If the request result includes a verification result indicating that the first random number verification fails, it is determined that the response determination result of the second blockchain node is a first response determination result; the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request;
[0292] If the request result includes the first content, a third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content includes a result obtained by the target blockchain node performing data processing indicated by the data processing indication information;
[0293] If the comparison result indicates that the first content and the third content match, it is determined that the response determination result of the second blockchain node is a second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request;
[0294] If the comparison result indicates that the first content and the third content do not match, it is determined that the response determination result of the second blockchain node is the first response determination result.
[0295] In an implementation manner, the first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; the processing unit 1201 is configured to, when determining the response determination result of the second blockchain node according to the request result, specifically perform the following steps:
[0296] If the request result includes the first content and the second content, a third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content includes a result obtained by the target blockchain node performing data processing indicated by the data processing indication information;
[0297] If the comparison result indicates that the first content and the third content do not match, it is determined that the response determination result of the second blockchain node is a first response determination result, and the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request;
[0298] If the comparison result indicates that the first content matches the third content, the second random number included in the second content is verified according to the second proof content included in the second content;
[0299] If the verification result indicates that the second random number verification fails, it is determined that the response determination result of the second blockchain node is the first response determination result;
[0300] If the verification result indicates that the second random number verification passes, it is determined that the response determination result of the second blockchain node is the second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request.
[0301] In an implementation manner, the processing unit 1201 is configured to record the response determination result of the second blockchain node, and the response determination result is used to indicate whether the second blockchain node responds normally to the data processing request;
[0302] The transceiver unit 1202 is configured to obtain the recorded multiple response determination results of the second blockchain node;
[0303] The processing unit 1201 is further configured to determine a response normal proportion of the second blockchain node to the data processing request of the target blockchain node according to the multiple response determination results;
[0304] The processing unit 1201 is further configured to process the second blockchain node according to the response normal proportion.
[0305] In an implementation manner, when the processing unit 1201 processes the second blockchain node according to the response normal proportion, the processing unit 1201 is specifically configured to perform the following steps:
[0306] If the response normal proportion is less than or equal to a proportion threshold, a mark indicating that the second blockchain node is inaccessible is added to the second blockchain node;
[0307] Disconnecting the connection with the second blockchain node.
[0308] In an implementation manner, the first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; when the processing unit 1201 generates the first random number according to the target block height, the processing unit 1201 is specifically configured to perform the following steps:
[0309] Processing the target block height by using a verifiable random function VRF to generate the first random number and first proof content of the first random number;
[0310] The processing unit 1201 is further configured to perform the following steps:
[0311] store the first random number and the first proof content into a proof list of the target blockchain node;
[0312] In response to a data processing request of a third blockchain node in the blockchain network, obtain the first random number and the first proof content from the proof list of the target blockchain node, and return the first random number and the first proof content to the third blockchain node.
[0313] According to another embodiment of the present application, Figure 12 The various units in the blockchain-based data processing apparatus shown can be respectively or all combined into one or several other units to constitute, or some of the units can also be further split into a plurality of units with smaller functions to constitute, which can achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above units are divided based on logical functions. In actual application, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, the blockchain-based data processing apparatus can also include other units. In actual application, these functions can also be assisted by other units, and can be implemented by multiple units in cooperation.
[0314] According to another embodiment of the present application, the blockchain-based data processing apparatus as shown in Figure 4 , Figure 6 or Figure 9 and the blockchain-based data processing method of the embodiments of the present application can be constructed by running a computer program capable of executing the steps involved in part or all of the methods as shown in Figure 12 on a general computing device such as a computer including processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), read-only memory (ROM), etc. The computer program can be recorded on, for example, a computer-readable storage medium, loaded into the above computing device through the computer-readable storage medium, and run therein.
[0315] In the embodiment of the present application, the first random number is generated according to the target block height of the blockchain, and the data processing indication information is determined according to the first random number, the data interface provided by the first blockchain node, and the parameters transmitted in the data interface, so that the data processing mode can be randomly determined based on the random number; the data processing request carrying the data processing indication information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request, that is, the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node for the data processing request carrying the random data processing mode. Compared with the way of determining the response determination result of the second blockchain node according to the request result returned by the second blockchain node for the data processing request carrying the fixed data processing mode, the request result of the second blockchain node for different data processing modes can be randomly verified, which has better universality and verification integrity, so that more accurate response determination result can be obtained. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined.
[0316] Based on the above method and device embodiments, the embodiment of the present application provides a computer device. Please refer to Figure 13 , Figure 13 is a structural schematic diagram of a computer device provided by the embodiment of the present application. Figure 13 The computer device shown in the figure at least includes a processor 1301, an input interface 1302, an output interface 1303, and a computer readable storage medium 1304. Wherein, the processor 1301, the input interface 1302, the output interface 1303 and the computer readable storage medium 1304 can be connected through bus or other ways.
[0317] The computer readable storage medium 1304 can be stored in the memory of the computer device, and the computer readable storage medium 1304 is used for storing computer program, the computer program includes computer instructions, and the processor 1301 is used for executing the computer program stored in the computer readable storage medium 1304. The processor 1301 (or CPU (Central Processing Unit, Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing the computer program, and is particularly suitable for loading and executing the computer program to realize the corresponding method process or corresponding function.
[0318] The embodiment of the present application further provides a computer readable storage medium (Memory), which is a memory device in a computer device, used for storing programs and data. It can be understood that the computer readable storage medium herein can include an internal storage medium in the computer device, and of course can also include an extended storage medium supported by the computer device. The computer readable storage medium provides a storage space, which stores an operating system of the computer device. Moreover, the storage space also stores a computer program suitable for being loaded and executed by the processor. It should be noted that the computer readable storage medium herein can be a high-speed RAM memory, or a non-volatile memory (Non-Volatile Memory), for example, at least one disk memory; optionally, the computer readable storage medium can also be at least one computer readable storage medium located away from the aforementioned processor.
[0319] The computer device can be the target blockchain node 301 in the data processing system shown in the above Figure 3 . In a specific implementation, the computer program stored in the computer readable storage medium 1304 can be loaded and executed by the processor 1301 to implement the corresponding steps in the above-described blockchain-based data processing method shown in Figure 4 、 Figure 6 or Figure 9 . In a specific implementation, the computer program in the computer readable storage medium 1304 is loaded and executed by the processor 1301 to implement the following steps:
[0320] querying a target block height of the blockchain, and generating a first random number according to the target block height;
[0321] determining data processing instruction information according to the first random number, a data interface provided by the first blockchain node, and parameters input in the data interface;
[0322] sending a data processing request carrying the data processing instruction information to a second blockchain node;
[0323] receiving a request result returned by the second blockchain node in response to the data processing request, and determining a response determination result of the second blockchain node according to the request result;
[0324] wherein, if the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is the blockchain node to which the method is applied, and the data processing request further carries the first random number and first proof content of the first random number; the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return first content after the first random number is verified, wherein the first content includes a result obtained by executing the data processing indicated by the data processing instruction information.
[0325] If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the data processing request is used to request the second blockchain node to return the first content and the second content, and the second content includes the second proof content in the proof list of the second blockchain node and a second random number corresponding to the second proof content.
[0326] In an implementation manner, the computer program in the computer readable storage medium 1304 is loaded and executed by the processor 1301 to determine the data processing indication information according to the first random number, the data interface provided by the first blockchain node, and the parameter input in the data interface, and specifically used to perform the following steps:
[0327] The data interface provided by the first blockchain node is numbered, and the parameter input in the data interface is numbered;
[0328] The number of the data interface provided by the first blockchain node is taken modulo the first random number to obtain a first numerical value;
[0329] A matching data interface with a matching number is determined from the data interface provided by the first blockchain node, and the number of the parameter input in the matching data interface is taken modulo the first random number to obtain a second numerical value;
[0330] A matching parameter with a matching number is determined from the parameter input in the matching data interface;
[0331] According to the data processing mode associated with the matching data interface and the data feature associated with the matching parameter, the data processing indication information is determined.
[0332] In an implementation manner, the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; the computer program in the computer readable storage medium 1304 is loaded and executed by the processor 1301 to generate the first random number according to the target block height, and specifically used to perform the following steps:
[0333] The public key of the second blockchain node is obtained, and the target block height and the public key of the second blockchain node are spliced to obtain spliced data;
[0334] The spliced data is processed by using a verifiable random function VRF to generate the first random number and the first proof content of the first random number.
[0335] In an implementation manner, the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; when the computer program in the computer readable storage medium 1304 is loaded and executed by the processor 1301 to determine the response determination result of the second blockchain node according to the request result, the computer program is specifically used to execute the following steps:
[0336] If the request result includes the verification result indicating that the first random number verification fails, the response determination result of the second blockchain node is determined as the first response determination result; the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request;
[0337] If the request result includes the first content, the third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content includes a result obtained by the target blockchain node performing data processing indicated by the data processing indication information;
[0338] If the comparison result indicates that the first content and the third content match, the response determination result of the second blockchain node is determined as the second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request;
[0339] If the comparison result indicates that the first content and the third content do not match, the response determination result of the second blockchain node is determined as the first response determination result.
[0340] In an implementation manner, the first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; when the computer program in the computer readable storage medium 1304 is loaded and executed by the processor 1301 to determine the response determination result of the second blockchain node according to the request result, the computer program is specifically used to execute the following steps:
[0341] If the request result includes the first content and the second content, the third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content includes a result obtained by the target blockchain node performing data processing indicated by the data processing indication information;
[0342] If the comparison result indicates that the first content and the third content do not match, the response determination result of the second blockchain node is determined as the first response determination result, and the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request;
[0343] If the comparison result indicates that the first content and the third content match, the second random number included in the second content is verified according to the second proof content included in the second content;
[0344] If the verification result indicates that the second random number verification fails, it is determined that the response determination result of the second blockchain node is the first response determination result.
[0345] If the verification result indicates that the second random number verification passes, it is determined that the response determination result of the second blockchain node is the second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request.
[0346] In an implementation manner, the computer program in the computer readable storage medium 1304 is loaded by the processor 1301 and further used to execute the following steps:
[0347] The response determination result of the second blockchain node is recorded, and the response determination result is used to indicate whether the second blockchain node responds normally to the data processing request;
[0348] The recorded multiple response determination results of the second blockchain node are obtained;
[0349] The normal response proportion of the second blockchain node to the data processing request of the target blockchain node is determined according to the multiple response determination results;
[0350] The second blockchain node is processed according to the normal response proportion.
[0351] In an implementation manner, when the computer program in the computer readable storage medium 1304 is loaded by the processor 1301 and executed to process the second blockchain node according to the normal response proportion, the specific steps are as follows:
[0352] If the normal response proportion is less than or equal to the proportion threshold, a mark indicating that the second blockchain node is inaccessible is added to the second blockchain node;
[0353] The connection with the second blockchain node is disconnected.
[0354] In an implementation manner, the first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; when the computer program in the computer readable storage medium 1304 is loaded by the processor 1301 and executed to generate the first random number according to the target block height, the specific steps are as follows:
[0355] The target block height is processed by using a verifiable random function VRF to generate the first random number and first proof content of the first random number;
[0356] In an implementation manner, the computer program in the computer readable storage medium 1304 is loaded by the processor 1301 and further used to execute the following steps:
[0357] store the first random number and the first proof content into a proof list of the target blockchain node;
[0358] In response to a data processing request of a third blockchain node in the blockchain network, the first random number and the first proof content are obtained from the proof list of the target blockchain node, and the first random number and the first proof content are returned to the third blockchain node.
[0359] In the embodiments of the present application, the first random number is generated according to the target block height of the blockchain, and the data processing indication information is determined according to the first random number, the data interface provided by the first blockchain node, and the parameters transmitted in the data interface. The data processing mode can be randomly determined based on the random number. The data processing request carrying the data processing indication information is sent to the second blockchain node, and the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node in response to the data processing request. That is, the response determination result of the second blockchain node is determined according to the request result returned by the second blockchain node in response to the data processing request carrying the random data processing mode. Compared with the way of determining the response determination result of the second blockchain node according to the request result returned by the second blockchain node in response to the data processing request carrying the fixed data processing mode, the request result of the second blockchain node in response to different data processing modes can be randomly verified, which has better universality and verification integrity, so that a more accurate response determination result can be obtained. Based on the accurate response determination result of the second blockchain node, the service reliability of the blockchain node can be accurately determined.
[0360] The embodiments of the present application also provide a computer program product, which comprises a computer program. When the computer program is executed by a processor, the data processing method based on a blockchain is realized. The specific implementation manner can refer to the related description in the foregoing description, which will not be described here.
[0361] It should be noted that the collection and processing of related data in the embodiments of the present application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing behavior within the scope of authorization of laws and regulations and the personal information subject.
[0362] Those skilled in the art can be aware that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0363] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an integral module or unit that includes the functions of the module or unit.
[0364] In the above embodiments, all or part can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium or transmitted by a computer-readable storage medium. Computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD), or semiconductor media (for example, solid state disk (SSD)) and the like.
[0365] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any skilled person in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A blockchain-based data processing method, characterized in that, The method comprises the following steps: querying a target block height of a blockchain, and generating a first random number according to the target block height; determining data processing instruction information according to the first random number, a data interface provided by a first blockchain node, and parameters input in the data interface; sending a data processing request carrying the data processing instruction information to a second blockchain node; receiving a request result returned by the second blockchain node in response to the data processing request, and determining a response determination result of the second blockchain node according to the request result; wherein, if the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is the blockchain node to which the method is applied, and the data processing request further carries the first random number and first proof content of the first random number; the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return first content after the first random number is verified, wherein the first content includes a result obtained by executing data processing indicated by the data processing instruction information; if the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the data processing request is used to request the second blockchain node to return the first content and second content, wherein the second content includes second proof content in a proof list of the second blockchain node and a second random number corresponding to the second proof content.
2. The method of claim 1, wherein, The determination of the data processing instruction information according to the first random number, the data interface provided by the first blockchain node, and the parameters input in the data interface comprises: numbering the data interface provided by the first blockchain node, and numbering the parameters input in the data interface; obtaining a first numerical value by taking the number of the data interface provided by the first blockchain node as a modulus of the first random number; determining a matching data interface with a matching number from the data interface provided by the first blockchain node, and obtaining a second numerical value by taking the number of the parameters input in the matching data interface as a modulus of the first random number; determining a matching parameter with a matching number from the parameters input in the matching data interface; determining the data processing instruction information according to a data processing mode associated with the matching data interface and a data feature associated with the matching parameter.
3. The method of claim 1, wherein, The first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; the generation of the first random number according to the target block height comprises: obtaining a public key of the second blockchain node, and concatenating the target block height and the public key of the second blockchain node to obtain concatenated data; processing the concatenated data by using a verifiable random function VRF to generate the first random number and first proof content of the first random number.
4. The method according to any one of claims 1 to 3, characterized in that, The first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the second blockchain node is the same as the first blockchain node; The determining of the response determination result of the second blockchain node according to the request result comprises: If the request result comprises a verification result indicating that the first random number verification fails, it is determined that the response determination result of the second blockchain node is a first response determination result; the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request; If the request result comprises the first content, a third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content comprises a result obtained by the target blockchain node performing data processing indicated by the data processing instruction information; If the comparison result indicates that the first content and the third content match, it is determined that the response determination result of the second blockchain node is a second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request; If the comparison result indicates that the first content and the third content do not match, it is determined that the response determination result of the second blockchain node is the first response determination result.
5. The method according to claim 1 or 2, characterized in that, The first blockchain node is the target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; the determining of the response determination result of the second blockchain node according to the request result comprises: If the request result comprises the first content and the second content, a third content is obtained, and the first content and the third content are compared to obtain a comparison result; the third content comprises a result obtained by the target blockchain node performing data processing indicated by the data processing instruction information; If the comparison result indicates that the first content and the third content do not match, it is determined that the response determination result of the second blockchain node is a first response determination result, and the first response determination result is used to indicate that the second blockchain node responds abnormally to the data processing request; If the comparison result indicates that the first content and the third content match, the second random number included in the second content is verified according to the second proof content included in the second content; If the verification result indicates that the second random number verification fails, it is determined that the response determination result of the second blockchain node is the first response determination result; If the verification result indicates that the second random number verification passes, it is determined that the response determination result of the second blockchain node is a second response determination result; the second response determination result is used to indicate that the second blockchain node responds normally to the data processing request.
6. The method of claim 1, wherein, The method further comprises: The response determination result of the second blockchain node is recorded, and the response determination result is used to indicate whether the second blockchain node responds normally to the data processing request; acquire a plurality of response determination results of the second blockchain node for the recorded data processing request, determine a normal response proportion of the second blockchain node for the data processing request according to the plurality of response determination results; process the second blockchain node according to the normal response proportion.
7. The method of claim 6, wherein, The processing the second blockchain node according to the normal response proportion comprises: if the normal response proportion is less than or equal to a proportion threshold, adding a mark indicating that the second blockchain node is inaccessible to the second blockchain node; disconnecting the connection with the second blockchain node.
8. The method of claim 1 or 2, wherein, The first blockchain node is a target blockchain node, and the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node; and the generating the first random number according to the target block height comprises: processing the target block height by using a verifiable random function (VRF) to generate the first random number and first proof content of the first random number; The method further comprises: storing the first random number and the first proof content into a proof list of the target blockchain node; in response to a data processing request of a third blockchain node in the blockchain network, acquiring the first random number and the first proof content from the proof list of the target blockchain node, and returning the first random number and the first proof content to the third blockchain node. 9.A blockchain-based data processing apparatus, characterized by comprising: comprise: a processing unit configured to query a target block height of a blockchain, generate a first random number according to the target block height, and determine data processing indication information according to the first random number, a data interface provided by a first blockchain node, and parameters transmitted in the data interface; a transceiver configured to send a data processing request carrying the data processing indication information to a second blockchain node, and receive a request result returned by the second blockchain node for the data processing request; The processing unit is further configured to determine a response determination result of the second blockchain node according to the request result. If the first blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, the second blockchain node is the same as the first blockchain node, the target blockchain node is a blockchain node corresponding to the data processing apparatus, and the data processing request further carries the first random number and first proof content of the first random number; the data processing request is used to request the second blockchain node to verify the first random number according to the first proof content, and return first content after the first random number is verified, wherein the first content comprises a result obtained by performing data processing indicated by the data processing indication information. If the first blockchain node is the target blockchain node, the second blockchain node is any one of the blockchain nodes in the blockchain network except the target blockchain node, and the data processing request is used to request the second blockchain node to return the first content and the second content, the second content including second proof content in a proof list of the second blockchain node and a second random number corresponding to the second proof content.
10. A computer device, comprising: The computer device comprises: a processor adapted to implement a computer program; a computer readable storage medium storing a computer program, the computer program being adapted to be loaded and executed by the processor to implement the blockchain-based data processing method according to any one of claims 1-8.
11. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, the computer program being adapted to be loaded and executed by the processor to implement the blockchain-based data processing method according to any one of claims 1-8.
12. A computer program product, characterised in that, The computer program product comprises a computer program, the computer program being executed by the processor to implement the blockchain-based data processing method according to any one of claims 1-8.