A data processing method, device, equipment and medium based on blockchain

By configuring lease levels for the bill business contracts of blockchain nodes and detecting and updating the cached business status data, the problem of excessive operation burden on nodes is solved, and the effect of reducing the number of core chain accesses is achieved.

CN117131079BActive Publication Date: 2025-08-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210546128.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-19
Publication Date
2025-08-08
Estimated Expiration
2042-05-19

AI Technical Summary

Technical Problem

When blockchain nodes perform transactions, frequently pull business result data from the blockchain network, resulting in excessive burden on nodes to run.

Method used

By configuring the lease level of the query interface for the bill business contract, detecting and updating the service status data in the node cache, reducing the number of accesses to the core chain.

Benefits of technology

This reduces the number of accesses to the core chain by blockchain nodes and reduces the burden of node operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117131079B_ABST
    Figure CN117131079B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data processing method, device, equipment and medium based on blockchain, which is applicable to various scenarios such as cloud technology, artificial intelligence, smart transportation, and assisted driving, including: the first consensus node obtains the interface configuration information of the bill business contract based on the status data publishing service; the interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract, and the lease level corresponding to each query interface; the business status data corresponding to the N query interfaces are obtained from the node cache; the N query interfaces include a target query interface; if the business status data corresponding to the target query interface is detected to be invalid data based on the lease level corresponding to the target query interface, the business update data is re-obtained from the core chain and the business update data is stored in the node cache. By adopting the embodiment of the present application, the number of accesses to the core chain can be reduced, thereby reducing the node operation burden.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, apparatus, device, and medium. Background Art

[0002] Currently, when executing transactions, blockchain nodes in a blockchain network often need to generate business query requests associated with the transactions in order to retrieve the business result data corresponding to the business query requests from the blockchain in the blockchain network in real time. For example, if the transaction executed by the blockchain node is an invoicing business for a specific enterprise, then once the number of invoices increases, the blockchain node will frequently pull the enterprise status (e.g., "risk-free status") of the enterprise from the blockchain as business result data within a certain period of time. This will increase the number of blockchain node accesses to the blockchain, resulting in an excessive operational burden on the node. Summary of the Invention

[0003] The embodiments of the present application provide a blockchain-based data processing method, apparatus, device, and medium, which can reduce the number of accesses to the core chain, thereby alleviating the node operation burden.

[0004] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, including:

[0005] The first consensus node in the core consensus network obtains the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service. The interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network. The interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. N is a positive integer.

[0006] Obtain business status data corresponding to N query interfaces from the node cache associated with the bill business contract; the N query interfaces include the target query interface;

[0007] If, based on the lease level corresponding to the target query interface, it is detected that the business status data corresponding to the target query interface is invalid data, the business update data used to update the business status data of the target query interface is re-obtained from the core chain, and the business update data is stored in the node cache; the business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0008] An embodiment of the present application provides, on one hand, a blockchain-based data processing device, comprising:

[0009] A configuration information acquisition module is used by the first consensus node in the core consensus network to obtain the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service. The interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network. The interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. N is a positive integer.

[0010] A status data acquisition module is used to obtain business status data corresponding to N query interfaces from the node cache associated with the bill business contract; the N query interfaces include a target query interface;

[0011] The status data update module is used to re-acquire the business update data used to update the business status data of the target query interface from the core chain if it is detected that the business status data corresponding to the target query interface is invalid based on the lease level corresponding to the target query interface, and store the business update data in the node cache; the business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0012] The lease management contract is used to indicate the mapping relationship between lease levels and cache durations; one lease level corresponds to one cache duration;

[0013] The device also includes:

[0014] A target duration determination module is configured to obtain, from the lease management contract, a cache duration that is mapped to the lease level corresponding to the target query interface, and determine the obtained cache duration as the target cache duration corresponding to the target query interface;

[0015] An effective timestamp determination module is used to determine the storage timestamp of the business status data corresponding to the target query interface from the node cache, and determine the effective expiration timestamp of the business status data corresponding to the target query interface based on the storage timestamp and the target cache duration;

[0016] The invalid data determination module is used to determine that the business status data corresponding to the target query interface is invalid data if the detection timestamp reaches the valid deadline timestamp.

[0017] The device further comprises:

[0018] The lease contract acquisition module is used to obtain the lease management contract carried in the management contract chain request when obtaining the management contract chain request sent by the system management device with system management authority;

[0019] The packaging module is used to package the lease management contract and obtain the block to be verified to be written into the core chain;

[0020] A block broadcast module, configured to broadcast the block to be verified to the second consensus node in the core consensus network, so that the second consensus node can reach a consensus on the obtained block to be verified and obtain a consensus result to be returned to the first consensus node;

[0021] The lease contract chain module is used to determine whether the blockchain nodes in the blockchain network have reached a consensus and whether the lease management contract in the block to be verified has been successfully deployed on the core chain if the consensus result exceeds the consensus threshold, indicating that the consensus is successful; the generation timestamp of the block to be verified is used to update the maximum generation timestamp on the core chain.

[0022] The lease contract acquisition module includes:

[0023] The on-chain request acquisition unit is used to obtain a management contract on-chain request sent by a system management device with system management authority; the management contract on-chain request includes information to be signed and object signature information; the object signature information is obtained by signing the information to be signed based on the object private key of the system management object; the information to be signed includes the lease management contract determined by the system management object;

[0024] The signature verification unit is used to obtain the object public key corresponding to the system management object from the core chain, verify the object signature information based on the object public key, and obtain the signature verification result;

[0025] The lease contract acquisition unit is used to determine that the management contract chain request is a legitimate request if the signature verification result indicates that the verification is successful, and obtain the lease management contract from the management contract chain request.

[0026] The number of bill business contracts deployed by the first consensus node is M, and one bill business contract corresponds to one transaction business type in the business network; M is a positive integer; the blockchain network includes a routing proxy network; the routing proxy network is used to isolate the business network from the core consensus network;

[0027] The device also includes:

[0028] The target contract determination module is configured to, upon receiving a business query request forwarded by a proxy node in the routing proxy network, determine a target business contract from M bill business contracts based on the cache query service and the transaction business type indicated by the business query request. The business query request is generated by a business node in the business network based on business auxiliary information. One query interface of the target business contract corresponds to one query type.

[0029] A business interface determination module is used to obtain a query interface that matches the query type of the business auxiliary information from the target business contract, and determine the obtained query interface as the business query interface;

[0030] A result data determination module is used to determine the business result data corresponding to the business auxiliary information based on the request type of the business query request, the business query interface and the node cache;

[0031] The result data return module is used to return the business result data to the business node through the proxy node.

[0032] The request type of the service query request includes a first request type; the first request type is used to indicate that the service query request is a first service request;

[0033] The result data determination module includes:

[0034] The data query unit is used to obtain the data hash table associated with the target business contract from the node cache and perform data query on the data hash table based on the business query interface;

[0035] The first result determination unit is configured to obtain the business result data corresponding to the business auxiliary information from the core chain if the business result data corresponding to the business auxiliary information is not found in the data hash table.

[0036] The result data determination module further includes:

[0037] A lease level query unit is configured to, if the interface name of the business query interface is not found in the data hash table, obtain the business result data corresponding to the business auxiliary information from the core chain and, based on the level query identifier associated with the cache query service deployed on the first consensus node, obtain the lease level corresponding to the business query interface from the core chain;

[0038] A sub-hash table generating unit, configured to generate, in a node cache, a sub-hash table for storing information associated with the business query interface based on the interface name of the business query interface and the lease level corresponding to the business query interface;

[0039] The result data storage unit is used to add the business result data to the sub-hash table, and add the added timestamp as the storage timestamp corresponding to the business result data to the sub-hash table; the business result data in the sub-hash table is the business status data of the business query interface.

[0040] The lease level query unit includes:

[0041] The identifier acquisition subunit is used to obtain the level query identifier associated with the cache query service deployed on the first consensus node after obtaining the business result data corresponding to the business auxiliary information from the core chain if the interface name of the business query interface is not found in the data hash table;

[0042] The configuration block acquisition subunit is used to obtain the contract configuration block associated with the bill business contract from the core chain based on the level query identifier; the contract configuration block is obtained by the first consensus node after uploading the business configuration information sent by the business contract management device for the bill business contract to the chain;

[0043] The first level acquisition subunit is configured to acquire the lease level corresponding to the business query interface from the business configuration information if the business configuration information included in the contract configuration block contains the lease level corresponding to the business query interface.

[0044] The lease level query unit further includes:

[0045] The query result determination subunit is used to query the global lease level configured by the business contract management device in the core chain to obtain the query result if the lease level corresponding to the business query interface does not exist in the business configuration information included in the contract configuration block;

[0046] The second level acquisition subunit is used to determine the lease level corresponding to the business query interface based on the query result.

[0047] The second-level acquisition subunit is further configured to:

[0048] If the query result indicates that there is a global lease level in the core chain, the global lease level will be used as the lease level corresponding to the business query interface;

[0049] If the query result indicates that there is no global lease level in the core chain, the no lease level is determined as the lease level corresponding to the business query interface; the cache duration corresponding to the no lease level is zero.

[0050] The request type of the service query request includes a second request type; the second request type is used to indicate that the service query request is not the first service request;

[0051] The result data determination module includes:

[0052] The interface query unit is used to obtain the data hash table associated with the target business contract from the node cache, and query the interface name corresponding to the business query interface in the data hash table;

[0053] The second result determination unit is configured to obtain the business result data corresponding to the business auxiliary information from the node cache if the interface name of the business query interface is consistent with the interface name of the target query interface; the business result data is the business update data.

[0054] The result return module is specifically used to:

[0055] The business result data is sent to the proxy node so that the proxy node encrypts the business result data based on the system public key of the business network to obtain system encrypted data information for return to the business node; the business node is used to decrypt the system encrypted data information based on the system private key of the business network when obtaining the system encrypted data information to obtain the business result data.

[0056] In one aspect, an embodiment of the present application provides a computer device, including: a processor and a memory;

[0057] The processor is connected to a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.

[0058] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.

[0059] On the one hand, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method in the embodiment of the present application.

[0060] In an embodiment of the present application, the first consensus node in the core consensus network can obtain the interface configuration information of the bill business contract deployed on the first consensus node based on the status data publishing service. The interface configuration information here can be used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. This means that the embodiment of the present application can flexibly limit whether the business status data corresponding to each query interface is invalid data in the node cache by configuring the corresponding lease level for the query interface of the bill business contract. In this way, once the first consensus node detects that the business status data corresponding to a certain query interface (i.e., the target query interface) has reached the valid period in the node cache based on the lease level corresponding to the query interface, it is necessary to re-pull the business update data used to update the business status data that is invalid data from the core chain. In this way, when the first consensus node receives a business query request sent by a business node in the business network, it can directly access it from the node cache without having to pull data from the core chain in real time, thereby reducing the number of visits of the first consensus node to the core chain, thereby reducing the node operation burden. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0062] Figure 1 This is a schematic diagram of a blockchain network hierarchical structure provided by an embodiment of the present application;

