CN117294753A - Block chain-based data processing method, equipment and readable storage medium - Google Patents

Block chain-based data processing method, equipment and readable storage medium Download PDF

Info

Publication number
CN117294753A
CN117294753A CN202210679940.2A CN202210679940A CN117294753A CN 117294753 A CN117294753 A CN 117294753A CN 202210679940 A CN202210679940 A CN 202210679940A CN 117294753 A CN117294753 A CN 117294753A
Authority
CN
China
Prior art keywords
service
contract
target
node
business
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210679940.2A
Other languages
Chinese (zh)
Inventor
王宗友
朱耿良
刘汉卿
廖志勇
刘区城
时一防
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210679940.2A priority Critical patent/CN117294753A/en
Publication of CN117294753A publication Critical patent/CN117294753A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Abstract

The embodiment of the application discloses a data processing method, equipment and readable storage medium based on a blockchain, wherein the method comprises the following steps: acquiring a service processing request carrying service data, and calling a first contract front-end service program comprising node guiding information based on the service processing request; generating, in a first contract pre-service program, a business transaction that matches a blockchain data structure based on the business data; the business transaction is sent to a target business node indicated by the node guiding information through a first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to target equipment; the target service node belongs to a blockchain network. By adopting the method and the device, the difficulty of the block chain service access can be reduced, and the data security of the block chain network can be improved.

Description