[0063] Figure 2 This is a schematic diagram of a scenario for performing data detection and update on a node cache, provided by an embodiment of the present application;

[0064] Figure 3 This is a flowchart of a blockchain-based data processing method provided in an embodiment of the present application;

[0065] Figure 4 This is a schematic diagram of a scenario in which a lease management contract is put on the chain, provided by an embodiment of the present application;

[0066] Figure 5 This is a flowchart of a blockchain-based data processing method provided in an embodiment of the present application;

[0067] Figure 6 This is a schematic diagram of a framework for implementing a data publishing lease interface for a bill business contract provided in an embodiment of the present application;

[0068] Figure 7 This is a system architecture diagram of a tax blockchain system provided by an embodiment of the present application;

[0069] Figure 8 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application;

[0070] Figure 9 This is a schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0072] It should be understood that the embodiment of the present application proposes a smart contract framework for self-adaptive caching of blockchain data, wherein the blockchain (blockchain or block chain) can be a series of text records (also known as blocks) that are connected and protected by cryptography, that is, it includes a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. Each block can include the encrypted hash of the previous block (i.e., the parent block hash value), the generation timestamp, and the transaction data (usually represented by the hash value calculated by the Merkle tree algorithm). Such a design makes the block content difficult to tamper with. The distributed ledger connected by blockchain technology allows the two parties to effectively record transactions and can permanently check the transactions. Among them, the embodiment of the present application can refer to the blockchain used to store complete block data in the core consensus network as the core chain.

[0073] Among them, a smart contract is an application or program running on a blockchain node. Generally, they are a set of digital agreements with specific rules that can be enforced. These rules are pre-defined by computer source code, and all network nodes will copy and execute these computer source codes. In the embodiment of the present application, the consensus node deployed in the core consensus network and used to execute the smart contract associated with the transaction business can be called a bill business contract, and the smart contract used to manage the quantity corresponding to the lease level and the cache duration corresponding to the lease level can be called a lease management contract.

[0074] See Figure 1 , Figure 1This is a schematic diagram of a blockchain network hierarchical structure provided by an embodiment of the present application. The blockchain network hierarchical structure in the embodiment of the present application can be Figure 1 The blockchain network 1W shown in the figure can be represented by the complete blockchain business system corresponding to the blockchain network 1W. Figure 1 The business network, core consensus network, and routing proxy network shown in the figure are composed of the business network, core consensus network, and routing proxy network. The routing proxy network here can be used to isolate the business network and the core consensus network.

[0075] It should be understood that in the embodiment of the present application, the blockchain nodes in the routing proxy network may be referred to as proxy nodes. Figure 1 The number of proxy nodes in the routing proxy network shown can be one or more, which is not limited here. Figure 1 Taking the proxy node 10D shown as an example, the proxy node 10D can be used to transmit data between the business network and the core consensus network. The proxy node 10D can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services, without limitation. The proxy node 10D can layer the peer-to-peer (P2P) network to form a layered structure such as "business network-core consensus network", thereby improving the confidentiality and security of data on the core chain.

[0076] in, Figure 1 The blockchain node system (i.e., the first blockchain node system) corresponding to the business network (also known as the witness network) shown may include one or more blockchain nodes, and the number of nodes in the first blockchain node system will not be limited here. For example, the first blockchain node system may specifically include node 110a, node 110b, node 110c, ..., node 110n. It should be understood that the embodiment of the present application may refer to the blockchain node in the business network as a business node. The business node does not need to participate in the accounting consensus and is mainly used to execute transaction business to obtain transaction data associated with the transaction business. Among them, the business node here can be a full node containing a complete blockchain database, or it can be a lightweight node that can store part of the data in the blockchain database. It will not be limited here. In order to reduce the waste of storage space of the business node, the business node in the embodiment of the present application can take a lightweight node (Simplified Payment Verification, abbreviated as SPV) as an example. The business node does not need to store complete transaction data, but through the proxy node 10D, from Figure 1 In the core chain of the core consensus network shown, block header data and partially authorized visible block data (for example, transaction data associated with the business node itself) are obtained.

[0077] in, Figure 1 The blockchain node system (i.e., the second blockchain node system) corresponding to the core consensus network shown may also include one or more blockchain nodes, and the number of nodes in the second blockchain node system will not be limited here. For example, the second blockchain node system may specifically include node 120a, node 120b, node 120c, ..., node 120m. It should be understood that the embodiment of the present application may refer to the blockchain nodes in the core consensus network as consensus nodes (also known as accounting nodes). Among them, each consensus node in the core consensus network can be deployed with a bill business contract associated with the transaction business. For example, if Figure 1 The blockchain node system corresponding to the blockchain network 1W shown is a tax blockchain system used in tax business. The transaction business here can refer to the tax business performed by the business nodes in the business network, which can specifically include invoicing business, credit investigation business, loss-making business, enterprise qualification business, and tax refund business, etc.

[0078] It should be understood that in the embodiment of the present application, the proxy node, the service node, and the consensus node may be collectively referred to as the blockchain node in the blockchain network 1W. The blockchain node may be a server connected to the blockchain network 1W or a terminal device connected to the blockchain network 1W. The specific form of the blockchain node is not limited here. It is understood that Figure 1 The business network and core consensus network shown can be in different network environments. For example, generally speaking, business nodes are deployed in the business network on the public network, while consensus nodes running the blockchain consensus protocol are deployed in the private core consensus network. The two can interact through the routing boundary.

[0079] The core chain in the core consensus network may include a lease management contract determined by a system management object with system management authority through a system management device. The lease management contract may be used to manage the number of lease levels and the cache duration corresponding to each lease level. For example, the lease levels set by the lease management contract may include no lease level, a first lease level, a second lease level, a third lease level, and a fourth lease level. The lease level may be used to indicate the cache duration of the business status data stored in the node cache. For example, the cache duration corresponding to the no lease level may be zero; the cache duration corresponding to the first lease level may be cache duration 1 (e.g., 10 seconds); the cache duration corresponding to the second lease level may be cache duration 2 (e.g., 30 seconds); the cache duration corresponding to the third lease level may be cache duration 3 (e.g., 5 minutes); and the cache duration corresponding to the fourth lease level may be cache duration 4 (e.g., 30 minutes). Based on this, the contract management object associated with the bill business contract (i.e., the object with the authority to configure the lease level for the query interface) can use the business contract management device to configure the lease level that matches the actual business needs associated with the bill business contract for multiple query interfaces of the bill business contract deployed on the consensus node according to the lease management contract on the core chain.

[0080] It is understood that the system management device and the business contract management device herein can both be terminal devices that have a network connection relationship with the consensus nodes in the core consensus network. The network connection here is not limited to the connection method. It can be directly or indirectly connected through wired communication, directly or indirectly connected through wireless communication, or through other methods. This application does not impose any restrictions here. Among them, the terminal devices here can include: smart phones, tablets, laptops, desktop computers, smart speakers, smart watches, car terminals, smart TVs and other smart terminals with blockchain data processing functions.

[0081] For ease of understanding, the embodiments of the present application can be Figure 1A consensus node is arbitrarily selected from the core consensus network shown as the first consensus node, and other consensus nodes in the core consensus network except the first consensus node are used as the second consensus node. For example, in the embodiment of the present application, the node 120a in the core consensus network can be used as the first consensus node, and the bill business contract deployed by the node 120a can refer to a smart contract associated with the transaction business in the business network. The number of the bill business contracts can be multiple, and specifically can include bill business contract A, bill business contract B, bill business contract C, bill business contract D and bill business contract E. Among them, one bill business contract can correspond to one transaction business type. For example, the bill business contract A here can correspond to the billing business type; the bill business contract B can correspond to the credit investigation business type; the bill business contract C can correspond to the loss-making business type; the bill business contract D can correspond to the enterprise qualification business type; and the bill business contract E can correspond to the tax refund business type.

[0082] It should be understood that node 120a can obtain the interface configuration information of the bill business contract deployed on node 120a based on the status data publishing service. The interface configuration information here can be configured for the bill business contract by the business contract management device based on the lease management contract on the core chain, and the interface configuration information can be used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. N is a positive integer. One query interface corresponds to one query type. The query types here may include a first query type (for example, a type of query by object identifier), a second query type (for example, a type of query by bill identifier), a third query type (for example, a type of query by transaction timestamp), etc.

[0083] Furthermore, node 120a can obtain the business status data corresponding to each of the N query interfaces from the node cache associated with the bill business contract. The business status data here may include the virtual assets of the business object, the risk status of the business object, the bill template used to execute the bill business, and the bill status of the electronic bill. For example, the virtual assets here may refer to game coins, game diamonds, etc. held by a user in a gaming scenario, or may refer to electronic bills in a tax scenario, etc., which will not be exemplified here. The risk status of the business object here can be used to indicate whether a business object (e.g., an enterprise object) has the authority to issue bills. The bill status here may include "reimbursement status," "circulation status," and "invalidated status," etc.

[0084] At this time, the node 120a can detect whether the business status data in the node cache is invalid data based on the lease level corresponding to each query interface. Among them, when the embodiment of the present application detects the business status data in the node cache, one of the N query interfaces can be referred to as a target query interface. It can be understood that if the node 120a detects that the business status data corresponding to the target query interface is invalid data based on the lease level corresponding to the target query interface, the node 120a needs to re-acquire the business update data used to update the business status data of the target query interface from the core chain, and then store the business update data in the node cache.

[0085] It can be seen that since the bill business contract deployed by the first consensus node (for example, node 120a) in the embodiment of the present application can implement a data publishing lease interface, this means that the first consensus node can flexibly limit the effective duration of the business status data in the node cache based on the lease level configured for the query interface of the bill business contract. In this way, once the first consensus node detects in the node cache that the business status data corresponding to a certain query interface has reached the effective duration based on the lease level corresponding to the query interface, it needs to re-pull the data from the core chain. In this way, when the first consensus node receives a business query request sent by a business node in the business network, it can directly access it from the node cache without having to pull data from the core chain in real time, thereby reducing the number of visits to the core chain by the first consensus node, thereby reducing the node operation burden.

[0086] For further understanding, please refer to Figure 2 , Figure 2 This is a schematic diagram of a scenario for performing data detection and update on a node cache provided by an embodiment of the present application. Figure 2 As shown, node 200a may be the first consensus node with X bill business contracts deployed, where X is a positive integer. For example, the node 200a may be the above Figure 1 Any consensus node in the core consensus network of the corresponding embodiment, for example, node 120a. For ease of understanding, the bill business contract deployed by node 200a in the embodiment of the present application can be taken as an example of 2, which can specifically include Figure 2 Contract 2A and Contract 2B are shown. The transaction business type corresponding to Contract 2A may be an invoicing business type, meaning Contract 2A can be used to perform invoicing business, and the transaction business type corresponding to Contract 2B may be a credit reporting business type, meaning Contract 2B can be used to perform credit reporting business.

[0087] It should be understood that node 200a can obtain the interface configuration information of the bill business contract deployed on node 200a based on the state data publishing service provided by itself. The interface configuration information here is a business contract management device used to manage transaction business in the business network, based on the core chain of the core consensus network (for example, Figure 2 The lease management contract on the core chain 2q shown in FIG. 2 is configured for the bill business contract. Further, the node 200a can cache the node associated with the bill business contract (for example, Figure 2 The node cache 2000h shown in FIG. 10a obtains the service status data corresponding to each query interface. If node 200a detects that the service status data corresponding to a query interface (i.e., the target query interface) is invalid based on the lease level corresponding to the target query interface, it re-acquires the service update data used to update the service status data of the target query interface from core chain 2q, and then stores the service update data in node cache 2000h.

[0088] For example, for contract 2A, the interface configuration information obtained by node 200a can be Figure 2 The interface configuration information X1 shown in FIG. 1 may indicate the N1 query interfaces configured for contract 2A and the lease level corresponding to each query interface, where N1 is a positive integer. Figure 2 As shown, query interface J 11 The corresponding lease level can be lease level L 11 (For example, 10 seconds); query interface J 12 The corresponding lease level can be lease level L 12 (e.g., 30 minutes); ...; query interface J 1n The corresponding lease level can be lease level L 1n (For example, 5 minutes). Further, the business status data associated with contract 2A obtained by the node 200a from the node cache 2000h may include: query interface J 11 Corresponding status data S 11 , query interface J 12 Corresponding status data S 12 ,…,Query interface J 1n Corresponding status data S 1n At this time, the node 200a may determine whether the service status data corresponding to each query interface is invalid data based on the lease level corresponding to each query interface.

[0089] If node 200a queries interface J 12 The cache duration corresponding to the lease level (for example, 30 minutes) is detected, and the query interface J 12Corresponding status data S 12 (For example, if the virtual assets of the business object are 100 game coins) are invalid data, the node 200a can re-acquire the virtual assets of the business object (for example, 90 game coins) from the core chain 2q, and then use the re-acquired virtual assets as the state data S 12 Update business update data (for example, Figure 2 The updated data S shown 12 ), at this time, the node 200a can update the data S 12 This means that the node 200a can re-pull the virtual assets of the business object from the core chain 2q every 30 minutes, and then update the virtual assets of the business object stored in the node cache 2000h.

[0090] For example, for contract 2B, the interface configuration information obtained by node 200a can be Figure 2 The interface configuration information X2 shown in FIG. 1 may indicate the N2 query interfaces configured for contract 2B and the lease level corresponding to each query interface, where N2 is a positive integer. Figure 2 As shown, query interface J 21 The corresponding lease level can be lease level L 21 (For example, 5 seconds); query interface J 22 The corresponding lease level can be lease level L 22 (e.g., 10 minutes); ...; query interface J 2n The corresponding lease level can be lease level L 2n (For example, 30 seconds). Further, the business status data associated with contract 2B obtained by the node 200a from the node cache 2000h may include: query interface J 21 Corresponding status data S 21 , query interface J 22 Corresponding status data S 22 ,…,Query interface J 2n Corresponding status data S 2n .

[0091] If node 200a queries interface J 21 Lease level (e.g., 5 seconds), query interface J is detected 21 Corresponding status data S 21 (For example, if the bill status of an electronic bill is "circulation status"), it is invalid data, then the node 200a can re-acquire the bill status of the electronic bill from the core chain 2q (for example, "reimbursement status"), and then use the re-acquired bill status as the data for the status data S21 Update business update data (for example, Figure 2 The updated data S shown 21 ), at this time, the node 200a can update the data S 21 This means that the node 200a can re-pull the bill status of the electronic bill from the core chain 2q every 5 seconds, and then update the bill status of the electronic bill stored in the node cache 2000h.

[0092] Since node 200a can timely re-pull the business update data used to update the business status data corresponding to each query interface from the core chain 2q according to the cache duration corresponding to the lease level corresponding to each query interface, and store the business update data in the node cache in a timely manner, this means that once the business status data corresponding to a query interface in the node cache 2000h is invalid data, it will be immediately updated based on the core chain 2q, so that the business data (business status data or business update data) stored in the node cache 2000h are all valid data. Then, when node 200a receives a business query request associated with a bill business contract from a business node in the business network through a proxy node, the node 200a can access the node cache 2000h based on the cache query service, and quickly find the business result data to be returned to the business node from the node cache 2000h (for example, business update data updated according to the cache duration corresponding to the lease level) without having to pull data from the core chain in real time. In this way, when the business data corresponding to a certain query interface is frequently accessed, the number of times node 200a accesses the core chain can be reduced, thereby reducing the node operation burden.

[0093] Among them, a consensus node (i.e., the first consensus node) in the core consensus network updates the business status data corresponding to the query interface stored in the node cache based on the lease level of each query interface indicated by the interface configuration information of the bill business contract. The specific implementation method can be seen below Figure 3-Figure 8 The corresponding embodiment.

[0094] Further, see Figure 3 , Figure 3 This is a flowchart of a data processing method based on blockchain provided by an embodiment of the present application. Figure 3 As shown, the method can be executed by the first consensus node deployed with the bill business contract. The first consensus node can be a server connected to the core consensus network or a terminal device connected to the core consensus network. The specific form of the first consensus node is not limited here. For example, the first consensus node can be the above Figure 1Node 120a in the core consensus network shown. The method may include at least the following steps S101-S103:

[0095] In step S101, the first consensus node in the core consensus network obtains the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service.

[0096] Specifically, the first consensus node in the core consensus network can obtain the interface configuration information of the bill business contract from the node cache based on the state data publishing service. The interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network. This interface configuration information can be used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface; N is a positive integer. It is understood that there can be one or more bill business contracts deployed on the first consensus node, and the number of bill business contracts is not limited here.

[0097] It can be understood that the interface configuration information of the bill business contract stored in the node cache is obtained from the business configuration information on the core chain based on the business query request associated with the bill business contract obtained historically after the first consensus node successfully writes the business configuration information sent by the business contract management device into the core chain. This means that if the first consensus node has not yet received a business query request associated with a certain query interface (for example, query interface 1), then the lease level of the query interface 1 will not be stored in the node cache temporarily, nor will the business status data corresponding to the query interface 1 be stored, and the business status data corresponding to the query interface 1 will not be updated regularly. If the first consensus node has received a business query request associated with a certain query interface (for example, query interface 2), then when the first consensus node obtains the lease level corresponding to the query interface 2 and the business status data corresponding to the query interface 2 from the core chain, it will store them in the node cache, and will subsequently update the business status data corresponding to the query interface 2 regularly.

[0098] It should be understood that the lease management contract included in the core chain in the core consensus network is determined by the system management device corresponding to the system management object. The lease management contract can be used to indicate the mapping relationship between the lease level and the cache duration. One lease level can correspond to one cache duration. The system management object can set the number of lease levels corresponding to the system management device (that is, the terminal device used by the system management object) and the cache duration corresponding to each lease level to obtain a lease management contract. For example, the lease levels set by the lease management contract may include no lease level, the first lease level, the second lease level, the third lease level, and the fourth lease level, etc. Among them, the lease level here can be used to indicate the cache duration of the business status data stored in the node cache. For example, the cache duration corresponding to the no lease level here can be zero; the cache duration corresponding to the first lease level can be cache duration 1 (for example, 10 seconds); the cache duration corresponding to the second lease level can be cache duration 2 (for example, 30 seconds); the cache duration corresponding to the third lease level can be cache duration 3 (for example, 5 minutes); and the cache duration corresponding to the fourth lease level can be cache duration 4 (for example, 30 minutes).

[0099] In response to a setup operation performed by a system management object (a trigger operation performed by the system management object for a lease level), the system management device can generate a management contract on-chain request based on the lease management contract, which is then sent to the core consensus network. This trigger operation can include contactless operations such as voice and gestures, or contact operations such as clicks and long presses, which are not limited here. The management contract on-chain request here refers to a service request for writing the lease management contract to the core chain. To improve the security of data transmission between the system management device and the core consensus network, the system management device can determine information to be signed when generating the management contract on-chain request. For example, this information to be signed can include the lease management contract, the device identifier of the system management device, and object information of the system management object (e.g., object avatar identifier, object name, object reputation, etc.). This object information is obtained after authorization by the system management object, and acquisition of the object information must comply with relevant laws, regulations, and standards of the relevant country and region. Furthermore, the system management device can sign the information to be signed based on the object private key of the system management object, thereby obtaining the object signature information. At this time, the system management device can generate a management contract chain request for sending to the core consensus network based on the object signature information and the information to be signed including the lease management contract.

[0100] When the consensus node (for example, the first consensus node) in the core consensus network obtains the management contract on-chain request, the lease management contract carried by the management contract on-chain request can be obtained. It can be understood that when the first consensus node obtains the management contract on-chain request, the object public key corresponding to the system management object can be obtained from the core chain, and then the object signature information carried by the management contract on-chain request can be verified based on the object public key to obtain the verification result. If the verification result indicates that the verification failed, the first consensus node can determine that the management contract on-chain request is an illegal request, and then generate a chain failure notification for returning to the system management device (i.e., a chain result notification for indicating a chain failure). Optionally, if the verification result indicates that the verification is successful, the first consensus node can determine that the management contract on-chain request is a legal request, and then obtain the lease management contract from the management contract on-chain request. Furthermore, the first consensus node can package the lease management contract to obtain the block to be verified to be written into the core chain, and then broadcast the block to be verified to the second consensus node in the core consensus network, so that the second consensus node can reach a consensus on the obtained block to be verified and obtain a consensus result for returning to the first consensus node. If there is a consensus result that exceeds the consensus threshold (for example, 2 / 3) in the consensus result, indicating that the consensus is successful, it can be determined that the blockchain nodes in the blockchain network have reached a consensus, and then it can be determined that the lease management contract in the block to be verified is successfully deployed on the core chain; the generation timestamp of the block to be verified can be used to update the maximum generation timestamp on the core chain. At this time, after successfully deploying the lease management contract on the core chain, the first consensus node can also generate a chain success notification for returning to the system management device (that is, a chain result notification for indicating that the chain is successful).

[0101] For further understanding, please refer to Figure 4 , Figure 4 This is a schematic diagram of a scenario where a lease management contract is put on the chain, as provided in an embodiment of the present application. Figure 4 As shown, the system management device 400z in the embodiment of the present application can be an object terminal used by the system management object, and the system management device 400z can interact with the core consensus network for data. The node 400a (i.e., the first consensus node) in the embodiment of the present application can be any consensus node in the core consensus network, for example, the node 400a can be the above-mentioned Figure 1 Node 120a in the core consensus network in the corresponding embodiment.

[0102] like Figure 4 As shown, the system management device 400z can obtain the lease management contract determined by the system management object when responding to the setting operation of the lease level of the system management object, and then determine the lease management contract based on the lease management contract. Figure 4 The information to be signed 41k is shown. At this time, the system management device 400z can sign the information to be signed 41k based on the object private key of the system management object, and obtain the object signature information 42k corresponding to the information to be signed 41k. It can be understood that the system management device 400z can obtain the hash calculation rule for the information to be signed 41k, and the hash calculation rule can be a summary algorithm agreed in advance by the system management device 400z and other consensus nodes in the core consensus network (for example, node 400a). Therefore, the system management device 400z can perform hash calculation on the information to be signed 41k based on the hash calculation rule to obtain the summary information of the information to be signed 41k (for example, summary information h). In this embodiment of the present application, the summary information h of the information to be signed 41k determined by the system management device 400z may be referred to as the first summary information. Furthermore, the system management device 400z can sign the first summary information based on the object private key of the system management object, so as to obtain Figure 4 The object signature information 42k is shown.

[0103] Furthermore, the system management device 400z can generate a signature based on the information to be signed 41k and the object signature information 42k. Figure 4 The management contract on-chain request 40Q shown in FIG. 4 can then be sent to the node 400a, so that the node 400a can verify the object signature information 42k based on the object public key corresponding to the object private key (i.e., the object public key of the system management object) to obtain the verification result. It can be understood that the node 400a can obtain the signature result from the core chain of the core consensus network (e.g., Figure 4 The core chain 40q shown in FIG40a) obtains the object public key of the system management object, and then can verify the object signature information 42k based on the object public key to obtain the first summary information of the information to be signed 41k. At the same time, the node 400a can also obtain the same hash calculation rules as the system management device 400z, perform hash calculation on the signature information 41k, and thus obtain the summary information of the information to be signed 41k (for example, summary information H). In this embodiment of the application, the summary information H of the information to be signed 41k determined by the node 400a can be referred to as the second summary information.

[0104] At this time, the node 400a can compare the first summary information with the second summary information to obtain the signature verification result to determine whether the information to be signed 41k has been tampered with. It can be understood that if the first summary information is different from the second summary information, the node 400a can determine that the signature verification result indicates a verification failure. At this time, the node 400a can determine that the system management device 400z is an illegal terminal, and the received management contract on-chain request 40Q is determined to be an illegal request. At this time, the node 400a can directly generate an on-chain result notification for indicating a failure to on-chain (i.e., an on-chain failure notification, for example, Figure 4 The uplink result notification 40T shown is sent to the system management device 400z to return the uplink result notification 40T to the system management device 400z.

[0105] Alternatively, if the first summary information and the second summary information are the same, the node 400a may determine that the signature verification result indicates successful verification, which means that the information to be signed 41k has not been tampered with and that the information to be signed 41k is indeed sent by the system management device 400z. In this case, the node 400a may determine that the system management device 400z is a legitimate terminal and determine that the received management contract on-chain request 40Q is a legitimate request. It is understandable that when the signature verification result determined by the node 400a indicates successful verification, the node 400a may on-chain the lease management contract.

[0106] in, Figure 4 The illustrated core chain 40q is a shared blockchain shared by every consensus node in the core consensus network to which node 400a belongs. Each consensus node can access the information stored in each block in core chain 40q. Core chain 40q includes blocks 4A, 4B, ..., 4N, and a block to be verified. Block 4A can be referred to as the genesis block of core chain 40q. The block to be verified in core chain 40q contains the lease management contract determined by the system management object.

[0107] Among them, it can be understood that when the node 400a successfully obtains the lease management contract, it can generate a business transaction (i.e., contract on-chain transaction) for writing the lease management contract to the core chain 40q. Furthermore, the node 400a can obtain the block 4N with the maximum generation timestamp from the core chain 40q, and then the contract on-chain transaction can be packaged and processed to obtain the block to be verified to be written to the core chain 40q. For example, the node 400a can use the block hash value of block 4N as the parent block hash value of the block to be verified, and then determine the transaction hash value of the contract on-chain transaction, and determine the block hash value of the block to be verified based on the transaction hash value. At this time, the node 400a can package the parent block hash value and the block hash value to obtain the block to be verified.

[0108] Furthermore, the node 400a can broadcast the block to be verified to other consensus nodes (i.e., the second consensus node) on the core consensus network, so that the second consensus node can reach a consensus on the obtained block to be verified and obtain a consensus result. If the consensus result returned by the second consensus node exceeds the consensus threshold (e.g., 1 / 2 or 2 / 3), indicating that the consensus is successful, the node 400a can determine that the blockchain nodes in the blockchain network have reached a consensus, and then write the block to be verified into the above-mentioned core chain 40q, that is, the block to be verified is used as the next block of block 4N. Among them, the maximum generation timestamp of the block to be verified is used to update the maximum generation timestamp on the core chain 40q. Due to the tamper-proof nature of the core chain 40q, this can effectively improve the security of the storage of the lease management contract.

[0109] Among them, the first consensus node in the core consensus network can be deployed with a bill business contract, which can be used to instruct the business nodes in the business network to execute corresponding transaction business. It can be understood that in order to enable the bill business contract to implement the data release lease interface, the contract management object in the embodiment of the present application can perform interface configuration operations on the bill business contract to implement the data release lease interface based on the lease management contract on the core chain of the core consensus network (for example, Figure 4 The lease management contract in the block to be verified is shown in the figure. Each query interface of the bill business contract is configured with a corresponding lease level, thereby determining the business configuration information corresponding to the bill business contract. The interface configuration operations here can include non-contact operations such as voice and gestures, as well as contact operations such as clicks and long presses, which are not limited here.

[0110] For example, the contract management object can perform interface configuration operations based on the actual needs of the transaction business to set different lease levels for each query interface of the bill business contract associated with the transaction business, thereby obtaining the business configuration information of the bill business contract. It is understandable that for multiple query interfaces of any bill business contract, the lease levels can be the same or different, and this will not be limited here. Figure 2 As shown, the query interface J of contract 2A deployed on the first consensus node (e.g., node 200a) 11 Corresponding lease level and query interface J 12 The corresponding lease level can be the same lease level, for example, the lease level of the two query interfaces can both be the first lease level. Figure 2 Query interface J of contract 2A shown 11 Corresponding lease level and query interface J 12 The corresponding lease level can also be different lease levels, for example, query interface J 11The corresponding lease level is the first lease level, query interface J 12 The corresponding lease level is the second lease level.

[0111] Optionally, the contract management object can also select a lease level (e.g., the third lease level) based on the mapping between lease levels and cache durations indicated by the lease management contract as the global lease level associated with the bill business contract. This means that if the contract management object does not specifically set a lease level for a query interface, the global lease level can be used as the default lease level for that query interface.

[0112] At this time, the business contract management device corresponding to the contract management object (i.e., the terminal device used by the contract management object) can respond to the interface configuration operation and send the business configuration information sent for the bill business contract to the core consensus network. When the consensus node in the core consensus network (e.g., the first consensus node) receives the business configuration information, it can generate a contract configuration block including the business configuration information, and then successfully write the contract configuration block into the core chain. The specific implementation method of the first consensus node writing the contract configuration block into the core chain can be referred to the specific implementation method of the first consensus node writing the block to be verified into the core chain, which will not be limited here.

[0113] Step S102: Obtain business status data corresponding to N query interfaces from the node cache associated with the bill business contract.

[0114] The node cache can store not only the business status data corresponding to each query interface, but also the storage timestamp of each business status data, so that the first consensus node can determine whether the business status data is invalid data. The N query interfaces can include a target query interface.

[0115] It should be understood that the first consensus node can obtain the cache duration that has a mapping relationship with the lease level corresponding to the target query interface from the lease management contract on the core chain, and then determine the obtained cache duration as the target cache duration corresponding to the target query interface. Furthermore, the first consensus node can determine the storage timestamp of the business status data corresponding to the target query interface from the node cache, and then determine the valid expiration timestamp of the business status data corresponding to the target query interface based on the storage timestamp and the target cache duration. If the detection timestamp does not reach the valid expiration timestamp, the first consensus node can determine that the business status data corresponding to the target query interface is valid data. Optionally, if the detection timestamp reaches the valid expiration timestamp, the first consensus node can determine that the business status data corresponding to the target query interface is invalid data.

[0116] For ease of understanding, further, please refer to Table 1, which is a data hash table stored in a node cache provided in an embodiment of the present application. Among them, the number of bill business contracts deployed by the first consensus node can be M, and one bill business contract can correspond to one data hash table. Among them, the data hash table in the embodiment of the present application can be a hash table with the contract name corresponding to the bill business contract as the dimension, and the data hash table can include sub-hash tables associated with each query interface of the bill business contract. Among them, a sub-hash table can store the interface name, lease level and business status data of the query interface associated with it. As shown in Table 1, contract A can be any bill business contract deployed on the first consensus node, and the contract A can include multiple query interfaces. For ease of explanation, the number of query interfaces of contract A in the embodiment of the present application can be 3 as an example, and can specifically include query interface J. 11 , query interface J 12 And query interface J 13 Since the first consensus node has not yet received the query interface J 12 Therefore, the data hash table shown in Table 1 does not include the query interface J. 12 The associated sub-hash table only includes the query interface J 11 Associated sub-hash tables and query interface J 13 The associated sub-hash table is shown in Table 1:

[0117] Table 1

[0118]

[0119] Among them, the query interface J 11 The associated sub-hash table may include a query interface J 11 The corresponding lease level and the query interface J 11 Corresponding multiple business status data. Among them, query interface J 11 The corresponding lease level can be lease level L 11 (For example, the fourth lease level), the query interface J 11 The number of corresponding business status data can be 3 for example, which can specifically include status data S 111 , status data S 112 And status data S 113 Among them, the status data S 111 The storage timestamp of the state data S may be timestamp 1 (eg, 11:57); 112 The storage timestamp of the state data S may be timestamp 2 (eg, 12:03); 113The storage timestamp of can be timestamp 3 (for example, 11:50). As shown in Table 1, the query interface J 13 The associated sub-hash table may include a query interface J 13 The corresponding lease level and the query interface J 13 Corresponding multiple business status data. Among them, query interface J 13 The corresponding lease level can be lease level L 13 (For example, the third lease level), the query interface J 13 The number of corresponding business status data can be 2 for example, which can specifically include status data S 131 And status data S 132 Among them, the status data S 121 The storage timestamp of the state data S may be timestamp 4 (eg, 17:05); 132 The storage timestamp can be timestamp 5 (for example, 17:04). Of course, when there are too many query interfaces associated with contract A, the first consensus node can split the data hash table in the node cache according to the sub-hash tables associated with the query interfaces, so that the business status data corresponding to each query interface can be stored separately in the node cache to improve subsequent search efficiency.

[0120] At this time, the first consensus node can obtain the business status data corresponding to the N query interfaces obtained from the node cache associated with contract A based on Table 1 above, including: query interface J 11 Corresponding business status data and query interface J 13 Corresponding business status data. The first consensus node can detect each business status data shown in Table 1 above to determine whether each business status data is invalid data.

[0121] For example, if the target query interface determined by the first consensus node is the query interface J shown in Table 1 11 , then the first consensus node can obtain the lease level L from the lease management contract 11 (For example, the fourth lease level) has a cache duration (for example, 30 minutes) with a mapping relationship, and then the obtained cache duration can be used as a query interface J 11 Furthermore, the first consensus node can determine the storage timestamp of each business status data corresponding to the query interface from the node cache, and then determine the effective expiration timestamp of each business status data based on the storage timestamp and the target cache duration. For example, the first consensus node can determine the state data S 111 The effective expiration timestamp is 12:27; the status data S 112The effective expiration timestamp of the status data S can be 12:33; 113 The valid expiration timestamp of the service state data may be 12:20. If the detection timestamp reaches the valid expiration timestamp of a certain service state data, the first consensus node may determine that the service state data is invalid data.

[0122] In step S103, if it is detected that the business status data corresponding to the target query interface is invalid data based on the lease level corresponding to the target query interface, the business update data for updating the business status data of the target query interface is re-acquired from the core chain and stored in the node cache.

[0123] Among them, the business update data here can be used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0124] As shown in Table 1 above, if the first consensus node determines the state data S 111 The effective expiration timestamp is 12:27; the status data S 112 The effective expiration timestamp of the status data S can be 12:33; 113 The effective deadline timestamp of can be 12:20, then, when the detection timestamp reaches 12:20, the first consensus node can determine the state data S 113 Invalid data, it is necessary to re-acquire the state data S from the core chain. 113 When the detection timestamp reaches 12:27, the first consensus node can determine the status data S 111 Invalid data, it is necessary to re-acquire the state data S from the core chain. 111 Update the business update data; when the detection timestamp reaches 12:33, the first consensus node can determine the status data S 112 Invalid data, it is necessary to re-acquire the state data S from the core chain. 112 The business update data to be updated.

[0125] For example, if the state data S 113 If the bill status of a business object (e.g., a dining object in a restaurant) is "circulation status", the first consensus node can re-acquire the bill status of the business object from the core chain. If the bill status of the business object re-acquired by the first consensus node is different from another bill status stored in the node cache (e.g., "reimbursement status"), the first consensus node can use the reimbursement status as the state data S 113The updated business update data is stored in the above table 1, and the storage timestamp stored in the above table 1 is added to the above table 1. Of course, if the bill status of the business object re-acquired by the first consensus node is the same as the bill status stored in the node cache (for example, still in the "circulation state"), then the first consensus node can directly update the status data S based on the timestamp of the re-acquired bill status. 113 The storage timestamp is updated.

[0126] In an embodiment of the present application, the first consensus node in the core consensus network can obtain the interface configuration information of the bill business contract deployed on the first consensus node based on the status data publishing service. The interface configuration information here can be used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. This means that the embodiment of the present application can flexibly limit whether the business status data corresponding to each query interface is invalid data in the node cache by configuring the corresponding lease level for the query interface of the bill business contract. In this way, once the first consensus node detects that the business status data corresponding to a certain query interface (i.e., the target query interface) has reached the valid period in the node cache based on the lease level corresponding to the query interface, it is necessary to re-pull the business update data used to update the business status data that is invalid data from the core chain. In this way, when the first consensus node receives a business query request sent by a business node in the business network, it can directly access it from the node cache without having to pull data from the core chain in real time, thereby reducing the number of visits of the first consensus node to the core chain, thereby reducing the node operation burden.

[0127] Further, see Figure 5 , Figure 5 This is a flow chart of a data processing method based on blockchain provided by an embodiment of the present application. The method involves a business node in a business network, an agent node in a routing agent network, and a first consensus node in a core consensus network. The business network, routing agent network, and core consensus network here can belong to the same blockchain network, and the routing agent network is used to isolate the business network and the core consensus network. Among them, the business node can be the above-mentioned Figure 1 Any service node in the service network of the corresponding embodiment, for example, node 110a; the proxy node can be the above-mentioned Figure 1 The proxy node 10D in the routing proxy network in the corresponding embodiment; the first consensus node can be the above Figure 1 Any consensus node in the core consensus network of the corresponding embodiment, for example, node 120a. The method may include at least the following steps S201-S209:

[0128] In step S201, the first consensus node in the core consensus network obtains the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service.

[0129] Specifically, the first consensus node in the core consensus network can obtain the interface configuration information of the bill business contract from the node cache based on the status data publishing service. Among them, the interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network; the interface configuration information can be used to indicate the N query interfaces corresponding to the bill business contract, and the lease level corresponding to each query interface; N is a positive integer. It can be understood that there can be M bill business contracts deployed on the first consensus node, where M is a positive integer. One bill business contract corresponds to one transaction business type in the business network.

[0130] In step S202, the first consensus node obtains the business status data corresponding to N query interfaces from the node cache associated with the bill business contract.

[0131] The node cache can store not only the business status data corresponding to each query interface, but also the storage timestamp of each business status data, so that the first consensus node can determine whether the business status data is invalid data. The N query interfaces can include a target query interface.

[0132] In step S203, if it is detected that the business status data corresponding to the target query interface is invalid data based on the lease level corresponding to the target query interface, the first consensus node re-acquires the business update data used to update the business status data of the target query interface from the core chain, and stores the business update data in the node cache.

[0133] Among them, the business update data here can be used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0134] The specific implementation of steps S201 to S203 can be found in the above Figure 3 The description of steps S101 to S103 in the corresponding embodiment will not be repeated here.

[0135] Step S204: The service node in the service network sends a service query request to the proxy node.

[0136] Specifically, when executing transactions, a service node in the business network can generate a service query request based on auxiliary service information. For example, when executing an invoicing service, a service node can use the object identifier of an enterprise object as auxiliary service information to generate a service query request for querying the risk status of the enterprise object. Furthermore, the service node can send the service query request to a proxy node.

[0137] To improve the authenticity and security of service-assisted information during data transmission, the service node can sign the service-assisted information based on its node private key to obtain node signature information corresponding to the service-assisted information. Furthermore, the service node can use its node identifier, node signature information, and service-assisted information to generate a service query request for transmission to the proxy node.

[0138] Step S205: The proxy node forwards the service query request to the first consensus node.

[0139] Specifically, when the proxy node receives a business query request, it can perform authority verification on the business query request, and then forward the business query request to the first consensus node when the authority verification result is a legal result.

[0140] The permission verification here may include verifying whether the node identifier of the business node belongs to the node identifier in the illegal node list, verifying whether the node signature information corresponding to the business auxiliary information is incorrect based on the node public key of the business node, etc. The illegal node list here may be a blacklist stored by the proxy node, and the illegal nodes corresponding to the illegal node identifiers in the illegal node list may include detected malicious nodes, nodes reported by others, nodes with abnormal transaction frequencies in a certain time period, etc. It is understandable that the specific implementation method of the proxy node verifying the node signature information in the business query request can be referred to the specific implementation method of the first consensus node verifying the object signature information in the management contract on-chain request mentioned above, and will not be repeated here.

[0141] Step S206: The first consensus node determines the business query interface based on the target business contract associated with the business query request.

[0142] Specifically, when the first consensus node obtains a business query request, it can determine the transaction business type indicated by the business query request, and then, based on the cache query service and the determined transaction business type, determine the target business contract associated with the business query request from the M bill business contracts deployed on the first consensus node. For example, if the transaction business type indicated by the business query request is an invoicing business type, the first consensus node needs to obtain the bill business contract used to execute the invoicing business from the M deployed bill business contracts as the target business contract (for example, Contract A shown in Table 1 above). Among them, one query interface of the target business contract can correspond to one query type. Furthermore, the first consensus node can obtain a query interface that matches the query type of the business auxiliary information from the target business contract, and then determine the obtained query interface as the business query interface.

[0143] In step S207, the first consensus node determines the business result data based on the request type of the business query request, the business query interface, and the node cache.

[0144] The request type of the service query request may include a first request type and a second request type. The first request type may be used to indicate that the service query request is a first service request. The second request type may be used to indicate that the service query request is a non-first service request.

[0145] It is understandable that when the request type of the business query request belongs to the first request type, the first consensus node can obtain the data hash table associated with the target business contract from the node cache, and then perform a data query on the data hash table based on the business query interface. If the first consensus node does not find the business result data corresponding to the business auxiliary information in the data hash table, the first consensus node can obtain the business result data corresponding to the business auxiliary information from the core chain, and then store the business result data in the data hash table of the node cache.

[0146] For example, if the business auxiliary information of the business query request is the object identifier of the enterprise object (for example, the enterprise account), and the business query request is used to instruct the first consensus node to obtain the risk status of the enterprise object, then when the business query interface obtained by the first consensus node is the query interface J of contract A shown in Table 1 above, 11 , but in the query interface J 11 When the risk status of the enterprise object is not found in the corresponding business status data, the first consensus node can obtain the risk status of the enterprise object from the core chain based on the object identifier of the enterprise object, and then store the risk status of the enterprise object in the query interface J. 11 The associated sub-hash table.

[0147] Optionally, if the interface name of the business query interface is not found in the data hash table, the first consensus node can obtain the business result data corresponding to the business auxiliary information from the core chain, and then obtain the lease level corresponding to the business query interface from the core chain based on the level query identifier associated with the cache query service deployed on the first consensus node. Then, in the node cache, a sub-hash table for storing data associated with the business query interface can be generated based on the interface name of the business query interface and the lease level corresponding to the business query interface. Furthermore, the first consensus node can add the business result data to the sub-hash table, and add the added timestamp to the sub-hash table as the storage timestamp corresponding to the business result data; wherein, the business result data in the sub-hash table here is the business status data of the business query interface.

[0148] For example, if the business auxiliary information of the business query request is the enterprise name of the enterprise object, and the business query request is used to instruct the first consensus node to obtain the cumulative number of electronic bills associated with the enterprise object, then when the business query interface obtained by the first consensus node is the query interface J of contract A shown in Table 1 above, 12 This means that the first consensus node has not found the interface name of the business query interface in Table 1. At this time, after obtaining the cumulative number of bills of the enterprise object (for example, 100) from the core chain based on the enterprise name of the enterprise object, the first consensus node can obtain the query interface J from the core chain based on the level query identifier associated with the cache query service deployed on the first consensus node. 12 The corresponding lease level (for example, lease level L 12 ), and then based on the query interface J 12 The interface name of the query interface J 12 The corresponding lease level generates a storage and query interface J 12 The associated sub-hash table can then use the cumulative number of bills as a query interface J 12 The business status data is added to this sub-hash table, and the added timestamp is added to the sub-hash table as the storage timestamp corresponding to the cumulative number of bills.

[0149] Among them, when the first consensus node obtains the lease level corresponding to the business query interface from the core chain, it needs to obtain the level query identifier associated with the cache query service deployed on the first consensus node, and then can obtain the contract configuration block associated with the bill business contract from the core chain based on the level query identifier. Among them, the contract configuration block here can be obtained by the first consensus node after uploading the business configuration information sent by the business contract management device for the bill business contract to the chain. It can be understood that if the business configuration information included in the contract configuration block contains the lease level corresponding to the business query interface, the first consensus node can obtain the lease level corresponding to the business query interface from the business configuration information.

[0150] Optionally, if the lease level corresponding to the business query interface does not exist in the business configuration information included in the contract configuration block, the first consensus node needs to query the global lease level configured by the business contract management device in the core chain to obtain the query result, and then determine the lease level corresponding to the business query interface based on the query result. If the query result indicates that there is a global lease level in the core chain, the first consensus node can use the global lease level as the lease level corresponding to the business query interface. If the query result indicates that there is no global lease level in the core chain, the first consensus node can determine the no lease level as the lease level corresponding to the business query interface; wherein, the cache duration corresponding to the no lease level is zero, that is, the first consensus node needs to obtain the business status data corresponding to the business query interface from the core chain in real time.

[0151] It should be understood that when the request type of the business query request belongs to the second request type, the first consensus node can obtain the data hash table associated with the target business contract from the node cache, and then query the data hash table for the interface name corresponding to the business query interface. Furthermore, if the interface name of the business query interface is consistent with the interface name of the target query interface, the first consensus node can directly obtain the business result data corresponding to the business auxiliary information from the node cache, where the business result data here can be the business update data after the first consensus node updates the business status data of the target query interface.

[0152] Step S208: The first consensus node returns the business result data to the proxy node.

[0153] Step S209: The proxy node forwards the service result data to the service node.

[0154] Specifically, in order to improve the security of business result data during data transmission between the core consensus network and the business network, the proxy node can obtain the system public key of the business network when receiving the business result data sent by the first consensus node, and then encrypt the business result data based on the system public key of the business network to obtain system encrypted data information. Furthermore, the proxy node can return the system encrypted data to the business node of the business node (i.e., the business node that sent the business query request). When the business node obtains the system encrypted data information, it can decrypt the system encrypted data information based on the system private key of the business network, thereby obtaining the business result data to execute the corresponding transaction business.

[0155] For further understanding, please refer to Figure 6 , Figure 6 This is a schematic diagram of a framework for implementing a data publishing lease interface for a bill business contract provided in an embodiment of the present application. Figure 6 As shown, the blockchain network in the embodiment of the present application may include two sub-networks: a business network and a core consensus network, and the business nodes in the business network and the core consensus nodes in the core consensus network can directly interact with each other to achieve data transmission between the two sub-networks. Optionally, the blockchain network in the embodiment of the present application may include not only the business network and the core consensus network, but also a routing proxy network for isolating the business network and the core consensus network. The proxy nodes in the routing proxy network can implement routing forwarding functions between the business network and the core consensus network. The number of sub-networks in the blockchain network will not be limited here.

[0156] It is understandable that the sub-networks included in the blockchain network in the embodiment of the present application can be taken as examples of the business network and the core consensus network to illustrate the specific implementation method of the business nodes in the business network obtaining business result data. Among them, multiple business nodes in the business network can generate corresponding business query requests according to their own business needs. The business query request here may include Figure 6 Business query request 61Q and business query request 62Q are shown. Business query request 61Q can be used to query business result data associated with a bill business contract (e.g., contract 6A) deployed by the first consensus node, and business query request 62Q can be used to query business result data associated with another bill business contract (e.g., contract 6B) deployed by the first consensus node.

[0157] like Figure 6As shown, when there are a large number of bill business contracts, in order to improve search efficiency and alleviate node storage pressure, the number of node caches accessed by the consensus node (for example, the first consensus node) in the embodiment of the present application can be multiple, wherein one bill business contract corresponds to one node cache. Figure 6 As shown, the node cache 6100H can be used to store the data hash table associated with contract 6A, and the node cache 6200H can be used to store the data hash table associated with contract 6B. The first consensus node can periodically update the data in the node cache 6100H according to the lease level corresponding to the query interface indicated by the interface configuration information X1 of contract 6A and the cache duration corresponding to each lease level. Similarly, the first consensus node can periodically update the data in the node cache 6200H according to the lease level corresponding to the query interface indicated by the interface configuration information X2 of contract 6B and the cache duration corresponding to each lease level.

[0158] It should be understood that when the first consensus node receives a business query request 61Q, it can call the cache query service, determine the corresponding business result data based on the request type of the business query request 61Q, the business query interface corresponding to the business query request 61Q, and the node cache 6100H, and then return the business result data to the business node used to send the business query request 61Q.

[0159] Similarly, when the first consensus node receives a business query request 62Q, it can call the cache query service, determine the corresponding business result data based on the request type of the business query request 62Q, the business query interface corresponding to the business query request 62Q, and the node cache 6200H, and then return the business result data to the business node used to send the business query request 62Q.

[0160] It can be seen that the first consensus node in the embodiment of the present application can deploy different node caches for each bill business contract, so that the first consensus node can process business query requests associated with multiple bill business contracts in parallel at the same time, thereby being able to obtain business result data from the corresponding node cache more quickly, thereby improving the efficiency of data query.

[0161] Further, see Figure 7 , Figure 7 This is a system architecture diagram of a tax blockchain system provided by the embodiment of this application. Figure 7 As shown, the business network, routing agent network and core consensus network in the embodiment of the present application constitute the entire complete blockchain business system. Among them, the core consensus network can include a core chain (for example, the above Figure 1Optionally, the core consensus network may also include Figure 7 Multiple core chains are shown. Each core chain can be used to store business data corresponding to different transaction businesses. Transaction businesses here include various sub-businesses related to tax services, including invoicing, credit reporting, loss and inflow / loss reporting, enterprise qualification, and tax refund services. For example, core chain 0 can be used to store business data corresponding to invoicing, core chain 1 can be used to store business data corresponding to credit reporting, and so on.

[0162] It is understandable that when blockchain is used in some scenarios of government (for example, tax system) or commercial organizations, in order to improve the confidentiality and security of data, when the blockchain system involves relevant data such as personal privacy or business security, the layered blockchain structure of "business network-core consensus network" in the embodiment of this application can be adopted.

[0163] Since the entire tax business will involve regulatory agencies, invoicing parties, reimbursement parties and tax payers, etc. Figure 7 The business nodes in the business network shown may include terminal devices corresponding to tax bureau objects, terminal devices corresponding to enterprise objects, and terminal devices corresponding to consumer objects. Among them, the tax bureau object may refer to a regulatory agency in the regulatory network (for example, computer equipment corresponding to provincial, municipal, district, etc. tax bureaus), the enterprise object may be an invoicing service provider, reimbursement service provider or retail enterprise in the public cloud (for example, KA enterprise, i.e., large retail customers and key retail customer enterprises), etc., and the consumer object may be a payment service provider, circulation service provider or retail enterprise in the private cloud, etc. Among them, the business node in the business network generates a business query request for querying business result data, and then forwards the business query request to the first consensus node in the core consensus network through the proxy node in the routing proxy network, so that the first consensus node obtains the business result data for return to the business node based on the node cache.

[0164] Proxy nodes in the routing proxy network can be used to isolate the business network from the core consensus network. Proxy nodes can provide peer-to-peer (P2P) services, routing services, certificate caching, and authentication services. Peer-to-peer services refer to services within a P2P network. Based on a specific type of network protocol, network nodes in a P2P network do not require a central node to maintain network status. Instead, each node maintains the overall node status or the connection status of its neighbors through broadcast interactions with neighboring nodes. Routing services are a basic node function that can be used for inter-node communication to isolate the business network from the core consensus network. The certificate cache is used to cache the identity certificates of each node. The certificate here can refer to the Public Key Infrastructure (PKI). In a certificate infrastructure, a certificate is a proof of identity of the owner of a public key and is issued by a certificate authority (CA). Asymmetric encryption and digital signatures can be implemented using the PKI. This PKI can include public-private key cryptography, X509 certificates, and CA certificate signing centers. The authentication service can be used to authenticate the service nodes in the service network, etc. It is understandable that in the embodiment of the present application, the proxy node can be used to forward the service query request sent by the service node to the first consensus node in the core consensus network, and can also be used to forward the service result data returned by the first consensus node to the service node.

[0165] The consensus nodes (i.e., accounting nodes) in the core consensus network can be trusted nodes in the tax-specific network and can determine their consensus responsibilities by invoking permission contracts. The permission contracts also store the flow logic for the entire lifecycle of electronic invoices, such as the invoice status, flow process, data access rights, e-invoice claiming conditions, e-invoice issuance conditions, and so on. For example, upon receiving a lease management contract from a system management device, the first consensus node in the core consensus network can write it into the core chain of the core consensus network. The first consensus node can also write business configuration information associated with an invoice business contract from a business contract management device into the core chain upon receiving it. The first consensus node can also, based on the status data publishing service, regularly update the business status data corresponding to each query interface stored in the node cache, according to the cache duration of the corresponding lease level of the query interface. This allows the first consensus node to subsequently invoke the cache query service upon receiving a business query request forwarded by a proxy node, and determine the business result data corresponding to the business auxiliary information based on the request type, business query interface, and node cache.

[0166] In an embodiment of the present application, when the first consensus node receives a business query request, it can directly pull data from the node cache without having to pull data from the core chain in real time. This can reduce the number of times the first consensus node accesses the core chain, thereby reducing the node operation burden. In addition, the contract interface framework provided in the embodiment of the present application stipulates that the bill business contract needs to implement and configure the lease level, which can simplify the need for blockchain data storage. At the same time, by setting different lease levels for the bill business contract itself, the transaction business associated with the blockchain network is more flexible to execute, thereby making the transaction business access simpler and faster. At the same time, the contract interface framework provided in the real-time example of the present application realizes the combination of the smart contract framework and the cache framework, and is decoupled from the business logic itself, so that more complex business forms can be adapted in the future.

[0167] Further, see Figure 8 , Figure 8 This is a schematic diagram of the structure of a data processing device based on blockchain provided by an embodiment of the present application. Figure 8 As shown, the blockchain-based data processing device 1 can be a computer program (including program code) running on a computer device. For example, the blockchain-based data processing device 1 is an application software; the blockchain-based data processing device 1 can be used to execute the corresponding steps of the method provided in the embodiment of the present application. Figure 8 As shown, the blockchain-based data processing device 1 can run on the first consensus node in the core consensus network, and the first consensus node can be the above-mentioned Figure 2 The corresponding embodiment of the node 200a. The blockchain-based data processing device 1 may include: a configuration information acquisition module 11, a state data acquisition module 12, a state data update module 13, a target duration determination module 14, a valid timestamp determination module 15, an invalid data determination module 16, a lease contract acquisition module 17, a packaging module 18, a block broadcast module 19, a lease contract chain module 20, a target contract determination module 21, a business interface determination module 22, a result data determination module 23, and a result data return module 24.

[0168] The configuration information acquisition module 11 is used for the first consensus node in the core consensus network to obtain the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service; the interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network; the interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface; N is a positive integer;

[0169] The status data acquisition module 12 is used to obtain business status data corresponding to N query interfaces respectively from the node cache associated with the bill business contract; the N query interfaces include a target query interface;

[0170] The status data update module 13 is used to re-acquire the business update data for updating the business status data of the target query interface from the core chain if it is detected that the business status data corresponding to the target query interface is invalid data based on the lease level corresponding to the target query interface, and store the business update data in the node cache; the business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0171] The lease management contract is used to indicate the mapping relationship between lease levels and cache durations; one lease level corresponds to one cache duration;

[0172] The target duration determination module 14 is configured to obtain a cache duration that is mapped to a lease level corresponding to a target query interface from the lease management contract, and determine the obtained cache duration as a target cache duration corresponding to the target query interface;

[0173] The valid timestamp determination module 15 is used to determine the storage timestamp of the service status data corresponding to the target query interface from the node cache, and determine the valid expiration timestamp of the service status data corresponding to the target query interface based on the storage timestamp and the target cache duration;

[0174] The invalid data determination module 16 is configured to determine that the service status data corresponding to the target query interface is invalid data if the detection timestamp reaches the valid expiration timestamp.

[0175] The lease contract acquisition module 17 is used to obtain the lease management contract carried in the management contract chain request when obtaining the management contract chain request sent by the system management device with system management authority.

[0176] The lease contract acquisition module 17 includes: an on-chain request acquisition unit 171 , a signature verification unit 172 and a lease contract acquisition unit 173 .

[0177] The on-chain request acquisition unit 171 is used to acquire a management contract on-chain request sent by a system management device with system management authority; the management contract on-chain request includes information to be signed and object signature information; the object signature information is obtained by signing the information to be signed based on the object private key of the system management object; the information to be signed includes the lease management contract determined by the system management object;

[0178] The signature verification unit 172 is used to obtain the object public key corresponding to the system management object from the core chain, verify the object signature information based on the object public key, and obtain a signature verification result;

[0179] The lease contract acquisition unit 173 is configured to determine that the management contract on-chain request is a legitimate request if the signature verification result indicates that the verification is successful, and to obtain the lease management contract from the management contract on-chain request.

[0180] The specific implementation of the on-chain request acquisition unit 171, the signature verification unit 172 and the lease contract acquisition unit 173 can be found in the above Figure 4 The description of the signature verification of the management contract chain request in the corresponding embodiment will not be repeated here.

[0181] The packaging module 18 is used to package the lease management contract to obtain the block to be verified to be written into the core chain;

[0182] The block broadcast module 19 is used to broadcast the block to be verified to the second consensus node in the core consensus network, so that the second consensus node can reach a consensus on the obtained block to be verified and obtain a consensus result to be returned to the first consensus node;

[0183] The lease contract chain module 20 is used to determine that the blockchain nodes in the blockchain network have reached a consensus if there is a consensus result that exceeds the consensus threshold in the consensus result, indicating that the consensus is successful, and to determine that the lease management contract in the block to be verified is successfully deployed on the core chain; the generation timestamp of the block to be verified is used to update the maximum generation timestamp on the core chain.

[0184] The number of bill business contracts deployed by the first consensus node is M, and one bill business contract corresponds to one transaction business type in the business network; M is a positive integer; the blockchain network includes a routing proxy network; the routing proxy network is used to isolate the business network from the core consensus network;

[0185] The target contract determination module 21 is configured to, upon receiving a business query request forwarded by a proxy node in the routing proxy network, determine a target business contract from among the M bill business contracts based on the cache query service and the transaction business type indicated by the business query request. The business query request is generated by a business node in the business network based on business auxiliary information. One query interface of the target business contract corresponds to one query type.

[0186] The business interface determination module 22 is used to obtain a query interface that matches the query type of the business auxiliary information from the target business contract, and determine the obtained query interface as the business query interface;

[0187] The result data determination module 23 is configured to determine the service result data corresponding to the service auxiliary information based on the request type of the service query request, the service query interface, and the node cache.

[0188] The request type of the service query request includes a first request type; the first request type is used to indicate that the service query request is a first service request;

[0189] The result data determination module 23 includes: a data query unit 231 , a first result determination unit 232 , a lease level query unit 233 , a sub-hash table generation unit 234 , a result data storage unit 235 , an interface query unit 236 and a second result determination unit 237 .

[0190] The data query unit 231 is used to obtain a data hash table associated with a target business contract from a node cache, and perform data query on the data hash table based on a business query interface;

[0191] The first result determining unit 232 is configured to obtain the business result data corresponding to the business auxiliary information from the core chain if the business result data corresponding to the business auxiliary information is not found in the data hash table.

[0192] The lease level query unit 233 is used to obtain the lease level corresponding to the business query interface from the core chain based on the level query identifier associated with the cache query service deployed on the first consensus node after obtaining the business result data corresponding to the business auxiliary information from the core chain if the interface name of the business query interface is not found in the data hash table.

[0193] The lease level query unit 233 includes: an identification acquisition subunit 2331 , a configuration block acquisition subunit 2332 , a first level acquisition subunit 2333 , a query result determination subunit 2334 and a second level acquisition subunit 2335 .

[0194] The identifier acquisition subunit 2331 is used to obtain the level query identifier associated with the cache query service deployed on the first consensus node after obtaining the business result data corresponding to the business auxiliary information from the core chain if the interface name of the business query interface is not found in the data hash table;

[0195] The configuration block acquisition subunit 2332 is used to obtain the contract configuration block associated with the bill business contract from the core chain based on the level query identifier; the contract configuration block is obtained by the first consensus node after uploading the business configuration information sent by the business contract management device for the bill business contract to the chain;

[0196] The first level acquisition subunit 2333 is configured to acquire the lease level corresponding to the business query interface from the business configuration information if the business configuration information included in the contract configuration block contains the lease level corresponding to the business query interface.

[0197] The query result determination subunit 2334 is configured to query the global lease level configured by the business contract management device in the core chain to obtain a query result if the lease level corresponding to the business query interface does not exist in the business configuration information included in the contract configuration block;

[0198] The second level obtaining subunit 2335 is used to determine the lease level corresponding to the service query interface based on the query result.

[0199] The second level acquisition subunit 2335 is further configured to:

[0200] If the query result indicates that there is a global lease level in the core chain, the global lease level will be used as the lease level corresponding to the business query interface;

[0201] If the query result indicates that there is no global lease level in the core chain, the no lease level is determined as the lease level corresponding to the business query interface; the cache duration corresponding to the no lease level is zero.

[0202] The specific implementation of the identification acquisition subunit 2331, the configuration block acquisition subunit 2332, the first level acquisition subunit 2333, the query result determination subunit 2334 and the second level acquisition subunit 2335 can be found in the above Figure 3 The description of the lease level corresponding to the service query interface in the corresponding embodiment will not be repeated here.

[0203] The sub-hash table generating unit 234 is used to generate a sub-hash table for storing information associated with the business query interface in the node cache based on the interface name of the business query interface and the lease level corresponding to the business query interface;

[0204] The result data storage unit 235 is used to add the business result data to the sub-hash table, and add the added timestamp as the storage timestamp corresponding to the business result data to the sub-hash table; the business result data in the sub-hash table is the business status data of the business query interface.

[0205] The request type of the service query request includes a second request type; the second request type is used to indicate that the service query request is not the first service request;

[0206] The interface query unit 236 is used to obtain a data hash table associated with the target business contract from the node cache, and query the data hash table for the interface name corresponding to the business query interface;

[0207] The second result determining unit 237 is configured to obtain the service result data corresponding to the service auxiliary information from the node cache if the interface name of the service query interface is consistent with the interface name of the target query interface; the service result data is the service update data.

[0208] The specific implementation of the data query unit 231, the first result determination unit 232, the lease level query unit 233, the sub-hash table generation unit 234, the result data storage unit 235, the interface query unit 236 and the second result determination unit 237 can be referred to above. Figure 3 The description of the business result data in the corresponding embodiment will not be repeated here.

[0209] The result data returning module 24 is used to return the service result data to the service node through the proxy node.

[0210] The result returning module 24 is specifically used for:

[0211] The business result data is sent to the proxy node so that the proxy node encrypts the business result data based on the system public key of the business network to obtain system encrypted data information for return to the business node; the business node is used to decrypt the system encrypted data information based on the system private key of the business network when obtaining the system encrypted data information to obtain the business result data.

[0212] The specific implementation of the configuration information acquisition module 11, the status data acquisition module 12, the status data update module 13, the target duration determination module 14, the valid timestamp determination module 15, the invalid data determination module 16, the lease contract acquisition module 17, the packaging module 18, the block broadcast module 19, the lease contract chain module 20, the target contract determination module 21, the business interface determination module 22, the result data determination module 23 and the result data return module 24 can be found in the above Figure 5 The description of steps S201 to S209 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.

[0213] Further, see Figure 9 , Figure 9 This is a schematic diagram of a computer device provided in an embodiment of the present application. Figure 9 As shown, the computer device 1000 may be the first consensus node in the core consensus network, and the first consensus node may be the above-mentioned Figure 2Corresponding to the node 200a in the embodiment, the computer device 1000 may include: at least one processor 1001, for example, a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 9 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application.

[0214] exist Figure 9 In the computer device 1000 shown, the network interface 1004 is primarily used for network communication with the agent node, the business contract management device, and the system management device; the user interface 1003 is primarily used for providing an interface for user input; and the processor 1001 can be used to call the device control application stored in the memory 1005 to implement:

[0215] The first consensus node in the core consensus network obtains the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service. The interface configuration information is configured for the bill business contract by the business contract management device based on the lease management contract on the core chain of the core consensus network. The interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface. N is a positive integer.

[0216] Obtain business status data corresponding to N query interfaces from the node cache associated with the bill business contract; the N query interfaces include the target query interface;

[0217] If, based on the lease level corresponding to the target query interface, it is detected that the business status data corresponding to the target query interface is invalid data, the business update data used to update the business status data of the target query interface is re-obtained from the core chain, and the business update data is stored in the node cache; the business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

[0218] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 and Figure 5 The description of the data processing method based on blockchain in the corresponding embodiment can also be performed as described above. Figure 8 The description of the blockchain-based data processing device 1 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0219] The present invention also provides a computer-readable storage medium that stores a computer program. The computer program includes program instructions that are executed by a processor to implement Figure 3 and Figure 5 The data processing methods based on blockchain provided in each step can be found in Figure 3 as well as Figure 5 The implementation methods provided by each step will not be repeated here.

[0220] The computer-readable storage medium may be the data transmission device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0221] The present application also provides a computer program product, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, enabling the computer device to perform the descriptions of the blockchain-based data processing methods or apparatuses described in the preceding embodiments, which are not further detailed here. Furthermore, the descriptions of the beneficial effects of employing the same methods are also not further detailed.