Block chain-based data processing method, equipment and readable storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data processing method and apparatus based on blockchain, and a readable storage medium.
Background
With the rapid development of network technology and the importance of people on data security, blockchains are greatly emphasized and applied.
In the prior art, the target device needs to be pre-adapted to the blockchain network, and the service participant can upload the service data to the blockchain network, for example, the target device installed with the invoice client needs to be packaged with the blockchain configuration information, that is, the developer needs to complete the docking work of the blockchain data structure, but the developer of the target device or the developer of the invoice client may not obtain the blockchain configuration information or cannot accurately package the blockchain configuration information, so that the target device cannot upload the service data to the blockchain network. Obviously, the prior art has the defect of high difficulty in accessing the block chain service. In addition, in the prior art, the target device directly performs data transmission with the blockchain node in the blockchain network, so that the target device can access the on-chain data which is irrelevant to the service data on the blockchain node, and the data security of the blockchain network is reduced.
Disclosure of Invention
The embodiment of the application provides a data processing method, device and readable storage medium based on a block chain, which can not only reduce the difficulty of block chain service access, but also improve the data security of a block chain network.
In one aspect, an embodiment of the present application provides a data processing method, including:
the target equipment acquires a service processing request carrying service data and calls a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
generating, in a first contract pre-service program, a business transaction that matches a blockchain data structure based on the business data;
the business transaction is sent to a target business node indicated by the node guiding information through a first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to target equipment; the target service node belongs to a blockchain network.
In one aspect, a data processing method is provided, where the method is performed by a target service node in a blockchain network, and the method includes:
Acquiring business transaction sent by target equipment through a first contract front-end service program; the business transaction is generated by the target equipment in the first contract front-end service program based on the business data, and the business transaction is matched with the blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying service data is acquired; the first contract front-end service includes node guiding information; the node guiding information is used for guiding the first contract front-end service program to send the business transaction to the target business node;
invoking a target business contract deployed in the blockchain network in association with the first contract pre-server according to the business transaction;
and carrying out service processing on the service transaction through the target service contract, and returning a service processing result to the target equipment.
In one aspect, a data processing apparatus based on a blockchain is provided, where the data processing apparatus based on the blockchain is operated on a target device, and includes:
the request acquisition module is used for acquiring a service processing request carrying service data and calling a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
The first generation module is used for generating business transactions matched with the blockchain data structure based on the business data in the first contract front-end service program;
the first sending module is used for sending the business transaction to the target business node indicated by the node guiding information through the first contract front-end service program, so that the target business node calls the target business contract which is associated with the first contract front-end service program and is deployed in the blockchain network according to the business transaction, performs business processing on the business transaction through the target business contract, and returns a business processing result to the target equipment; the target service node belongs to a blockchain network.
Wherein, request acquisition module includes:
the type comparison unit is used for comparing the service type corresponding to the service data with the service type corresponding to the first contract front-end service program;
the first generation unit is used for generating program deployment prompt information if the service type corresponding to the first contract front-end service program is different from the service type corresponding to the service data; the program deployment prompt information is used for prompting the target equipment to deploy a second contract front-end service program; the service type corresponding to the second contract front-end service program is the same as the service type corresponding to the service data;
And the program calling unit is used for calling the first contract front-end service program if the service type corresponding to the first contract front-end service program is the same as the service type corresponding to the service data.
Wherein the first contract front-end service program encapsulates blockchain configuration information of the blockchain network; the blockchain configuration information is used for indicating a blockchain data structure of the blockchain network;
a first generation module comprising:
the first acquisition unit is used for acquiring a transaction format in the blockchain configuration information in a first contract front-end service program;
and the data packaging unit is used for packaging the business data into business transactions matched with the blockchain data structure based on the transaction format.
Wherein the first contract pre-service includes a device private key for the target device;
a first transmitting module comprising:
the second acquisition unit is used for acquiring a transaction hash value of the business transaction through the first contract front-end service program, encrypting the transaction hash value based on the equipment private key, and obtaining a transaction signature corresponding to the business transaction;
and the transaction sending unit is used for sending the business transaction carrying the transaction signature to the target business node indicated by the node guiding information through the first contract front-end service program.
Wherein the first contract pre-service program further comprises a node public key for the target service node;
the blockchain-based data processing device further includes:
the request acquisition module is also used for acquiring a service query request sent by the target object; the service inquiry request carries object information of a target object;
the information encryption module is used for encrypting the object information based on the node public key in the first contract front-end service program to obtain encrypted object information;
the second sending module is used for sending a service query request carrying encrypted object information to a target service node through a first contract front-end service program, so that the target service node generates object query data aiming at the object information according to the service query request when the encrypted object information is successfully decrypted based on a node private key corresponding to the target service node;
the second sending module is further configured to receive object query data returned by the target service node, and return the object query data to the target object.
Wherein, data processing apparatus based on block chain still includes:
the request acquisition module is also used for acquiring a program deployment request aiming at the target service type and acquiring an initial contract front service program with the target service type based on the program deployment request; the initial contract front-end service program provides a service interface corresponding to the target service type; the initial contract pre-service program encapsulates blockchain configuration information for indicating a blockchain data structure of the blockchain network;
And the program configuration module is used for configuring the initial pre-service program and determining the configured initial contract pre-service program as a first contract pre-service program.
Wherein, the program configuration module includes:
a second generation unit configured to generate, in the initial contract pre-service program, an asymmetric key pair for the target device and a device communication certificate for the asymmetric key pair; the asymmetric key pair includes a device private key and a device public key;
the first determining unit is used for determining a service node for processing a target service type in the blockchain network as a target service node and generating node guiding information according to node information of the target service node;
and a second determining unit configured to determine an initial contract pre-service program including the asymmetric key pair, the device communication certificate, and the node guidance information as the first contract pre-service program.
Wherein, data processing apparatus based on block chain still includes:
the second generation module is used for generating a business contract to be compiled aiming at the target business type; the business contracts to be compiled comprise block chain configuration information; the blockchain configuration information is used for indicating a blockchain data structure in the blockchain network;
The third generation module is used for reading the contract content of the business contract to be compiled through the front-end service code generator and generating a front-end service code according to the contract content;
and the program deployment module is used for compiling the pre-service code into an initial contract pre-service program, and deploying the initial contract pre-service program to obtain a first contract pre-service program if the target service contract generated based on the service contract to be compiled is successfully uplink.
In one aspect, a data processing apparatus based on a blockchain is provided, where a method is performed by a target service node in a blockchain network, and the method includes:
the transaction acquisition module is used for acquiring business transaction sent by the target equipment through the first contract front-end service program; the business transaction is generated by the target equipment in the first contract front-end service program based on the business data, and the business transaction is matched with the blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying service data is acquired; the first contract front-end service includes node guiding information; the node guiding information is used for guiding the first contract front-end service program to send the business transaction to the target business node;
The contract calling module is used for calling a target business contract which is associated with the first contract front-end service program and is deployed in the blockchain network according to business transaction;
and the result returning module is used for carrying out service processing on the service transaction through the target service contract and returning the service processing result to the target equipment.
Wherein, contract calling module includes:
the type comparison unit is used for acquiring the service type to be verified of the service transaction and comparing the service type to be verified with the node service type; the node service type is used for indicating the service type of the service processed by the target service node;
the error return unit is used for returning service error prompt information to the target equipment if the service type to be verified is different from the node service type;
the contract calling unit is used for calling a target service contract deployed in the blockchain network according to the contract name of the first contract front-end service program if the service type to be verified is the same as the node service type; the contract name of the first contract pre-service program is the same as the contract name of the target business contract.
In one aspect, the present application provides a computer device comprising: a processor, a memory, a network interface;
The processor is connected to the memory and the network interface, where the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program to make the computer device execute the method in the embodiment of the present application.
In one aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program being adapted to be loaded by a processor and to perform a method according to embodiments of the present application.
In one aspect, the present application provides a computer program product comprising a computer program stored on a computer readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device performs the method in the embodiment of the present application.
In this embodiment of the present application, when a target device obtains a service processing request carrying service data, based on the service processing request, a first contract front-end service program including node guiding information may be invoked, where it may be understood that a service type handled by the first contract front-end service program is the same as a service type of the service data; further, in the first contract front-end service, generating a business transaction matching the blockchain data structure based on the business data, i.e., the first contract front-end service may generate a business transaction matching the blockchain data structure, so that the target device may skip adaptation with the blockchain network through the first contract front-end service; further, through the first contract front-end service program, the target device may send the service transaction to the target service node indicated by the node guiding information, so that the target service node may call a target service contract disposed in the blockchain network and associated with the first contract front-end service program according to the service transaction, and through the target service contract, the target service node may perform service processing on the service transaction and return a service processing result to the target device. As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1a is a schematic diagram of a system architecture according to an embodiment of the present application;
FIG. 1b is a schematic diagram of a blockchain network hierarchy provided in an embodiment of the present application;
FIG. 1c is a hierarchical multi-cascaded blockchain network provided by embodiments of the present application;
FIG. 2 is a schematic diagram of a scenario for blockchain-based data processing provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a block chain based data processing method according to an embodiment of the present application;
FIG. 4 is a second scenario diagram illustrating a blockchain-based data processing provided by an embodiment of the present application;
FIG. 5 is a second flow chart of a block chain based data processing method according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for initial contract pre-service deployment based on blockchain according to an embodiment of the present application;
FIG. 7 is a flowchart illustrating a third exemplary embodiment of a block chain based data processing method;
FIG. 8 is a system architecture diagram under a tax blockchain system provided in an embodiment of the present application;
FIG. 9 is a schematic diagram illustrating a block chain based data processing apparatus according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a block chain based data processing apparatus according to a second embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
For ease of understanding, the following simple explanation of partial nouns is first made:
1. blockchain (Block chain): in a narrow sense, the blockchain is a chain data structure taking a block as a basic unit, and the block uses a digital abstract to verify the transaction history acquired before, so that the blockchain is suitable for the requirements of tamper resistance and expandability in a distributed accounting scene; in a broad sense, blockchain also refers to distributed accounting techniques implemented by blockchain structures, including distributed consensus, privacy and security protection, point-to-point communication techniques, network protocols, smart contracts, and the like.
The goal of the blockchain is to implement a distributed data logging ledger that allows only additions and not deletions. The basic structure of the ledger floor is a linear linked list. The linked list is formed by serially connecting blocks, the Hash value of the preceding block is recorded in the following blocks, and whether each block (and the transaction in the block) is legal or not can be rapidly checked by calculating the Hash value. If a node in the network proposes to add a new block, a consensus acknowledgement must be made for the block via a consensus mechanism.
2. Hash value (hash): also called information characteristic value or eigenvalue, hash value is generated by converting input data of arbitrary length into a password by hash algorithm and performing fixed output, and original input data cannot be retrieved by decrypting the hash value, which is a one-way encryption function. In a blockchain, each block (except the initial block) contains a hash value of the successor block, which is the potential core foundation and most important aspect in blockchain technology, which preserves the authenticity of the recorded and viewed data, as well as the integrity of the blockchain as a whole. In embodiments of the present application, hash values may be used for signing to confirm the legitimacy of the signer.
3. Smart Contract: is a computer protocol that aims to propagate, verify or execute contracts in an informative manner. In a blockchain system, a smart contract (abbreviated as contract) is a code that can be understood and executed by each node of the blockchain, and can execute any logic and obtain a result. In practice, smart contracts are managed and tried through transactions on the blockchain. Each transaction corresponds to a remote procedure call (Remote Procedure Call, RPC) request to the blockchain system. If the smart contract is said to be equivalent to an executable program, the blockchain is said to be equivalent to an operating system that provides a runtime environment. The blockchain may contain multiple contracts, distinguished by contract account numbers (IDs), identification numbers, or names. In this example, the target business contracts are intelligent contracts in a blockchain network.
4. Contract execution: by initiating a transaction, the user may invoke a contract already deployed on the blockchain. Each node in the blockchain system runs the same contract. For contracts that require data to be read, the node's own ledger would be accessed. Finally, each node mutually verifies whether the execution results are consistent (consensus), if so, each node stores the necessary results into each account book, and returns the results to the user.
5. Public key (public key) and private key (private key): the public key and the private key are a key pair (namely a public key and a private key) obtained through an algorithm, the public key is a public part of the key pair, and the private key is a non-public part. Public keys are commonly used to encrypt data, verify digital signatures, and the like. By means of this algorithm it is ensured that the resulting key pair is unique, and when using this key pair, if one of the keys is used to encrypt a piece of data, it must be decrypted with the other key, e.g. the public key is used to encrypt the data, and if the private key is used, it must be decrypted with the public key, otherwise the decryption will not succeed.
6. Certificate, herein referred to as public key certificate hierarchy (Public Key Infrastructure, PKI for short), in which a certificate is an identification of the public key owner, issued by an authority (Certificate Authority, CA for short). Asymmetric encryption and digital signature of information can be achieved based on public key certificate systems.
Referring to fig. 1a, fig. 1a is a schematic diagram of a system architecture according to an embodiment of the present application. As shown in fig. 1a, the system may include a blockchain network 10 and a target device cluster, which may include: the target devices 100a, 100b, 100c, …, 100n, it will be appreciated that the above system may include one or more target devices, and the number of target devices is not limited in this application. The target device in the embodiments of the present application refers to a device that generates and transmits a business transaction to the blockchain network 10. The target device includes, but is not limited to, a terminal device or a service server. The service server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing a cloud database, cloud service, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, basic cloud computing service such as big data and an artificial intelligence platform. Terminal devices include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, aircraft, and the like.
Wherein a communication connection may exist between the clusters of target devices, for example, a communication connection exists between target device 100a and target device 100b, and a communication connection exists between target device 100a and target device 100 c. Meanwhile, any target device in the target device cluster may have a communication connection with the blockchain network 10, such as a communication connection between the target device 100a and the blockchain network 10. The communication connection is not limited to a connection manner, and may be directly or indirectly connected through a wired communication manner, may be directly or indirectly connected through a wireless communication manner, or may be other manners, which is not limited herein.
It should be appreciated that each target device in the target device cluster shown in fig. 1a may be installed with a contract pre-servlet comprising blockchain configuration information for the blockchain network 10 that, when run in each target device, may interact with the blockchain network 10 described above in fig. 1a, respectively. The contract pre-service program in the embodiment of the present application is a contract-level pre-service deployed for a service participant, and encapsulates a description of a blockchain ledger structure and state data of the blockchain network 10, which may provide all interfaces (Application Programming Interface, abbreviated as APIs) of a certain service contract deployed in the blockchain network 10, and the target device may call an interface of the contract-level pre-service like calling a common API service.
The service type corresponding to the contract front-end service program is not limited, and the service type can be set according to an actual application scene, wherein the contract front-end service program can be a contract front-end service program (such as a first contract front-end service program) for virtual asset transfer service, can be a contract front-end service program (such as a second contract front-end service program) for billing service, can be a contract front-end service program for credit investigation service, can be a contract front-end service program for business access deficiency service, can be a contract front-end service program for enterprise qualification service, and can be a contract front-end service program for tax refund service. The contract front-end service program may be a stand-alone client, or may be an embedded sub-client integrated into a certain client (e.g., social client, educational client, multimedia client, etc.), which is not limited herein. The pre-contract service programs installed by each target device respectively may be the same or different, and the blockchain network 10 includes blockchain nodes for processing the service types corresponding to each pre-contract service program respectively.
The network structure of the blockchain network 10 is not limited in this embodiment, and the blockchain network 10 may be a peer-to-peer blockchain network of nodes, and in this structure, the blockchain nodes are in peer-to-peer relationship, so each blockchain node may be used as a service node or a consensus node.
Referring to fig. 1b, fig. 1b is a schematic diagram of a blockchain network c-layer structure according to an embodiment of the present application. As shown in fig. 1b, the hierarchical blockchain network 10c may include a witness network 10a and a consensus network 10b; nodes in witness network 10a may be referred to as service nodes, which have service data associated with their own processing service types, and the service nodes perform service execution mainly, do not participate in accounting consensus, and obtain block header data and block data with visible partial authorization from consensus network 10b by means of identity authentication. The consensus network 10b may also be referred to as a core network, and nodes in the consensus network 10b may be referred to as full-scale nodes or consensus nodes, the full-scale nodes having full-scale data. Witness 10a and consensus 10b are in different network environments, typically witness 10a is in a public network and consensus 10b is in a private network, which interact through a routing boundary.
Referring again to fig. 1b, witness network 10a may include service node 101a, service node 102a, service nodes 103a, …, service node 104a. The witness 10a may include one or more service nodes, the number of which will not be limited here. In witnessed network 10a of fig. 1b, there is a peer-to-peer relationship (i.e., point-to-point relationship) between each service node, which may be the target service node.
Referring back to fig. 1b, consensus network 10b may include full-scale nodes 101b, 102b, 103b, …, 104b. The consensus network 10b may comprise one or more full-scale nodes, the number of which will not be limited here. In the consensus network 10b of fig. 1b, there is a peer-to-peer relationship between each consensus node.
To ensure data interworking between the various blockchain nodes (including the full node and the service node), there may be a data connection between each blockchain node, for example, a data connection between service node 101a and service node 102a, a data connection between service node 101a and service node 103a, and a data connection between full node 101b and full node 104b. Further, there is a data connection between witness network 10a and consensus network 10b, e.g., a data connection between traffic node 101a and full node 102b, a data connection between traffic node 101a and full node 103b, and a data connection between full node 101b and traffic node 104a.
It will be appreciated that data or block transfer may be performed between the blockchain nodes via the data connections described above. The hierarchical blockchain network 10c may implement data connection between nodes based on node identifiers, and for each blockchain node in the hierarchical blockchain network 10c, each blockchain node may have a node identifier corresponding to the node identifier, and each blockchain node may store node identifiers of other blockchain nodes that have a connection relationship with the node identifier, so as to broadcast the acquired data or generated blocks to other blockchain nodes according to the node identifiers of the other blockchain nodes, for example, the service node 101a may maintain a node identifier list as shown in table 1, where the node identifier list stores node names and node identifiers of the other blockchain nodes.
TABLE 1
Node name Node identification
Service node 102a 117.114.151.174
Service node 103a 117.116.189.145
Service node 104a 119.123.789.258
Full-scale node 101b 117.114.151.183
Full-scale node 102b 117.116.189.125
Full-scale node 103b 119.250.485.362
Full-scale node 104b 119.123.789.369
The node identifier may be any of a protocol (Internet Protocol, IP) address for interconnection between networks, and any other information that can be used to identify a node in the hierarchical blockchain network 10c, and the IP address is only illustrated in table 1.
Assuming that the node identifier of the service node 101a is 117.116.156.425, the service node 101a may send a data synchronization request to the full-scale node 101b through the node identifier 117.114.151.183, and the full-scale node 101b may know that the data synchronization request is sent by the service node 101a through the node identifier 117.116.156.425; similarly, the service node 101a may send the transaction data a to the service node 103a through the node identifier 117.116.189.145, and the service node 103a may know that the transaction data a is sent by the service node 101a through the node identifier 117.116.156.425, and data transmission between other nodes is also the same, so that a detailed description is omitted.
In addition, the blockchain network 10 in fig. 1a may be a hierarchical multi-cascaded blockchain network, and referring to fig. 1c, fig. 1c is a hierarchical multi-cascaded blockchain network according to an embodiment of the present application. Like the hierarchical blockchain network 10c in fig. 1b, the hierarchical multi-tandem blockchain network 10d may include a witness network (e.g., witness network 10e in fig. 1 c) and a consensus network (e.g., consensus network 10f in fig. 1 c), wherein the meaning of the consensus network and the full-scale nodes (e.g., full-scale node 101f, full-scale node 102f, full-scale nodes 103f, …, full-scale node 104 f) are illustrated in fig. 1c, please refer to the descriptions of the consensus network 10b and the full-scale nodes in fig. 1b, and are not repeated herein.
Witness network 10e has a service multi-cascade mode, and service nodes of each level separate corresponding service data according to the service authority range of the service nodes to complete data isolation, and service participants read service information and uplink service transactions by connecting the service nodes of the last level. As shown in fig. 1c, the service node 102e and the service node 105e have a cascade relationship with the service node 103e, and at this time, the service node 103e and the service node 105e cannot directly interact data with the consensus network 10f, and data interaction with the consensus network 10f needs to be implemented through the service node 103 e. For example, after acquiring a business transaction, the business node 102e synchronizes the business transaction to the business node 103e, and then the business node 103e synchronizes the business transaction to the consensus network 10f. Similarly, service node 101e has a cascade relationship with service node 104e, and data interaction with consensus network 10f needs to be implemented through service node 104 e. The data interaction between the service node 103e and the service node 104e and the consensus network 10f can be seen in the description of the data interaction between the witness network 10a and the consensus network 10b in fig. 1b, and will not be described here.
In the scenario where the blockchain network 10 is a hierarchical multi-tandem blockchain network 10d, a contract pre-service procedure may be deployed for the service participants beyond the last level of service node (which is the target service node in the embodiments of the present application).
In the embodiment of the application, the data interaction between the target device and the blockchain network is realized through a contract front-end service program, and when a service processing request carrying service data is acquired, the target device can call a first contract front-end service program based on the service processing request, wherein the first contract front-end service program comprises node guiding information; further, in the first contract pre-service program, the target device may generate a business transaction that matches the blockchain data structure based on the business data; further, the target device may send the service transaction to the target service node indicated by the node guiding information through the first contract pre-service program, so that the target service node may call a target service contract deployed in the blockchain network in association with the first contract pre-service program according to the service transaction, and through the target service contract, the target service node may perform service processing on the service transaction and return a service processing result to the target device.
As can be seen from the foregoing, the present application designs a lower-level contract-level front-end service scheme for a service node, where a service contract in a blockchain network can be deployed as an independent service, and in addition to the last-level service node, the embodiment of the present application can deploy a contract-level front-end service (i.e., a contract front-end service program) for a service participant (target device), where the contract front-end service program encapsulates an understanding of a blockchain account structure and status data of the blockchain network, and only provides all interfaces of one contract, so that an external service party only calls interfaces of the contract-level front-end service like calling an API service. By adopting the method and the device, the target equipment does not need to adapt to the blockchain network, so that the difficulty of blockchain service access can be reduced, and in addition, the access authority of the target equipment to the service node can be strictly controlled through the contract front-end service program, so that the data security of the blockchain network can be improved.
It is to be understood that the method provided by the embodiments of the present application may be performed by a computer device, including but not limited to a target device (terminal device or service server) or a target service node (terminal device or service server). The service server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing a cloud database, cloud service, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, basic cloud computing service such as big data and an artificial intelligence platform. Terminal devices include, but are not limited to, cell phones, computers, intelligent voice interaction devices, intelligent home appliances, vehicle terminals, aircraft, and the like.
Further, referring to fig. 2, fig. 2 is a schematic diagram of a scenario of a blockchain-based data processing according to an embodiment of the present application. The embodiments of the present application may be applied to various scenarios including, but not limited to, cloud technology, artificial intelligence, intelligent transportation, assisted driving, and the like. The target device 20a in fig. 2 may be any one of the target devices in the target device cluster in fig. 1 a. As shown in fig. 2, the target device 20a obtains a service processing request 20b carrying service data, which is not limited by the service type of the service data in the embodiment of the present application, and may be set according to an actual application scenario, and in the embodiment of the present application, for ease of understanding and description, the service type is set to be a transfer service, and the service data is set to be "object 201b transfers resource 202b to object 203b". The device for generating the service data is not limited in this embodiment, and may be the target device 20b, or may be another device having an interaction relationship with the target device 20 b.
The target device 20a is deployed with a first contract pre-service 201a, where the first contract pre-service 201a is associated with a target service contract 202a in the blockchain network 10, and may specifically include that the contract names corresponding to the first contract pre-service 201a and the target service contract 202a are the same, and are generated based on the same source code, and the difference between the first contract pre-service 201a and the target service contract 202a may include that the target service contract 202a is used for calling a target service node in the blockchain network 10, and the first contract pre-service 201a is used for calling the target device 20a, and the association between the first contract pre-service 201a and the target service contract 202a is described in the embodiment corresponding to fig. 5 below, which is not described herein. For a description of the blockchain network 10 in fig. 2, please refer to the description of the blockchain network 10 in fig. 1 a.
The first contract pre-servlet 201a encapsulates the blockchain configuration information of the blockchain network 10, which may specifically include an understanding of the blockchain ledger structure and status data of the blockchain network 10a, so the target device 20a may implement data interaction with the blockchain network 201a through the first contract pre-servlet 201a without adapting to the blockchain network 10.
Based on the business process request 20b, the target device 20a may invoke the first contract pre-servlet 201a, as shown in fig. 2, where the first contract pre-servlet 201a includes node direction information 20c, the node direction information 20c being information indicating a target business node, the target business node being a blockchain node in the blockchain network 10 for processing business transactions. The content of the node indication information 20c is not limited in this embodiment, and may be node information such as a node name and a node identifier of a blockchain node in the blockchain network 10. Fig. 2 illustrates node indication information, including a first node name and a second node name, as indicated by node indication information 20c, with node names for understanding.
Since the first contract pre-servlet 201a encapsulates the blockchain configuration information of the blockchain network 10, in the first contract pre-servlet 201a, the target device 20a may generate a business transaction matching the blockchain data structure based on the business data (e.g., object "201b" to object 203b as illustrated in fig. 2). Further, through the first contract pre-service 201b, the target device 20a sends the service transaction to the target service node indicated by the node guiding information 20c, as shown in fig. 2, where the target service node includes a service node 201c corresponding to the first node name, and a service node 202c corresponding to the second node name, where both the service node 201c and the service node 202c belong to the blockchain network 10.
It will be appreciated that fig. 2 is an example with the total number of target service nodes being 2, and in a practical application scenario, the total number of target service nodes is a positive integer. The target service node (such as service node 201c and service node 202c illustrated in fig. 2) may invoke a target service contract 202c deployed in the blockchain network 10 in association with the first contract pre-service 201a based on the service transaction, which target service contract 202c may be a transfer service contract in fig. 2. Through the target service contract 202a, the target service node may perform service processing on the service transaction, where the service processing includes, but is not limited to, checking, broadcasting, consensus (when having a consensus right), block out, and the like, and further, the target service node may generate a service processing result of the service transaction, and then return the service processing result to the target device 20a.
As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating a block chain-based data processing method according to an embodiment of the present application. As shown in fig. 3, the data processing method may include at least the following steps S101 to S103.
Step S101, a target device acquires a service processing request carrying service data, and calls a first contract front-end service program based on the service processing request; the first contract pre-service includes node direction information.
Specifically, comparing the service type corresponding to the service data with the service type corresponding to the first contract front-end service program; if the service type corresponding to the first contract front-end service program is different from the service type corresponding to the service data, generating program deployment prompt information; the program deployment prompt information is used for prompting the target equipment to deploy a second contract front-end service program; the service type corresponding to the second contract front-end service program is the same as the service type corresponding to the service data; and if the service type corresponding to the first contract front-end service program is the same as the service type corresponding to the service data, calling the first contract front-end service program.
Referring to fig. 4, fig. 4 is a schematic diagram of a second scenario of a blockchain-based data processing according to an embodiment of the present application. The meaning of the target device 20a in fig. 4 is the same as that of the target device 20a in fig. 2, and the meaning of other same reference numerals in fig. 2 and 4 are the same, so that the description thereof will not be repeated here. As shown in fig. 4, when a service processing request carrying service data is acquired, the target device 20a determines a service type corresponding to the service data, and if the service data is asset transfer data, the service type is an asset transfer service type; if the service data is billing service data, the service type is billing service type. The embodiment of the application does not limit the specific content of the service data, and can be set according to the actual application scene. It will be appreciated that in the specific embodiments of the present application, related data such as user information (e.g., object information, business data) and the like, when the embodiments of the present application are applied to specific products or technologies, user permissions or consents need to be obtained, and the collection, use and processing of related data need to comply with the relevant laws and regulations and standards of the relevant country and region.
The target device 20a determines a deployed first contract pre-service 201a, and the present embodiment proposes a method for converting a business contract in a blockchain network into a service independent of the blockchain network, i.e., a contract pre-service (including a first contract pre-service and a second contract pre-service). The embodiment of the present application does not limit the total number of the first contract pre-servers 201a deployed by the target device 20a, and if the total number is plural, it indicates that the target device 20a can transmit the business transactions of a plurality of different business types to the blockchain network. Further, the target device 20a determines a service type corresponding to the first contract pre-service 201a, where the service type corresponding to the first contract pre-service 201a refers to a service type of service data processed by the first contract pre-service 201a. Fig. 4 shows the service type corresponding to the service data in the service type to be verified, and shows the service type corresponding to the first contract front-end service 201a in the contract service type.
The target device 20a compares the service type to be verified and the contract service type to obtain a comparison result 30a, and if the comparison result 30a is that the service type to be verified is different from the contract service type, program deployment prompt information can be generated, and the program deployment prompt information is used for prompting the target device 20a to deploy a second contract front-end service program; the service type corresponding to the second contract pre-service program is the same as the service type corresponding to the service data, as shown in fig. 4, the target device 20a may display a program deployment prompt message, such as "please deploy the second contract pre-service program". If the comparison result 30a is that the service type to be verified is the same as the contract service type, the target device 20a invokes the first contract pre-service 201a.
Step S102, in the first contract pre-service program, generating a business transaction matched with the blockchain data structure based on the business data.
Specifically, the first contract pre-service program encapsulates blockchain configuration information of a blockchain network; the blockchain configuration information is used for indicating a blockchain data structure of the blockchain network; in a first contract front-end service program, acquiring a transaction format in blockchain configuration information; based on the transaction format, the business data is packaged into business transactions that match the blockchain data structure.
The generation and deployment of the first contract pre-service program is described in the embodiment corresponding to fig. 5 below, and is not described herein. The first contract pre-service encapsulates blockchain configuration information of a blockchain network, which can indicate a blockchain data structure in the blockchain network, and can specifically include transaction formats in the blockchain network. The first contract pre-service may package the business data into business transactions that match the blockchain data structure based on the transaction format when the target device transmits the business data to the first contract pre-service.
Step S103, the business transaction is sent to a target business node indicated by the node guiding information through a first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to target equipment; the target service node belongs to a blockchain network.
Specifically, the first contract pre-service includes a device private key for the target device; the transaction hash value of the business transaction is obtained through a first contract front-end service program, and the transaction hash value is encrypted based on a device private key to obtain a transaction signature corresponding to the business transaction; and sending the business transaction carrying the transaction signature to the target business node indicated by the node guiding information through the first contract front-end service program.
Referring also to fig. 4, the first contract pre-service 201a holds a device private key 30b for the target device 20a, and node guiding information. In order to verify the identity of the target device 20a, the target device 20a may call and run the first contract pre-service 201a, where the first contract pre-service 201a may generate a service digest, i.e. a transaction hash value, of the service transaction, and further, based on the device private key 30b, the first contract pre-service 201a may encrypt the transaction hash value to obtain a transaction signature 30c corresponding to the service transaction. The target device 20a sends the business transaction carrying the transaction signature 30c to the target business node 30d indicated by the node direction information using the first contract pre-servlet 201a as a transmission medium.
Wherein the first contract pre-service program further comprises a node public key for the target service node; the target equipment acquires a service query request sent by a target object; the service inquiry request carries object information of a target object; in the first contract front-end service program, encrypting object information based on a node public key to obtain encrypted object information; sending a service query request carrying encrypted object information to a target service node through a first contract front-end service program, so that the target service node generates object query data for the object information according to the service query request when the encrypted object information is successfully decrypted based on a node private key corresponding to the target service node; and receiving object query data returned by the target service node and returning to the target object.
It will be appreciated that the target device may write traffic data to the blockchain network as well as read traffic data from the blockchain network. When reading data, the target device may acquire a service query request sent by the target object, where the service query request carries object information of the target object. Similarly, the target device needs to verify whether the service type corresponding to the service query request is the same as the service type corresponding to the first contract front-end service program, and under the condition that the two service types are the same, the target device can call and operate the first contract front-end service program. The first contract front-end service program not only comprises an asymmetric key pair aiming at the target equipment, but also can comprise a node public key of the target service node indicated by the node guiding information, so that when the first contract front-end service program runs, the first contract front-end service program can encrypt the object information based on the node public key to obtain encrypted object information so as to ensure that the object information cannot be acquired by illegal equipment.
And the target equipment sends the service inquiry request carrying the encrypted object information to the target service node through the first contract front-end service program. When the encrypted object information is acquired, the target service node decrypts the encrypted object information based on the node private key, and when decryption is successful, the target service node generates object query data aiming at the object information according to the service query request, the object query data is returned to the target device, and at the moment, the target device returns the acquired object query data to the target object.
The embodiment of the application provides a method for converting a business contract in a blockchain network into a contract front-end service program independent of the blockchain network, so that a target device can be deployed, and after the contract front-end service program is deployed, the target device can call the deployed contract front-end service program in a mode of calling an API (application program interface). The contract front-end service program provided by the embodiment of the application can provide the following functions:
a. based on the public key identity (e.g., the node public key described above), the service query request is wrapped to query the target service node for service data, so the service data may not be stored locally.
b. Based on the private key identity (e.g., the device private key described above), a transaction processing request, such as a transaction uplink request, is packaged, and after signing the transaction, the transaction signature is forwarded to the target service node.
c. And providing all service interfaces of the service contracts deployed in the blockchain network, calling or inquiring the target equipment, wherein the target equipment does not need to adapt to the account book structure and the blockchain transaction interface of the blockchain network, and the service program of the target equipment does not need to carry out signature operation, but rather the contract front-end service program carries out signature, encryption and other operations. The developer does not need to develop the data structure of the docking blockchain, and can directly develop the business interface.
d. The interface and data which can be called and checked by the target device are limited by the contract front-end service program, so that on one hand, the security and privacy of other data on the blockchain can be ensured, and on the other hand, the interference of irrelevant data and irrelevant interfaces to service participants can be reduced. The contract front-end service program realizes the security access guarantee of the target service node connection and provides a data and communication security mechanism for the developer.
e. The contract event subscription function of the business interface is provided, namely, a visitor only needs to know the height growth of the blockchain and other event information through the subscription function or whether the current contract A has new events/data which are concerned by the visitor on the chain.
In this embodiment of the present application, when a target device obtains a service processing request carrying service data, based on the service processing request, a first contract front-end service program including node guiding information may be invoked, where it may be understood that a service type handled by the first contract front-end service program is the same as a service type of the service data; further, in the first contract front-end service, generating a business transaction matching the blockchain data structure based on the business data, i.e., the first contract front-end service may generate a business transaction matching the blockchain data structure, so that the target device may skip adaptation with the blockchain network through the first contract front-end service; further, through the first contract front-end service program, the target device may send the service transaction to the target service node indicated by the node guiding information, so that the target service node may call a target service contract disposed in the blockchain network and associated with the first contract front-end service program according to the service transaction, and through the target service contract, the target service node may perform service processing on the service transaction and return a service processing result to the target device. As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Referring to fig. 5, fig. 5 is a second flowchart of a data processing method based on a blockchain according to an embodiment of the present application. The method can be executed by a target service node in the blockchain network, can be executed by target equipment, and can be executed interactively by the target service node and the target equipment. For ease of understanding, embodiments of the present application will be described with this method being performed by a target device as an example. As shown in fig. 5, the method may include at least the following steps.
Step S201, acquiring a program deployment request aiming at a target service type, and acquiring an initial contract front service program with the target service type based on the program deployment request; the initial contract front-end service program provides a service interface corresponding to the target service type; the initial contract pre-service packages blockchain configuration information indicating a blockchain data structure of the blockchain network.
Specifically, embodiments of the present application may provide a target device with a contract pre-service (including a first contract pre-service) associated with a target business contract deployed in a blockchain network, so the target device may deploy the contract pre-service. The program deployment request is used for requesting the target equipment to deploy and acquire and configure the initial contract front-end service program. When a program deployment request for a target service type is acquired, the target device may acquire an initial contract front-end service program corresponding to the target service type based on the program deployment request.
Step S202, configuring an initial pre-service program, and determining the configured initial pre-service program as a first pre-service program.
Specifically, in the initial contract pre-service program, an asymmetric key pair for the target device and a device communication certificate for the asymmetric key pair are generated; the asymmetric key pair includes a device private key and a device public key; determining a service node for processing a target service type in the block chain network as a target service node, and generating node guiding information according to node information of the target service node; an initial contract pre-service program including an asymmetric key pair, a device communication certificate, and node bootstrapping information is determined as a first contract pre-service program.
The device communication certificate includes a certification certificate required when the target device communicates, and a secure transport layer protocol (Transport Layer Security, abbreviated TLS) certificate. It will be appreciated that the initial contract pre-service is similar to an installation package, so the target device needs to be configured to adapt to the target device when deploying the initial contract pre-service. In the configuration process, the initial pre-service program generates an asymmetric key pair for the target device, such as the device private key and the device public key corresponding to the target device, and generates the device communication certificate corresponding to the asymmetric key pair. The first contract front-end service program is a transmission medium of the target equipment and the blockchain network, so that in the configuration process, the initial contract front-end service program generates node guiding information for indicating the target service node according to the node information of the target service node. When the configuration is completed, the target device obtains the first contract front-end service program.
The contract-level pre-service (e.g., the first contract pre-service program of the present application) provides only the interfaces of a certain business contract, such as an invoice business contract, for which an invoice business participant pays attention, so that the participant can deploy one invoice business contract pre-service that provides only all the business interfaces of the invoice business contract.
The method comprises the steps that target equipment generates a business contract to be compiled for a target business type; the business contracts to be compiled comprise block chain configuration information; the blockchain configuration information is used for indicating a blockchain data structure in the blockchain network; reading contract content of a business contract to be compiled through a front-end service code generator, and generating a front-end service code according to the contract content; compiling the pre-service code into an initial contract pre-service program, and if the target business contract generated based on the business contract to be compiled is successfully uplink, deploying the initial contract pre-service program to obtain a first contract pre-service program.
It will be appreciated that the target device may have the authority to generate the contract pre-service, so that the initial contract pre-service may be generated and deployed. Referring to fig. 6, fig. 6 is a flowchart of a method for deploying initial contract front-end service programs based on blockchain according to an embodiment of the present application. As shown in fig. 6, the method may include the steps of: step S401, the target device generates a business contract to be compiled, namely writing of the business contract corresponding to the target business type is completed; step S402, a target business contract is generated. And the target equipment compiles the business contracts to be compiled corresponding to the target business types into target business contracts in a conventional way, and is used for deploying the uplink subsequently. Step S403, generating a pre-service code. The method for reading the business contracts to be compiled by the target device through the front-end service code generator is converted into API services in a general API server (server), for example, an invoice (Issueinvalice) method in the original business contracts is converted into/invoices/Issueinvalice in the API server. Step S404, compiling the front-end service code. And the target equipment compiles the generated pre-service code into an initial transaction pre-service program corresponding to the target business contract. Step S405, an initial contract pre-service program is generated. Step S406, the initial contract front-end service program is deployed by the uplink target business contract. And the target equipment performs uplink processing on the target service contract, and provides an initial contract front-end service program corresponding to the target service contract for the service participant when the uplink is successful, wherein the service participant can deploy the initial contract front-end service program.
According to the embodiment of the application, the target business contract is converted into the contract-level front-end service through the composite compiling of the business contract code, interaction of the blockchain business participants on the blockchain related structure can be packaged, the business participants can access the business service, business interaction based on the blockchain and the intelligent contract is performed, the threshold of blockchain business access can be reduced through the contract front-end service program, and a high-automation convenient docking scheme is provided.
Step S203, the target device obtains a service processing request carrying service data, and calls a first contract front-end service program based on the service processing request; the first contract pre-service includes node direction information.
In step S204, in the first contract pre-service program, a business transaction matching the blockchain data structure is generated based on the business data.
Step S205, the business transaction is sent to a target business node indicated by the node guiding information through a first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to target equipment; the target service node belongs to a blockchain network.
In the specific implementation process of step S203 to step S205, please refer to step S101 to step S103 in the embodiment corresponding to fig. 3, which is not described herein.
In this embodiment of the present application, when a target device obtains a service processing request carrying service data, based on the service processing request, a first contract front-end service program including node guiding information may be invoked, where it may be understood that a service type handled by the first contract front-end service program is the same as a service type of the service data; further, in the first contract front-end service, generating a business transaction matching the blockchain data structure based on the business data, i.e., the first contract front-end service may generate a business transaction matching the blockchain data structure, so that the target device may skip adaptation with the blockchain network through the first contract front-end service; further, through the first contract front-end service program, the target device may send the service transaction to the target service node indicated by the node guiding information, so that the target service node may call a target service contract disposed in the blockchain network and associated with the first contract front-end service program according to the service transaction, and through the target service contract, the target service node may perform service processing on the service transaction and return a service processing result to the target device. As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Referring to fig. 7, fig. 7 is a flowchart illustrating a data processing method based on a blockchain according to an embodiment of the present application. The method can be executed by a target service node in the blockchain network, can be executed by target equipment, and can be executed interactively by the target service node and the target equipment. For ease of understanding, embodiments of the present application will be described in terms of this method being performed by a target service node. As shown in fig. 7, the method may include at least the following steps.
Step S301, obtaining a business transaction sent by a target device through a first contract front-end service program; the business transaction is generated by the target equipment in the first contract front-end service program based on the business data, and the business transaction is matched with the blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying service data is acquired; the first contract front-end service includes node guiding information; the node direction information is used to direct the first contract pre-service to send the business transaction to the target business node.
Specifically, in the embodiment of the present application, the target device performs data interaction with the target service node through the first contract pre-service program.
Step S302, according to the business transaction, invoking a target business contract deployed in the blockchain network in association with the first contract pre-server.
Specifically, the service type to be verified of the service transaction is obtained, and the service type to be verified is compared with the node service type; the node service type is used for indicating the service type of the service processed by the target service node; if the service type to be verified is different from the node service type, returning service error prompt information to the target equipment; if the service type to be verified is the same as the node service type, calling a target service contract deployed in the blockchain network according to the contract name of the first contract front-end service program; the contract name of the first contract pre-service program is the same as the contract name of the target business contract.
Step S303, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to the target equipment.
Specifically, for ease of understanding, the embodiments of the present application will be described with reference to fig. 8, where fig. 8 is a system architecture diagram under the tax block chain system provided in the embodiments of the present application. As shown in fig. 8, the service network, the routing agent network, and the core consensus network in the embodiment of the present application form the whole complete blockchain service architecture. The core consensus network may comprise one core chain (e.g. the core chain in the consensus network shown in fig. 1b above). Optionally, the core consensus network may also include multiple core chains as shown in fig. 8. Each core chain may be used to store traffic data corresponding to a different traffic type. The business transaction comprises a plurality of sub-businesses associated with tax business, and can particularly comprise billing business, credit investigation business, business transaction, enterprise qualification business, tax refund business and the like. For example, the core chain 0 may be used to store the service data corresponding to the billing service, the core chain 1 may be used to store the service data corresponding to the credit investigation service, and so on.
It will be appreciated that when the blockchain is used in some scenarios for an enterprise, in order to improve confidentiality and security of data, when enterprise information or service security and other data are involved in the blockchain hierarchy, the hierarchical blockchain structure of "service network-core consensus network" in the embodiments of the present application may be employed.
Since the whole tax service will involve regulatory authorities, invoicing parties, reimbursement parties, tax reimbursement parties, etc. Therefore, the service nodes in the service network shown in fig. 8 may include terminal devices corresponding to the tax office object, terminal devices corresponding to the enterprise object, and terminal devices corresponding to the consumption object. The tax office object may refer to a supervision organization (e.g., a computer device corresponding to a tax office in a province, a city, a district, etc.) in a supervision private network, the enterprise object may be an billing service provider, a reimbursement service provider, or a retail enterprise (e.g., a KA enterprise, i.e., a large retail customer and a key retail customer enterprise) in a public cloud, and the consumption object may be a payment service provider, a circulation service provider, or a retail enterprise in a private cloud. The service node in the service network generates a service query request for querying service result data, and further forwards the service query request to a common node in the core common network through a proxy node in the routing proxy network, so that the common node obtains the service result data for returning to the service node based on node caching.
The proxy node in the routing proxy network may be used to perform network isolation on the service network and the core consensus network, and the proxy node may have a point-to-point service (i.e., P2P service), a routing service, a certificate cache, and an authentication service. It is understood that point-to-point services refer to services in a P2P network, based on a specific network protocol, there is no need for a central node between network nodes in the P2P network to maintain a network state, and each node maintains a node state of the whole network or a connection state of its neighboring nodes through broadcast interaction with neighboring nodes. Routing services are the basic function of nodes and can be used for communication between nodes to isolate the traffic network from the core consensus network. The certificate cache is used for caching identity certificates of each node, wherein the certificates can refer to a public key certificate hierarchy (Public Key Infrastructure, PKI), in which certificates are the identity of a public key owner and are issued by an authority (CA), and asymmetric encryption and digital signature on information can be realized based on the public key certificate hierarchy. The public key certificate hierarchy here may include public-private key cryptography, x509 certificates, CA certificate issuing centers, and so forth. The authentication service may be used for authentication of a service node in a service network, etc. It may be appreciated that, in the embodiment of the present application, the proxy node may be configured to forward the service query request sent by the service node to the consensus node in the core consensus network, and may also be configured to forward the service result data returned by the consensus node to the service node.
Wherein, the consensus node (i.e. accounting node) in the core consensus network can be a trusted node in the tax private network, and can determine own consensus responsibility by calling the authority contract. The rights contract here also stores circulation logic about the whole life cycle of the electronic bill, such as bill state of the electronic bill, circulation flow, access rights of data, electronic bill claim condition, electronic bill issue condition, and the like. For example, a consensus node in the core consensus network may write a lease management contract sent by the system management device to a core chain in the core consensus network when it obtains the lease management contract. The consensus node may also write the service configuration information associated with the ticket service contract sent by the service contract management device into the core chain when it is acquired. The consensus node can also update the business state data corresponding to each inquiry interface stored in the node cache according to the cache time length of the lease level corresponding to the inquiry interface based on the state data release service, so that the cache inquiry service can be invoked when the business inquiry request forwarded by the proxy node is acquired later, and business result data corresponding to the business auxiliary information is determined based on the request type of the business inquiry request, the business inquiry interface and the node cache.
As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Further, referring to fig. 9, fig. 9 is a schematic structural diagram of a blockchain-based data processing device according to an embodiment of the present application. The blockchain-based data processing apparatus 1 may be run on a target device and may be used to perform the corresponding steps in the methods provided by embodiments of the present application. As shown in fig. 9, the blockchain-based data processing device 1 may include: the request acquisition module 11, the first generation module 120 and the first transmission module 13.
A request acquisition module 11, configured to acquire a service processing request carrying service data, and call a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
a first generation module 12, configured to generate, in a first contract pre-service program, a business transaction matching the blockchain data structure based on the business data;
a first sending module 13, configured to send, through a first contract front-end service program, a service transaction to a target service node indicated by the node guiding information, so that the target service node invokes, according to the service transaction, a target service contract associated with the first contract front-end service program and deployed in the blockchain network, performs service processing on the service transaction through the target service contract, and returns a service processing result to the target device; the target service node belongs to a blockchain network.
The specific functional implementation manners of the request obtaining module 11, the first generating module 12, and the first sending module 13 may refer to step S101 to step S103 in the corresponding embodiment of fig. 3, which are not described herein.
Referring again to fig. 9, the request acquisition module 11 may include: a type comparison unit 111, a first generation unit 112, and a program calling unit 113.
A type comparing unit 111, configured to compare a service type corresponding to the service data with a service type corresponding to the first contract front-end service program;
a first generating unit 112, configured to generate a program deployment prompt message if a service type corresponding to the first contract front-end service program is different from a service type corresponding to the service data; the program deployment prompt information is used for prompting the target equipment to deploy a second contract front-end service program; the service type corresponding to the second contract front-end service program is the same as the service type corresponding to the service data;
and the program calling unit 113 is configured to call the first contract pre-service program if the service type corresponding to the first contract pre-service program is the same as the service type corresponding to the service data.
The specific function implementation manner of the type comparison unit 111, the first generation unit 112, and the program calling unit 113 may refer to step S101 in the corresponding embodiment of fig. 3, and will not be described herein.
Referring to fig. 9, the first contract pre-service encapsulates blockchain configuration information of the blockchain network; the blockchain configuration information is used for indicating a blockchain data structure of the blockchain network;
The first generation module 12 may include: the first acquisition unit 121 and the data encapsulation unit 122.
A first obtaining unit 121, configured to obtain a transaction format in the blockchain configuration information in a first contract pre-service program;
the data encapsulation unit 122 is configured to encapsulate the service data into a service transaction matched with the blockchain data structure based on the transaction format.
The specific functional implementation manner of the first obtaining unit 121 and the data packaging unit 122 may refer to step S102 in the corresponding embodiment of fig. 3, which is not described herein.
Referring again to fig. 9, the first contract pre-service includes a device private key for the target device;
the first transmitting module 13 may include: the second acquisition unit 131 and the transaction transmission unit 132.
A second obtaining unit 131, configured to obtain, through a first contract pre-service program, a transaction hash value of a service transaction, encrypt the transaction hash value based on a device private key, and obtain a transaction signature corresponding to the service transaction;
the transaction transmitting unit 132 is configured to transmit, through the first contract pre-service program, a service transaction carrying a transaction signature to a target service node indicated by the node guiding information.
The specific functional implementation manner of the second obtaining unit 131 and the transaction sending unit 132 may refer to step S103 in the corresponding embodiment of fig. 3, which is not described herein.
Referring again to fig. 9, the first contract pre-service program further includes a node public key for the target service node;
the blockchain-based data processing device 1 may further include: an information encryption module 14 and a second transmission module 15.
The request acquisition module 11 is further configured to acquire a service query request sent by the target object; the service inquiry request carries object information of a target object;
an information encryption module 14, configured to encrypt object information based on a node public key in a first contract pre-service program to obtain encrypted object information;
the second sending module 15 is configured to send, through the first contract pre-service program, a service query request carrying encrypted object information to a target service node, so that when the target service node successfully decrypts the encrypted object information based on a node private key corresponding to the target service node, object query data for the object information is generated according to the service query request;
the second sending module 15 is further configured to receive the object query data returned by the target service node, and return the object query data to the target object.
The specific function implementation manner of the request obtaining module 11, the information encrypting module 14 and the second sending module 15 may refer to step S103 in the corresponding embodiment of fig. 3, and will not be described herein.
Referring again to fig. 9, the blockchain-based data processing device 1 may further include: program configuration module 16.
The request acquisition module 11 is further configured to acquire a program deployment request for a target service type, and acquire an initial contract front service program with the target service type based on the program deployment request; the initial contract front-end service program provides a service interface corresponding to the target service type; the initial contract pre-service program encapsulates blockchain configuration information for indicating a blockchain data structure of the blockchain network;
the program configuration module 16 is configured to configure the initial pre-service program, and determine the configured initial pre-contract service program as the first pre-contract service program.
The specific functional implementation manner of the request obtaining module 11 and the program configuring module 16 may refer to steps S201 to S202 in the corresponding embodiment of fig. 5, which are not described herein.
Referring again to fig. 9, the program configuration module 16 may include: a second generation unit 161, a first determination unit 162, and a second determination unit 163.
A second generation unit 161 for generating, in the initial contract pre-service program, an asymmetric key pair for the target device and a device communication certificate for the asymmetric key pair; the asymmetric key pair includes a device private key and a device public key;
a first determining unit 162, configured to determine a service node for processing a target service type in the blockchain network as a target service node, and generate node guiding information according to node information of the target service node;
the second determining unit 163 is configured to determine an initial contract pre-service program including the asymmetric key pair, the device communication certificate, and the node boot information as a first contract pre-service program.
The specific functional implementation manner of the second generating unit 161, the first determining unit 162, and the second determining unit 163 may refer to step S202 in the corresponding embodiment of fig. 5, and will not be described herein.
Referring again to fig. 9, the blockchain-based data processing device 1 may further include: a second generation module 17, a third generation module 18, and a program deployment module 19.
A second generation module 17, configured to generate a service contract to be compiled for the target service type; the business contracts to be compiled comprise block chain configuration information; the blockchain configuration information is used for indicating a blockchain data structure in the blockchain network;
A third generating module 18, configured to read, through a pre-service code generator, contract contents of a service contract to be compiled, and generate a pre-service code according to the contract contents;
the program deployment module 19 is configured to compile the pre-service code into an initial contract pre-service program, and if the target service contract generated based on the service contract to be compiled is successfully uplink, deploy the initial contract pre-service program to obtain a first contract pre-service program.
The specific functional implementation manner of the second generating module 17, the third generating module 18 and the program deployment module 19 may refer to step S401 to step S406 in the corresponding embodiment of fig. 6, which are not described herein.
In this embodiment of the present application, when a target device obtains a service processing request carrying service data, based on the service processing request, a first contract front-end service program including node guiding information may be invoked, where it may be understood that a service type handled by the first contract front-end service program is the same as a service type of the service data; further, in the first contract front-end service, generating a business transaction matching the blockchain data structure based on the business data, i.e., the first contract front-end service may generate a business transaction matching the blockchain data structure, so that the target device may skip adaptation with the blockchain network through the first contract front-end service; further, through the first contract front-end service program, the target device may send the service transaction to the target service node indicated by the node guiding information, so that the target service node may call a target service contract disposed in the blockchain network and associated with the first contract front-end service program according to the service transaction, and through the target service contract, the target service node may perform service processing on the service transaction and return a service processing result to the target device. As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Further, referring to fig. 10, fig. 10 is a schematic diagram of a block chain-based data processing apparatus according to an embodiment of the present application. The blockchain-based data processing device 2 described above may be operated at a target service node in a blockchain network and may be used to perform the corresponding steps in the methods provided by embodiments of the present application. As shown in fig. 10, the blockchain-based data processing device 2 may include: a transaction acquisition module 21, a contract invocation module 22 and a result return module 23.
A transaction acquisition module 21, configured to acquire a business transaction sent by the target device through the first contract front-end service program; the business transaction is generated by the target equipment in the first contract front-end service program based on the business data, and the business transaction is matched with the blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying service data is acquired; the first contract front-end service includes node guiding information; the node guiding information is used for guiding the first contract front-end service program to send the business transaction to the target business node;
a contract invoking module 22 for invoking a target business contract deployed in the blockchain network in association with the first contract pre-server according to the business transaction;
The result returning module 23 is configured to perform service processing on the service transaction through the target service contract, and return the service processing result to the target device.
The specific function implementation manners of the transaction obtaining module 21, the contract invoking module 22 and the result returning module 23 may refer to step S301 to step S303 in the corresponding embodiment of fig. 7, and are not described herein.
Referring again to fig. 10, the contract invoking module 22 may include: a type comparison unit 221, an error return unit 222, and a contract calling unit 223.
A type comparing unit 221, configured to obtain a service type to be verified of the service transaction, and compare the service type to be verified with the node service type; the node service type is used for indicating the service type of the service processed by the target service node;
an error return unit 222, configured to return a service error prompt message to the target device if the service type to be verified is different from the node service type;
a contract calling unit 223, configured to call a target service contract deployed in the blockchain network according to a contract name of the first contract pre-service program if the service type to be verified is the same as the node service type; the contract name of the first contract pre-service program is the same as the contract name of the target business contract.
The specific function implementation manners of the type comparison unit 221, the error return unit 222, and the contract invoking unit 223 may refer to step S302 in the corresponding embodiment of fig. 7, and will not be described herein.
As can be seen from the foregoing, the embodiments of the present application provide a first contract front-end service program associated with a target service contract deployed in a blockchain network, through which a target device may generate a service transaction matched with a blockchain data structure without adapting to the blockchain network, so that the difficulty of accessing a blockchain service may be reduced; in addition, the service transaction is sent to the target service node associated with the service type of the service transaction through the first contract front-end service program, so that the target device can be prevented from accessing the on-chain data irrelevant to the service transaction, and the data security of the blockchain network can be improved.
Further, referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 11, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. In some embodiments, the user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others. The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the aforementioned processor 1001. As shown in fig. 11, the memory 1005, which is one type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
In the computer device 1000 shown in FIG. 11, the network interface 1004 may provide network communication functions; while user interface 1003 is primarily used as an interface for providing input to a user; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
acquiring a service processing request carrying service data, and calling a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
generating, in a first contract pre-service program, a business transaction that matches a blockchain data structure based on the business data;
the business transaction is sent to a target business node indicated by the node guiding information through a first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to target equipment; the target service node belongs to a blockchain network.
It should be understood that the computer device 1000 described in the embodiments of the present application may perform the description of the data processing method or apparatus in the foregoing embodiments, which is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
The embodiments of the present application further provide a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the description of the data processing method or apparatus in the foregoing embodiments, and is not repeated herein. In addition, the description of the beneficial effects of the same method is omitted.
The computer readable storage medium may be the data processing apparatus provided in any one of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a 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 Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer 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.
Embodiments of the present application also provide a computer program product comprising a computer program stored in a computer readable storage medium. The processor of the computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program, so that the computer device may perform the description of the data processing method or apparatus in the foregoing embodiments, which is not described herein. In addition, the description of the beneficial effects of the same method is omitted.
The terms first, second and the like in the description and in the claims and drawings of the embodiments of the present application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The foregoing disclosure is only illustrative of the preferred embodiments of the present application and is not intended to limit the scope of the claims herein, as the equivalent of the claims herein shall be construed to fall within the scope of the claims herein.