[0222] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules that are not listed, or may optionally include other steps and units inherent to these processes, methods, apparatuses, products, or devices.

[0223] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0224] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method based on blockchain, characterized in that: include: The first consensus node in the core consensus network obtains the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service; The interface configuration information is configured by the business contract management device for the bill business contract based on the lease management contract on the core chain of the core consensus network; the interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface; N is a positive integer; Obtaining business status data corresponding to each of the N query interfaces from a node cache associated with the bill business contract; the N query interfaces include a target query interface; If it is detected that the service status data corresponding to the target query interface is invalid data based on the lease level corresponding to the target query interface, re-acquire service update data for updating the service status data of the target query interface from the core chain, and store the service update data in the node cache; The business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

2. The method according to claim 1, characterized in that The lease management contract is used to indicate the mapping relationship between lease levels and cache durations; one lease level corresponds to one cache duration; The method further comprises: Obtaining, from the lease management contract, a cache duration that has a mapping relationship with the lease level corresponding to the target query interface, and determining the obtained cache duration as a target cache duration corresponding to the target query interface; Determine a storage timestamp of the service status data corresponding to the target query interface from the node cache, and determine a valid expiration timestamp of the service status data corresponding to the target query interface based on the storage timestamp and the target cache duration; If the detection timestamp reaches the valid expiration timestamp, it is determined that the service status data corresponding to the target query interface is invalid data.

3. The method according to claim 1, characterized in that The method further comprises: Upon receiving a management contract on-chain request from a system management device with system management authority, obtaining the lease management contract carried in the management contract on-chain request; The lease management contract is packaged to obtain a block to be verified to be written into the core chain; Broadcasting the block to be verified to a second consensus node in the core consensus network, so that the second consensus node reaches a consensus on the acquired block to be verified and obtains a consensus result to be returned to the first consensus node; If there is a consensus result in the consensus results that exceeds the consensus threshold, indicating that the consensus is successful, it is determined that the blockchain nodes in the blockchain network have reached a consensus, and it is determined that the lease management contract in the block to be verified is successfully deployed on the core chain; the generation timestamp of the block to be verified is used to update the maximum generation timestamp on the core chain.

4. The method according to claim 3, characterized in that When a management contract on-chain request is obtained from a system management device with system management authority, obtaining the lease management contract carried in the management contract on-chain request includes: Obtaining a management contract on-chain request sent by a system management device with system management authority; the management contract on-chain request includes information to be signed and object signature information; the object signature information is obtained by signing the information to be signed based on the object private key of the system management object; the information to be signed includes the lease management contract determined by the system management object; Obtain the object public key corresponding to the system management object from the core chain, and verify the object signature information based on the object public key to obtain a verification result; If the signature verification result indicates that the verification is successful, the management contract chain request is determined to be a legal request, and the lease management contract is obtained from the management contract chain request.