Claims (15)

1. A blockchain-based data processing method, comprising:
the target equipment acquires a service processing request carrying service data and calls a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
Generating, in the first contract pre-service program, a business transaction that matches a blockchain data structure based on the business data;
sending the business transaction to a target business node indicated by the node guiding information through the first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, and carrying out business processing on the business transaction through the target business contract to return a business processing result to the target equipment; the target service node belongs to the blockchain network.
2. The method of claim 1, wherein invoking the first contract pre-service based on the business process request comprises:
comparing the service type corresponding to the service data with the service type corresponding to the first contract front-end service program;
if the service type corresponding to the first contract front-end service program is different from the service type corresponding to the service data, generating program deployment prompt information; the program deployment prompt message is used for prompting the target equipment to deploy a second contract front-end service program; the service type corresponding to the second contract front-end service program is the same as the service type corresponding to the service data;
And if the service type corresponding to the first contract front-end service program is the same as the service type corresponding to the service data, calling the first contract front-end service program.
3. The method of claim 1, wherein the first contract pre-service encapsulates blockchain configuration information for the blockchain network; the blockchain configuration information is used for indicating a blockchain data structure of the blockchain network;
the generating, in the first contract pre-service program, a business transaction matching a blockchain data structure based on the business data includes:
in the first contract front-end service program, acquiring a transaction format in the blockchain configuration information;
and based on the transaction format, packaging the business data into business transactions matched with a blockchain data structure.
4. The method of claim 1, wherein the first contract pre-service includes a device private key for the target device;
the sending, by the first contract pre-service program, the business transaction to a target business node indicated by the node guiding information, including:
The transaction hash value of the business transaction is obtained through the first contract front-end service program, and the transaction hash value is encrypted based on the equipment private key to obtain a transaction signature corresponding to the business transaction;
and sending the business transaction carrying the transaction signature to a target business node indicated by the node guiding information through the first contract front-end service program.
5. The method of claim 1, wherein the first contract pre-service further comprises a node public key for the target service node;
the method further comprises the steps of:
acquiring a service query request sent by a target object; the service query request carries object information of the target object;
encrypting the object information based on the node public key in the first contract front-end service program to obtain encrypted object information;
sending a service query request carrying the encrypted object information to the target service node through the first contract front-end service program, so that the target service node generates object query data for the object information according to the service query request when the encrypted object information is successfully decrypted based on a node private key corresponding to the target service node;
And receiving the object query data returned by the target service node and returning to the target object.
6. The method according to claim 1, wherein the method further comprises:
acquiring a program deployment request aiming at a target service type, and acquiring an initial contract front-end service program with the target service type based on the program deployment request; the initial contract front-end service program provides a service interface corresponding to the target service type; the initial contract pre-service program encapsulates blockchain configuration information indicating a blockchain data structure of the blockchain network;
and configuring the initial pre-service program, and determining the configured initial pre-service program as the first pre-service program.
7. The method of claim 6, wherein configuring the initial pre-service and determining the configured initial pre-contract service as the first pre-contract service comprises:
generating, in the initial contract pre-service, an asymmetric key pair for the target device and a device communication certificate for the asymmetric key pair; the asymmetric key pair comprises a device private key and a device public key;
Determining a service node for processing the target service type in the blockchain network as the target service node, and generating the node guiding information according to the node information of the target service node;
and determining an initial contract pre-service program comprising the asymmetric key pair, the device communication certificate and the node guiding information as the first contract pre-service program.
8. The method according to claim 1, wherein the method further comprises:
generating a business contract to be compiled for the target business type; the business contract to be compiled comprises the blockchain configuration information; the blockchain configuration information is used for indicating a blockchain data structure in the blockchain network;
reading contract content of the business contract to be compiled through a front-end service code generator, and generating a front-end service code according to the contract content;
compiling the pre-service code into an initial contract pre-service program, and if the target business contract generated based on the business contract to be compiled is successfully uplink, deploying the initial contract pre-service program to obtain the first contract pre-service program.
9. A blockchain-based data processing method, the method performed by a target service node in a blockchain network, the method comprising:
acquiring business transaction sent by target equipment through a first contract front-end service program; the business transaction is generated by the target device in the first contract front-end service program based on business data, and the business transaction is matched with a blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying the service data is acquired; the first contract front-end service includes node guiding information; the node guiding information is used for guiding the first contract front-end service program to send the business transaction to the target business node;
invoking a target business contract deployed in the blockchain network in association with the first contract pre-service according to the business transaction;
and carrying out service processing on the service transaction through the target service contract, and returning a service processing result to the target equipment.
10. The method of claim 9, wherein invoking the target business contract deployed in the blockchain network in association with the first contract pre-service according to the business transaction comprises:
Acquiring a service type to be verified of the service transaction, and comparing the service type to be verified with a node service type; the node service type is used for indicating the service type of the service processed by the target service node;
if the service type to be verified is different from the node service type, returning service error prompt information to the target equipment;
if the service type to be verified is the same as the node service type, calling a target service contract deployed in the blockchain network according to the contract name of the first contract front-end service program; the contract name of the first contract pre-service program is the same as the contract name of the target business contract.
11. A blockchain-based data processing apparatus, the blockchain-based data processing apparatus operating on a target device, comprising:
the request acquisition module is used for acquiring a service processing request carrying service data and calling a first contract front-end service program based on the service processing request; the first contract front-end service includes node guiding information;
a first generation module, configured to generate, in the first contract pre-service program, a business transaction that matches a blockchain data structure based on the business data;
The first sending module is used for sending the business transaction to a target business node indicated by the node guiding information through the first contract front-end service program, so that the target business node calls a target business contract which is associated with the first contract front-end service program and is deployed in a blockchain network according to the business transaction, business processing is carried out on the business transaction through the target business contract, and a business processing result is returned to the target equipment; the target service node belongs to the blockchain network.
12. A blockchain-based data processing device, the blockchain-based data processing device operating at a target service node in a blockchain network, comprising:
the transaction acquisition module is used for acquiring business transaction sent by the target equipment through the first contract front-end service program; the business transaction is generated by the target device in the first contract front-end service program based on business data, and the business transaction is matched with a blockchain data structure; the first contract front-end service program is called by the target equipment when a service processing request carrying the service data is acquired; the first contract front-end service includes node guiding information; the node guiding information is used for guiding the first contract front-end service program to send the business transaction to the target business node;
A contract calling module, configured to call a target service contract deployed in the blockchain network, associated with the first contract pre-server, according to the service transaction;
and the result returning module is used for carrying out service processing on the service transaction through the target service contract and returning a service processing result to the target equipment.
13. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory and the network interface, wherein the network interface is configured to provide a data communication function, the memory is configured to store a computer program, and the processor is configured to invoke the computer program to cause the computer device to perform the method of any of claims 1 to 10.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-10.
15. A computer program product, characterized in that the computer program product comprises a computer program stored in a computer readable storage medium, the computer program being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-10.
CN202210679940.2A 2022-06-16 2022-06-16 Block chain-based data processing method, equipment and readable storage medium Pending CN117294753A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210679940.2A CN117294753A (en) 2022-06-16 2022-06-16 Block chain-based data processing method, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210679940.2A CN117294753A (en) 2022-06-16 2022-06-16 Block chain-based data processing method, equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN117294753A true CN117294753A (en) 2023-12-26