5. The method according to claim 1, wherein The number of the bill business contracts deployed by the first consensus node is M, and one bill business contract corresponds to one transaction business type in the business network; M is a positive integer; The blockchain network includes a routing proxy network; the routing proxy network is used to isolate the business network from the core consensus network; The method further comprises: Upon receiving a business query request forwarded by a proxy node in the routing proxy network, determining a target business contract from the M bill business contracts based on a cache query service and a transaction business type indicated by the business query request; the business query request is generated by a business node in the business network based on business auxiliary information; and one query interface of the target business contract corresponds to one query type; Acquire a query interface that matches the query type of the business auxiliary information from the target business contract, and determine the acquired query interface as a business query interface; Determining the business result data corresponding to the business auxiliary information based on the request type of the business query request, the business query interface, and the node cache; The service result data is returned to the service node through the proxy node.

6. The method according to claim 5, characterized in that The request type of the service query request includes a first request type; the first request type is used to indicate that the service query request is a first service request; The determining, based on the request type of the service query request, the service query interface, and the node cache, the service result data corresponding to the service auxiliary information includes: Obtaining a data hash table associated with the target business contract from the node cache, and performing a data query on the data hash table based on a business query interface; If the business result data corresponding to the business auxiliary information is not found in the data hash table, the business result data corresponding to the business auxiliary information is obtained from the core chain.

7. The method according to claim 6, characterized in that The method further comprises: If the interface name of the business query interface is not found in the data hash table, after obtaining the business result data corresponding to the business auxiliary information from the core chain, the lease level corresponding to the business query interface is obtained from the core chain based on the level query identifier associated with the cache query service deployed on the first consensus node; In the node cache, based on the interface name of the business query interface and the lease level corresponding to the business query interface, a sub-hash table for storing information associated with the business query interface is generated; The business result data is added to the sub-hash table, and the added timestamp is added to the sub-hash table as the storage timestamp corresponding to the business result data; the business result data in the sub-hash table is the business status data of the business query interface.

8. The method according to claim 7, characterized in that If the interface name of the business query interface is not found in the data hash table, after obtaining the business result data corresponding to the business auxiliary information from the core chain, based on the level query identifier associated with the cache query service deployed on the first consensus node, obtaining the lease level corresponding to the business query interface from the core chain includes: If the interface name of the business query interface is not found in the data hash table, then after obtaining the business result data corresponding to the business auxiliary information from the core chain, obtain the level query identifier associated with the cache query service deployed on the first consensus node; Based on the level query identifier, obtaining a contract configuration block associated with the bill business contract from the core chain; the contract configuration block is obtained by the first consensus node after uploading the business configuration information sent by the business contract management device for the bill business contract to the chain; If the lease level corresponding to the business query interface exists in the business configuration information included in the contract configuration block, the lease level corresponding to the business query interface is obtained from the business configuration information.