Family

ID=89257633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210679940.2A Pending CN117294753A (en) 2022-06-16 2022-06-16 Block chain-based data processing method, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN117294753A (en)

Similar Documents

Publication Publication Date Title
CN108665372B (en) Information processing, inquiring and storing method and device based on block chain
EP3688930B1 (en) System and method for issuing verifiable claims
CN111970129B (en) Data processing method and device based on block chain and readable storage medium
CN112926982B (en) Transaction data processing method, device, equipment and storage medium
WO2019179534A2 (en) System and method for creating decentralized identifiers
EP3688633A2 (en) System and method for verifying verifiable claims
TW201215070A (en) Key Management Systems and methods for shared secret ciphers
CN113271311B (en) Digital identity management method and system in cross-link network
CN113255014B (en) Data processing method based on block chain and related equipment
CN111934870B (en) Method, apparatus, device and medium for updating root certificate in block chain network
CN114567643B (en) Cross-blockchain data transfer method, device and related equipment
CN113689216A (en) Cross-chain transaction processing method and device, equipment, storage medium and program product
CN115409511B (en) Personal information protection system based on block chain
CN117118640A (en) Data processing method, device, computer equipment and readable storage medium
CN117294753A (en) Block chain-based data processing method, equipment and readable storage medium
CN116781269A (en) Block chain-based data processing method, device, equipment, medium and product
CN114301912A (en) Information interaction method and device based on block chain
Pintaldi Implementation of a Blockchain-based Distributed PKI for IoT using Emercoin NVS and TPM 2.0
CN116566698B (en) Secret-related data exchange method and system based on multistage cross-network isolation
CN116886444B (en) Cross-chain data processing method, device, computer, storage medium and program product
US20230325833A1 (en) Blockchain-based data processing method and apparatus, device, storage medium, and program product
WO2024007855A1 (en) Data processing method and device based on blockchain, and readable storage medium
US20230421540A1 (en) Systems and methods for generating secure, encrypted communications using multi-party computations in order to perform blockchain operations in decentralized applications
CN116781268A (en) Block chain-based data processing method, equipment and readable storage medium
CN116366254A (en) Cross-chain information generation method, cross-chain information verification method and cross-chain information verification system

Legal Events

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