9. The method according to claim 8, characterized in that The method further comprises: If the lease level corresponding to the business query interface does not exist in the business configuration information included in the contract configuration block, querying the global lease level configured by the business contract management device in the core chain to obtain a query result; Based on the query result, a lease level corresponding to the service query interface is determined.

10. The method according to claim 9, characterized in that The determining, based on the query result, a lease level corresponding to the service query interface includes: If the query result indicates that the global lease level exists in the core chain, the global lease level is used as the lease level corresponding to the service query interface; If the query result indicates that the global lease level does not exist in the core chain, the no-lease level is determined as the lease level corresponding to the service query interface; the cache duration corresponding to the no-lease level is zero.

11. The method according to claim 5, characterized in that The request type of the service query request includes a second request type; the second request type is used to indicate that the service query request is not the first service request; The determining, based on the request type of the service query request, the service query interface, and the node cache, the service result data corresponding to the service auxiliary information includes: Obtaining a data hash table associated with the target business contract from the node cache, and querying the data hash table for an interface name corresponding to the business query interface; If the interface name of the service query interface is consistent with the interface name of the target query interface, the service result data corresponding to the service auxiliary information is obtained from the node cache; the service result data is the service update data.

12. The method according to claim 5, characterized in that The returning the business result data to the business node through the proxy node includes: The business result data is sent to the proxy node, so that the proxy node encrypts the business result data based on the system public key of the business network to obtain system encrypted data information for returning to the business node; the business node is used to decrypt the system encrypted data information based on the system private key of the business network when obtaining the system encrypted data information to obtain the business result data.

13. A data processing device based on blockchain, characterized in that: include: A configuration information acquisition module is used for the first consensus node in the core consensus network to obtain the interface configuration information of the bill business contract deployed on the first consensus node based on the state data publishing service; The interface configuration information is configured by the business contract management device for the bill business contract based on the lease management contract on the core chain of the core consensus network; the interface configuration information is used to indicate the N query interfaces corresponding to the bill business contract and the lease level corresponding to each query interface; N is a positive integer; A status data acquisition module, configured to acquire business status data corresponding to each of the N query interfaces from a node cache associated with the bill business contract; the N query interfaces include a target query interface; a status data updating module configured to, if it is detected based on the lease level corresponding to the target query interface that the service status data corresponding to the target query interface is invalid data, reacquire service update data for updating the service status data of the target query interface from the core chain, and store the service update data in the node cache; The business update data is used to return from the node cache to the business node in the business network when a business query request associated with the bill business contract is received; the business network and the core consensus network belong to the same blockchain network.

14. A computer device, characterized in that: include: processor and memory; The processor is connected to a memory, wherein the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises a computer program stored in a computer-readable storage medium, wherein the computer program is suitable for being read and executed by a processor, so as to enable a computer device having the processor to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data processing method and device, computer equipment and storage medium

    CN113421097A

  • Data processing method and apparatus in blockchain network, storage medium, and computer device

    WO2021047445A1