Data processing method based on block chain network and related equipment
By introducing blockchain network and decentralized bill verification mechanism into the bill service system, generating and verifying bill issuance certificates, the problem of insufficient bill reliability in the bill service system is solved, and the transparency and security of bill issuance is achieved.
Patent Information
- Application Number
- CN202410008189.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the existing bill issuing service system, the abnormal behavior of the invoice issuing service provider makes it difficult to guarantee the reliability of the bill service and cannot effectively prevent problems such as fraud and evil.
A decentralized bill service system based on blockchain network is adopted, and a bill execution device is used to generate a bill issuing certificate, and it is verified by the bill verification device and stored on the blockchain network to ensure the authenticity and transparency of the bill issuing certificate.
It improves the reliability and security of bill services, prevents abnormal behaviors of bill execution equipment when issuing bills, and realizes an open and transparent bill verification process.
Smart Images

Figure CN120258922A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and in particular, to a data processing method and related devices based on a blockchain network. Background Art
[0002] Currently, in the bill issuance service system, it is a centralized system. In this system, the invoice issuance service providers usually only provide bill issuance services. Since the invoice issuance service providers exist independently in this system, if the invoice issuance service provider refuses to provide services or even has abnormal behaviors such as fraud or evil deeds in invoice issuance, the object usually can only reconnect to other invoice issuance service providers, and it is impossible to effectively guarantee the reliability of the bill services in the bill issuance service system. Therefore, how to improve the reliability of bill services has become an urgent problem to be solved. Summary of the Invention
[0003] The embodiments of this application provide a data processing method and related devices based on a blockchain network, which can improve the reliability of bill services.
[0004] In a first aspect, the embodiments of this application provide a data processing method based on a blockchain network. The method is applied to a bill service system, and the bill service system includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services. The method includes:
[0005] A target bill execution device obtains a bill request submitted by an object; the target bill execution device is one of the multiple bill execution devices, and the bill request carries bill information required for generating a bill. The target bill execution device responds to the bill request and generates a target bill and a bill issuance certificate for the target bill based on the bill information, and generates a verification request for verifying the bill issuance certificate. The verification request carries the bill issuance certificate;
[0006] The target bill execution device sends the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate; the target bill verification device is at least one of the multiple bill verification devices;
[0007] The target bill execution device receives the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, the bill issuance certificate is stored on the blockchain network.
[0008] Second aspect, an embodiment of the present application provides a data processing method based on a blockchain network. The method is applied to a bill service system, which includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services. The method includes:
[0009] A target bill verification device obtains a verification request sent by a target bill execution device. The target bill verification device is at least one of the multiple bill verification devices, and the target bill execution device is one of the multiple bill execution devices. The verification request carries a bill issuance certificate of a target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object.
[0010] The target bill verification device responds to the verification request and obtains the bill information in the bill request submitted by the object.
[0011] The target bill verification device verifies the bill issuance certificate based on the bill information, generates a verification result, and sends the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0012] Third aspect, an embodiment of the present application provides a data processing device based on a blockchain network. The data processing device is configured in a target bill execution device, and the target bill execution device is deployed in a bill service system. The bill service system includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services. The target bill execution device is one of the multiple bill execution devices. The device includes:
[0013] An obtaining unit, configured to obtain a bill request submitted by an object. The bill request carries the bill information required for generating a bill.
[0014] A processing unit, configured to respond to the bill request, generate a target bill and a bill issuance certificate of the target bill based on the bill information, and generate a verification request for verifying the bill issuance certificate. The verification request carries the bill issuance certificate.
[0015] A sending unit, configured to send the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill with respect to the bill issuance certificate; the target bill verification device is at least one of a plurality of bill verification devices;
[0016] The processing unit is further configured to receive the verification result of the target bill verification device, and if it is determined based on the verification result that the bill issuance certificate passes the bill verification, store the bill issuance certificate on the blockchain network.
[0017] In a fourth aspect, an embodiment of the present application provides a data processing device based on a blockchain network. The data processing device is configured in a target bill verification device, and the target bill verification device is deployed in a bill service system. The bill service system includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes a plurality of bill execution devices for providing bill issuance services, and the bill verification network includes a plurality of bill verification devices for providing bill verification services; the target verification execution device is at least one of a plurality of bill execution devices; the device includes:
[0018] An obtaining unit, configured to obtain a verification request sent by a target bill execution device; the target bill execution device is one of a plurality of bill execution devices; the verification request carries a bill issuance certificate of a target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object;
[0019] The obtaining unit is further configured to respond to the verification request and obtain the bill information in the bill request submitted by the object;
[0020] The processing unit is further configured to perform bill verification on the bill issuance certificate based on the bill information, generate a verification result, and send the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0021] In a fifth aspect, an embodiment of the present application provides a computer device, which includes a processor and a memory. The memory is used to store a computer program, and the computer program includes program instructions. The processor is configured to call the program instructions to execute some or all of the steps in the above method.
[0022] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, they are used to execute some or all of the steps in the above method.
[0023] In a seventh aspect, an embodiment of the present application further provides a computer program product or a computer program. The computer program product or the computer program includes program instructions that, when executed by a processor, can implement some or all of the steps in the above method.
[0024] In an embodiment of the present application, a target bill execution device can obtain a bill request submitted by an object; the bill request can carry bill information required for generating a bill; the target bill execution device can respond to the bill request and generate a target bill and a bill issuance certificate for the target bill based on the bill information, and generate a verification request for verifying the bill issuance certificate, where the verification request carries the bill issuance certificate; then, the target bill execution device can send the verification request to a target bill verification device so that the target bill verification device can respond to the verification request and verify the bill issuance certificate; furthermore, the target bill execution device can receive the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, the target bill execution device can store the bill issuance certificate on the blockchain network. By implementing the above method, when issuing a bill, a bill issuance certificate corresponding to the bill can be generated by using the bill execution device, and the bill issuance certificate can be saved to the blockchain network to ensure public transparency and traceability; in order to upload the bill issuance certificate to the chain, it is necessary to use the bill verification device to verify the bill issuance certificate. Only when it passes the verification can the bill issuance certificate be uploaded to the chain to ensure that the bill execution device cannot perform abnormal behaviors such as malicious actions when issuing a bill, thereby effectively improving the reliability and security of the bill service. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0026] Figure 1a is a schematic diagram of a data sharing system provided by an embodiment of the present application;
[0027] Figure 1b is a schematic structural diagram of a block composition provided by an embodiment of the present application;
[0028] Figure 1c is a flowchart of the generation of a new block provided by an embodiment of the present application;
[0029] Figure 1dIt is a schematic structural diagram of a bill service system provided by an embodiment of the present application;
[0030] Figure 2 It is a schematic flowchart of a data processing method based on a blockchain network provided by an embodiment of the present application;
[0031] Figure 3 It is a schematic flowchart of a process for obtaining a bill request provided by an embodiment of the present application;
[0032] Figure 4 It is a schematic flowchart of another data processing method based on a blockchain network provided by an embodiment of the present application;
[0033] Figure 5 It is a schematic flowchart of yet another data processing method based on a blockchain network provided by an embodiment of the present application;
[0034] Figure 6 It is a schematic flowchart of yet another data processing method based on a blockchain network provided by an embodiment of the present application;
[0035] Figure 7 It is a schematic structural diagram of a data processing device based on a blockchain network provided by an embodiment of the present application;
[0036] Figure 8 It is a schematic structural diagram of another data processing device based on a blockchain network provided by an embodiment of the present application;
[0037] Figure 9 It is a schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners
[0038] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.
[0039] To better understand the solutions in the embodiments of the present application, the following first introduces the relevant terms and concepts that may be involved in the embodiments of the present application.
[0040] The embodiments of the present application relate to a blockchain network. The following briefly introduces the relevant terms and concepts of the blockchain network:
[0041] The blockchain network 10 refers to a network used for data sharing between nodes. The blockchain network may include multiple nodes 101. Among them, the multiple nodes 101 may include various types of nodes such as consensus nodes, full nodes, and light nodes (such as SPV (Simplified Payment Verification) nodes). A full node may refer to a node that maintains the complete blockchain in the blockchain network, and a light node may refer to a node that maintains the block headers in the blockchain. A light node can be understood as a node that does not have the complete blockchain. Each node 101 can receive input information during normal operation and maintain the shared data (i.e., the blockchain) in the blockchain network based on the received input information.
[0042] Among them, different nodes in the blockchain network can store the same blockchain, and the blockchain includes a series of blocks that are sequentially connected in the order of generation time. The nodes here may refer to nodes that maintain the complete blockchain in the blockchain network, such as the above-mentioned full nodes, consensus nodes, etc. As Figure 1a shown in Block 1, Block M - 1, etc., where M is a positive integer greater than 1; once a new block is added to the blockchain, it will not be removed again. The block records the record data submitted by the nodes in the blockchain network. To ensure information intercommunication within the blockchain network, there can be information connections between each node, and point-to-point (Peer To Peer) communication can be achieved between any two nodes. Specifically, point-to-point communication can be carried out through wired communication links or wireless communication links. For example, when any node in the blockchain network receives input information, other nodes obtain the input information according to the consensus algorithm and store the input information as data in the shared data, so that the data stored on all nodes in the blockchain network is consistent.
[0043] The client 102 can access the blockchain network and communicate with the nodes in the blockchain network. For example, it can send transaction data to the nodes, etc. The terminal where the client 102 is located can specifically be a smart phone, a tablet computer, a notebook computer, a desktop computer, an in-vehicle intelligent terminal, etc., which is not limited in the embodiments of the present application.
[0044] It should be noted that Figure 1a the number of nodes shown is only illustrative. According to actual needs, any number of nodes can be deployed. The node can refer to any form of computing device connected to the network. For example, servers and terminals can both join and become nodes.
[0045] Among them, each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes in the blockchain network, so as to broadcast the generated block to other nodes in the blockchain network according to the node identifiers of other nodes later. A node identifier list as shown in the following table can be maintained in each node, and the node name and the node identifier are stored in the node identifier list correspondingly. Among them, the node identifier can be an Internet Protocol (IP) address and any other information that can be used to identify the node. Only the IP address is taken as an example in the table for illustration.
[0046] Node Name Node Identifier Node 1 117.114.151.174 Node 2 117.116.189.145 … … Node N 119.123.789.258
[0047] Among them, each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks. See Figure 1b , the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information feature value, version number, timestamp, and difficulty value. The block body stores the input information; the next block of the genesis block uses the genesis block as the parent block. The next block also includes a block header and a block body. The block header stores the input information feature value (or called Merkle root hash value, merkle_root, etc.) of the current block, the block header feature value (or called prev_hash, etc.) of the parent block, version number, timestamp, and difficulty value, and so on. In this way, the block data stored in each block in the blockchain is associated with the block data stored in the parent block, ensuring the security of the input information in the block.
[0048] Among them, when generating each block in the blockchain, see Figure 1c , when the node where the blockchain is located receives the input information, it verifies the input information. After the verification is completed, it stores the input information in the memory pool and updates the hash tree used to record the input information; then, it updates the timestamp to the time when the input information is received and tries different random numbers, and performs the eigenvalue calculation multiple times so that the calculated eigenvalue can satisfy the following formula:
[0049] SHA256(SHA256(version + prev_hash + merkle_root + ntime + nbits + x)) < TARGET
[0050] Among them, SHA256 is the eigenvalue algorithm used to calculate the eigenvalue; version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header eigenvalue of the parent block of the current block; merkle_root is the eigenvalue of the input information; ntime is the update time for updating the timestamp; nbits is the current difficulty, which is a fixed value within a certain period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, and this eigenvalue threshold can be determined according to nbits.
[0051] In this way, when a random number that satisfies the above formula is calculated, the information can be stored correspondingly, the block header and the block body are generated, and the current block is obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in its blockchain network according to the node identifiers of other nodes in the blockchain network. Other nodes verify the newly generated block and add the newly generated block to the blockchain they store after the verification is completed.
[0052] Among them, smart contracts can run on the nodes of the blockchain network. A smart contract is an immutable and automatically executed computer program running on the blockchain. A smart contract is the code implementation for execution when certain conditions are met. Developers can define the contract logic through programming languages, publish it to the blockchain (smart contract registration), trigger the execution according to the logic of the contract terms by calling keys or other events, complete the contract logic, and at the same time provide functions for upgrading and canceling smart contracts.
[0053] Based on the above introduction of the blockchain network, the embodiment of the present application proposes a data processing solution based on the blockchain network and a corresponding bill service system. The principle of this data processing solution is as follows: The target bill execution device can obtain the bill request submitted by the object, respond to the bill request and generate the target bill and the bill issuance certificate of the target bill. Further, it can also generate a verification request for verifying the bill issuance certificate and send the verification request to the target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate. When the target bill verification device obtains the corresponding verification result, it can return the verification result to the target bill execution device. Then the target bill execution device can determine whether the bill issuance certificate passes the bill verification based on the verification result, and when it is determined that the bill issuance certificate passes the bill verification, store the bill issuance certificate on the blockchain network.
[0054] Based on the relevant descriptions of the above data processing solution, it can be known that in the embodiment of this application, when issuing a bill, the bill execution device can also be used to generate a bill issuance certificate corresponding to the bill, and the bill issuance certificate can be saved to the blockchain network to ensure public transparency and traceability. In order to upload the bill issuance certificate to the chain, it is necessary to use the bill verification device to verify the bill issuance certificate. Only when it passes the verification can the bill issuance certificate be uploaded to the chain to ensure that the bill execution device cannot perform malicious or abnormal behaviors when issuing bills, thereby effectively improving the reliability and security of the bill service.
[0055] Please refer to Figure 1d , which is a schematic diagram of the architecture of a bill service system provided by the embodiment of this application. The above data processing solution can be applied to this bill service system. The bill service system can include a bill service hosting network and a blockchain network. The bill service hosting network can include multiple devices, and the devices in the network can be maintained by bill service providers. A bill service provider can maintain one or more devices, and the bill service provider can independently select the devices to be maintained as bill verification devices or bill execution devices. When the bill service provider selects the corresponding device as the bill execution device, the bill execution program can be deployed on the bill execution device. When the bill service provider selects the corresponding device as the bill verification device, the bill verification program can be deployed on the bill verification device.
[0056] In summary, it can be known that the bill service hosting network can include multiple bill execution devices and multiple bill verification devices. The multiple bill execution devices can form an execution device cluster, and the multiple bill verification devices can form a verification device cluster.
[0057] Each device can be maintained by an independent bill service provider. Among them, each bill execution device can independently run the bill execution program, and the invoice business execution program is responsible for issuing bills and constructing the bill issuance certificate of the bill, and uploading the bill issuance certificate to the chain and saving it on the blockchain network. Each bill verification device can independently run the bill verification program, and the bill verification program can be responsible for verifying the bill issuance certificate of the invoice on the chain.
[0058] Among them, the bill service hosting network constructed by multiple bill execution devices and multiple bill verification devices is a decentralized service network. The object is to issue bills for invoice services by arbitrarily selecting one or more bill service providers in this decentralized service network, so as to realize the decentralization of bill services and improve the scalability, stability and transparency of services. Based on this, it can be known that the above-mentioned bill service hosting network can also be called a decentralized network. The execution device cluster is called a bill execution network, and the verification device cluster is called a bill verification network. That is, the decentralized network can include a bill execution network and a bill verification network. The bill execution network can include multiple bill execution devices for providing bill issuance services, and the bill verification network can include multiple bill verification devices for providing bill verification services.
[0059] Among them, the on-chain storage of the bill issuance certificate can be executed by invoking the on-chain bill issuance certificate contract. Based on this, it can be known that the invoice service system can be divided into an off-chain bill business system and an on-chain bill issuance certificate contract; the off-chain bill business system is borne by the decentralized service network, and each bill service provider in the decentralized service network will provide bill services externally. The on-chain invoice certificate contract can be responsible for storing the bill issuance certificate.
[0060] Figure 1d The numbers of bill execution devices and bill verification devices in the bill service hosting network shown are only illustrative. According to actual needs, any number of bill execution devices and bill verification devices can be deployed.
[0061] Among them, the bill service system can also include a device allocator and a pledge gateway (or called a margin processing gateway). Among them, the device allocator can provide a centralized service, which can be provided by the official organization of network operation and maintenance, and can be used to collect bill execution devices and bill verification devices in the bill service hosting network, maintain the device set of the entire network, and provide the ability to randomly select devices. For example, when verifying the bill issuance certificate, the device allocator can be used to select the target bill verification device for verifying the bill issuance certificate from multiple bill verification devices.
[0062] The pledge gateway can be used to strengthen the reliability of each device in the bill service hosting network. The pledge gateway can be used to process the pledge resources (i.e., margin) submitted by bill execution devices and bill verification devices, that is, it can provide a resource pledge service. For example, when a device needs to join the bill service hosting network, the pledge gateway can lock the pledge resources in the blockchain network. When the device needs to withdraw from the bill service hosting network, the pledge gateway can unlock the pledge resources in the blockchain network to realize the refund of the pledge resources.
[0063] The implementation details of the technical solution of the embodiments of the present application are elaborated in detail as follows:
[0064] Please refer to Figure 2 , Figure 2 , which is a schematic flowchart of a data processing method based on a blockchain network provided by the embodiments of the present application. The embodiments of the present application mainly describe the interaction between a target bill execution device and a target bill verification device. The target bill execution device is one of multiple bill execution devices in a bill execution network, and the target bill verification device is at least one of multiple bill verification devices in a bill verification network.
[0065] As Figure 2 shown, the data processing method based on the blockchain network may include:
[0066] S201. The target bill execution device obtains a bill request submitted by an object.
[0067] Among them, the object may refer to any user. The bill request may carry bill information required for generating a bill. For example, the bill information may include: relevant information of the payer (such as the full name of the payer's unit, address, contact information, etc.), the bill amount, the invoice issuance time, etc.
[0068] In one implementation, the bill service system may provide a visual bill service platform, which may run on a terminal device. When the object has a need to issue an invoice, the bill request may be sent to the target bill execution device through the bill service platform. Optionally, when the object needs to issue an invoice, the object may perform relevant operations through the bill service platform running on the terminal device to send a bill request to the bill execution device. Among them, the bill service platform may output a bill issuance interface, and the object may input the bill information required for generating a bill on the bill issuance interface, so that the terminal device running the bill issuance platform can obtain the bill information, generate a corresponding bill request, and then send the bill request to the bill execution device.
[0069] For example, refer to Figure 3As shown in the figure: The terminal device used by the object can display the invoice issuing interface corresponding to the invoice service platform on the terminal screen. This invoice issuing interface can at least include an information setting area marked by 301 and a confirmation control marked by 302. For example, this information setting area can include the unit name setting item of the payer, the unit address setting item, the contact information setting item, and so on. If the object wants to issue an invoice, the object can input the corresponding invoice information in the information setting area 301, and then perform a trigger operation (such as a click operation, a press operation, etc.) on the confirmation control 302, so as to trigger the terminal device used by the object to generate an invoice request according to the invoice information obtained in the information setting area 301; after the terminal device generates this invoice request, it can send this invoice request to the corresponding target invoice execution device.
[0070] It should be noted that, as described above, the invoice service system can include invoice execution devices maintained by multiple invoice service providers respectively, that is, there are services for multiple invoice service providers in this invoice service system. When the object issues an invoice, it can select the invoice service provider for issuing the invoice by itself from these multiple invoice service providers according to its own needs, and the invoice execution device maintained by the selected invoice service provider is the target invoice execution device.
[0071] For example, the information setting area in the above invoice issuing interface can also include a setting item for the invoice service provider. The object can select the information of the corresponding invoice service provider (such as it can be the service provider identifier) in this setting item. After the terminal device obtains the service provider identifier in this setting item, it can determine the device identifier corresponding to this service provider identifier based on this service provider identifier. This device identifier is also used to indicate the invoice execution device maintained by the invoice service provider, so that after the terminal device determines this device identifier, it can send the invoice request to the invoice execution device indicated by this device identifier (that is, the target invoice execution device).
[0072] Among them, a mapping relationship between the service provider identifier of the invoice service provider and the device identifier of the maintained invoice execution device is pre-set on the invoice issuing platform, that is, after the terminal device obtains the service provider identifier of the invoice service provider set by the object, it can determine the device identifier corresponding to this service provider identifier based on this mapping relationship.
[0073] In summary, the embodiment of the present application can achieve the full-link decentralization of the invoice service system. The object can arbitrarily select one or more invoice service providers in this decentralized service network to issue invoices, realizing the decentralization of the invoice service, thereby effectively improving the scalability, stability and transparency of the service.
[0074] S202, the target invoice execution device responds to the invoice request and generates a target invoice and an invoice issuing certificate of the target invoice based on the invoice information.
[0075] Among them, the bill request may carry a program request, and the program request can be used to request to execute a program using the bill service to generate a bill. The program for executing the bill service can be pre-configured. The program for executing the bill service can be responsible for issuing the bill, and can also construct a proof of issue corresponding to the bill (i.e., the bill issuance proof), and chain it.
[0076] Based on this, it can be known that after receiving the bill request, the target bill execution device can respond to the program request in the bill request to call the program for executing the bill service and generate a corresponding bill (such as the bill can be called the target bill) and the bill issuance proof of the target bill based on the bill information.
[0077] S203, the target bill execution device generates a verification request for verifying the bill issuance proof, and the verification request carries the bill issuance proof.
[0078] As mentioned above, in addition to generating the corresponding target bill, the bill issuance proof of the target bill can also be generated. To ensure the public transparency and verifiability of the target bill, the bill issuance proof of the target bill can be saved on the blockchain network, that is, it is necessary to chain the bill issuance proof. To ensure that the bill issuance proof is normal, or to ensure the authenticity of the bill issuance proof, before chaining, the bill issuance proof can be verified for bills. Only when the bill verification is passed can the bill issuance proof be chained. Based on this, it can be known that here, through the bill verification of the bill issuance proof, it can effectively ensure that the target bill execution device cannot perform abnormal behaviors such as malicious acts when issuing bills, so as to effectively improve the security and reliability of the bill service.
[0079] In summary, the target bill execution device can generate a verification request for verifying the bill issuance proof, so that the subsequent target bill verification device can respond to the verification request to implement the bill verification of the bill issuance proof. Among them, the verification request can carry the bill issuance proof.
[0080] S204, the target bill execution device sends the verification request to the target bill verification device.
[0081] Among them, the target bill verification device can be the bill verification device used for bill verification among multiple bill verification devices in the bill service system; the target bill verification device is at least one of the multiple bill verification devices, that is, the number of target bill verification devices is one or more.
[0082] S205, the target bill verification device responds to the verification request and obtains the bill information in the bill request submitted by the object.
[0083] It can be understood that the information in the target bill is included in the bill issuance certificate, and the target bill is generated based on the bill information submitted by the object. To ensure the authenticity and reliability of the bill issuance certificate, the bill information in the bill issuance certificate can be compared with the bill information mentioned by the object to determine the authenticity and reliability of the bill issuance certificate. Based on this, the bill verification here can be understood as verifying the authenticity of the bill issuance certificate.
[0084] In one implementation, when the target bill verification device receives a verification request, it can respond to the verification request and obtain the bill information in the bill request to verify the bill issuance certificate using the bill information in the bill request. Among them, the bill information in the bill request can be carried in the verification request; in one embodiment, when generating the verification request in S203, the bill request and the bill issuance certificate can be packaged and assembled into a data packet for the verification request to implement the verification of the invoice issuance certificate based on the verification request.
[0085] S206, the target bill verification device verifies the bill issuance certificate based on the bill information, generates a verification result, and sends the verification result to the target bill execution device.
[0086] In one implementation, each bill verification device in the bill service system can independently run a bill verification program, which can be responsible for verifying the bill issuance certificate of the bill on the chain; generally speaking, this bill verification program indicates the verification logic for verifying the bill issuance certificate. Then, after the target bill verification device receives the verification request, it can call the bill verification program and verify the bill issuance certificate based on the bill information, and generate a corresponding verification result.
[0087] S207, the target bill execution device receives the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, the bill issuance certificate is stored on the blockchain network.
[0088] Among them, the number of target bill verification devices can be multiple. One target bill verification device can correspond to one verification result. The verification results of each target bill verification device for verifying the bill issuance certificate can include: the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification, or the corresponding target bill verification device determines that the bill issuance certificate fails to pass the bill verification. Simply put, the verification result can include the result of passing the bill verification and the result of failing to pass the bill verification.
[0089] In one implementation, after the bill execution device receives the verification results of each target bill verification device, it can determine whether the bill issuance certificate passes the bill verification based on each verification result; if it is determined based on the verification result that the bill issuance certificate passes the bill verification, it indicates that the bill issuance certificate is true and reliable, that is, the bill issuance certificate can be stored on the blockchain network; if it is determined based on the verification result that the bill issuance certificate fails to pass the bill verification, it indicates that there is a problem with the authenticity of the bill issuance certificate. For example, there may be a difference between the information in the bill issuance certificate and the bill information provided by the object. In this case, it is prohibited to store the bill issuance certificate on the blockchain network.
[0090] In the embodiments of the present application, the full-link decentralization of the bill service system can be realized. The object can arbitrarily select one or more bill service providers in this decentralized service network to issue bills, realizing the decentralization of the bill service and improving the scalability, stability, and transparency of the service. Moreover, the devices in the decentralized service network can be divided into bill execution devices and bill verification devices. The bill execution devices are responsible for providing bill services externally, and the relevant certificates of bill issuance will be saved to the blockchain network, which is publicly transparent and verifiable. The bill verification devices verify whether the relevant certificates on the chain are normal, ensuring that the bill execution devices cannot perform malicious acts or other abnormal behaviors when issuing bills, and improving the reliability and security of the bill service. In addition, all bill service providers in the decentralized service network jointly bear the pressure of the entire bill service system, and each bill service provider can provide services externally according to its own resource conditions, effectively reducing the deployment cost and operation and maintenance cost. Generally speaking, compared with the traditional centralized bill service system, storing the bill issuance certificate on the blockchain network introduced in the embodiments of the present application can effectively improve the security and reliability of the bill service; compared with the traditional blockchain-based bill service, the embodiments of the present application can provide a decentralized off-chain bill business system, improving the user experience while having sufficient decentralized guarantees.
[0091] Based on the above embodiments, the embodiments of the present application provide another data processing method based on the blockchain network. The data processing method of the embodiments of the present application is mainly described from the perspective of the target bill execution device, and the target bill execution device is one of multiple bill execution devices. Please refer to Figure 4 , and the data processing method based on the blockchain network includes but is not limited to the following steps:
[0092] S401, obtain a bill request submitted by an object; the bill request carries the bill information required for generating a bill.
[0093] It should be noted that the bill service provider can maintain one or more devices, and the bill service provider can independently select a certain device as the bill execution device or the bill verification device. If the device maintained by the bill service provider wants to join the decentralized network in the bill service system as a node and serve as the bill execution device; to ensure that no abnormal behavior (such as refusing to provide the bill issuance service, malicious behavior (such as fraud, etc.)) occurs when the bill execution device issues a bill, and to ensure the reliability of the bill issued by the bill execution device, the bill service provider can pay a deposit on the blockchain network and lock the deposit to ensure that no abnormal behavior occurs when the bill execution device issues a bill. When the bill execution device needs to withdraw from the decentralized network, the bill execution device can also apply to unlock the deposit, and the deposit on the chain can be returned to the bill service provider corresponding to the bill execution device.
[0094] In one implementation, the processing of the above-mentioned deposit (such as payment, refund, etc.) can be achieved by calling the pledge gateway (or called the deposit processing gateway). The following specifically elaborates on the joining or withdrawal of the bill execution device from the decentralized network. It should be noted that there can be one or more bill execution devices in the decentralized network. Among them, each bill execution device can be maintained by a bill service provider, and the principle of each bill execution device applying to join or withdraw from the decentralized network is the same. Therefore, the following takes the joining and withdrawal of one bill execution device (such as the target bill execution device here) as an example for explanation.
[0095] Optionally, when the bill service provider needs to join the decentralized network, the target bill execution device maintained by the bill service provider can send a first resource processing event to the pledge gateway to enable the pledge gateway to respond to the first resource processing event. Among them, the first resource processing event can be used to indicate that the target bill execution device applies to join the decentralized network and locks the first pledge resource submitted by the bill execution device in the blockchain network. The first pledge resource can be understood as the above-mentioned deposit. That is, the target bill execution device can pledge the deposit (the first pledge resource) through the pledge gateway, and the pledge gateway can lock the deposit in the blockchain network.
[0096] As mentioned above, only after the deposit provided by the corresponding bill service provider is pledged in the blockchain network does it indicate that the bill service provider has joined the decentralized network, and then the target bill execution device maintained by the bill service provider has the function of issuing bills. Based on this, it can be known that after the target bill execution device detects that the locking of the first pledge resource is successfully completed, it can execute the step of obtaining the bill request submitted by the object.
[0097] Optionally, when the bill service provider wants to withdraw from the decentralized network, the target bill execution device maintained by the bill service provider can send a second resource processing event to the pledge gateway, so that the pledge gateway responds to the second resource processing event. The second resource processing event can be used to indicate that the target bill execution device applies to withdraw from the decentralized network and unlocks the first pledge resource submitted by the target bill execution device in the blockchain network. That is, the target bill execution device can unlock the margin (the first pledge resource) through the pledge gateway and return the unlocked first pledge resource to the bill service provider.
[0098] In one embodiment, the target bill execution device can directly unlock the first pledge resource in the blockchain network through the pledge gateway and return the first pledge resource to the account corresponding to the target bill execution device through the pledge gateway. This account is also the account corresponding to the bill service provider that maintains the target bill execution device.
[0099] In one embodiment, in addition to directly unlocking the first pledge resource, it is also possible to determine whether the first pledge resource can be unlocked after a challenge period. In a specific implementation, the target bill execution device can first determine the bill generation situation of the target bill execution device during the first challenge period through the pledge gateway; if it is determined that the target bill execution device has succeeded in the challenge based on the bill generation situation, the first pledge resource can be returned to the account corresponding to the target bill execution device through the pledge gateway; if it is determined that the target bill execution device has failed in the challenge based on the bill generation situation, the return of the first pledge resource to the account corresponding to the target bill execution device can be prohibited.
[0100] Among them, the first challenge period can refer to a time period after the application for withdrawing from the bill service system is initiated, and its specific duration is not limited. The bill generation situation can refer to whether there are abnormal behaviors when generating bills. That is, if the target bill execution device successfully generates bills without abnormal behaviors during the first challenge period, it can be determined that the target bill execution device has succeeded in the challenge. If there are abnormal behaviors when the target bill execution device generates bills during the first challenge period, it can be determined that the target bill execution device has failed in the challenge. In summary, only when there are no abnormal behaviors of the target bill execution device during the first challenge period will the first pledge resource be returned to the corresponding bill service provider.
[0101] It should be noted that the first pledge resources (i.e., margins) provided by each bill execution device can be the same or different, and this is not limited.
[0102] Among them, to ensure the high-quality operation of the bill service system, the bill execution devices in the bill service system can ensure that they have sufficient machine resources. That is, when the bill service provider deploys the bill issuance service, it can select the machine resources provided by the devices and preferably use the devices with better machine resources (such as devices with dual-core CPUs, 4G of memory, and 50G of hard disks) as bill execution devices and add them to the bill service system.
[0103] To sum up, to ensure the reliability of the bill execution devices added to the bill service system, the bill service provider can pay a deposit on the blockchain network to ensure that it will not perform abnormal behaviors such as malicious acts. Specifically, the deposit can be pledged through the pledge gateway, that is, the pledge gateway locks the deposit on the chain. When the bill execution device exits the bill service system, it can also apply for unlocking the deposit. After the application is successful, the deposit on the chain will be refunded to the bill service provider corresponding to the bill execution device.
[0104] S402: Respond to the bill request and generate a target bill and a bill issuance certificate for the target bill based on the bill information.
[0105] Among them, the specific implementation of step S402 can refer to the description in step S202 above and will not be elaborated here.
[0106] In one implementation, to ensure that the target bill execution device receives an unmodified bill request during the data transmission process of the bill request, signature data corresponding to the bill request can also be carried in the bill request, and the signature data is obtained by signing with a private key. In this case, after the target bill execution device obtains the bill request, it can first perform a security check on the bill request using the signature data. Only when the security check is passed is it allowed to execute step S402. Based on this, it can be known that if the security check is passed, the step of responding to the bill request and generating a target bill and a bill issuance certificate for the target bill based on the bill information is triggered.
[0107] Optionally, the specific implementation of performing a security check on the bill request using the signature data can be: first obtain the public key corresponding to the private key to decrypt the signature data using the public key to obtain decrypted data, and then perform a security check on the bill request based on the decrypted data and the bill request. Among them, if the way of signing the bill request is different, the security check on the bill request based on the decrypted data and the bill request will also be different. The following first elaborates on two ways of signing the bill request to obtain signature data:
[0108] Method 1: Directly sign the bill request using the private key to obtain the corresponding signature data. The private key used for signing is not limited.
[0109] Method 2: First, perform a hash calculation on the bill request to obtain the corresponding hash data. For ease of description, the hash data here can be referred to as the first hash data. Then, the private key can be used to sign the first hash data to obtain the corresponding signature data.
[0110] In one embodiment, when the signature data is obtained by using the above Method 1, the specific implementation of the security verification can be: The target bill execution device compares the unsigned data with the bill request for consistency. If the consistency comparison is passed, it can be determined that the security verification is passed; if the consistency comparison fails, it can be determined that the security verification fails.
[0111] Among them, comparing the unsigned data with the bill request is to determine whether the unsigned data is consistent with the bill request; when it is determined that the unsigned data is consistent with the bill request, it can be determined that the unsigned data and the bill request pass the consistency comparison; when it is determined that the unsigned data is inconsistent with the bill request, it can be determined that the unsigned data and the bill request fail the consistency comparison.
[0112] In one embodiment, when the signature data is obtained by using the above Method 2, the specific implementation of the security verification can be: The target bill execution device first performs a hash calculation on the bill request to obtain the corresponding hash data, which can be referred to as the second hash data. The hash calculation here is the same as the hash algorithm used in the hash calculation during signing. Then, the target bill execution device can compare the unsigned data and the second hash data for consistency; if the consistency comparison is passed, it can be determined that the security verification is passed; if the consistency comparison fails, it can be determined that the security verification fails.
[0113] Among them, the principle of comparing the unsigned data and the second hash data for consistency is the same as the principle of comparing the unsigned data with the bill request described above, and will not be elaborated here.
[0114] S403. Generate a verification request for verifying the bill issuance certificate. The verification request carries the bill issuance certificate.
[0115] Among them, the specific implementation of this step can refer to the description in the above step S203 and will not be elaborated here.
[0116] S404. Send the verification request to the target bill verification device so that the target bill verification device responds to the verification request and verifies the bill issuance certificate.
[0117] In one implementation, when the target bill execution device sends a verification request to the corresponding bill verification device, it can first determine the target bill verification device based on the information carried in the bill request, so as to send the verification request to the target bill verification device.
[0118] Among them, when the object initiates a bill request, the object can set relevant information about determining the target bill verification device in the bill request. For example, the bill request can carry the device identifier of the verification device for verifying the bill issuance certificate (this device identifier can be used to uniquely indicate the verification device, and the verification device corresponding to the device identifier here is the target bill verification device), that is, the object can directly specify the verification device for verifying the bill issuance certificate.
[0119] Or, the bill request carries the number of devices of the verification device for verifying the bill issuance certificate. That is, the object only specifies how many bill verification devices are used to verify the bill issuance certificate. Based on this, it is necessary to determine the specific verification device (i.e., the target bill verification device) based on the number of devices at this time.
[0120] In this case, it is also possible to check whether there is field information indicating the use of a device allocator in the bill request. If the field information indicates the use of an allocator, the target bill execution device determines the corresponding target bill verification device based on the device allocator, and needs to call the device allocator to send the verification request to the corresponding target bill verification device. If the field information indicates not using the device allocator, the target bill execution device determines the corresponding target bill verification device by itself.
[0121] It should be noted that the device identifier of the verification device for verifying the bill issuance certificate in the above bill request, or the number of devices of the verification device for verifying the bill issuance certificate, and the field information indicating whether to use the device allocator and other information can all be set by the object on the bill issuance interface of the bill service platform.
[0122] Based on the above description, it can be seen that due to the differences in the information carried in the bill request, the process for the bill execution device to send the verification request to the target bill verification device will also be different. The following specifically describes various situations.
[0123] (1) The bill request carries the device identifier of the verification device for verifying the bill issuance certificate.
[0124] In this case, the specific implementation of step S404 can be: the target bill execution device sends the verification request to the target bill verification device indicated by the device identifier. It should be noted that when the device identifier is carried in the bill request, regardless of whether the bill request carries field information regarding whether to use the device allocator, the target bill execution device directly sends the verification request to the target bill verification device without using the device allocator.
[0125] (2) The bill request carries field information regarding whether to use the device allocator, and the number of devices of the verification device for verifying the bill issuance certificate.
[0126] In this case, the specific implementation of step S404 can be: if the target bill execution device determines that the field information indicates not to use the device allocator, the target bill execution device directly selects from multiple bill execution devices the target bill verification devices with the number equal to the number of devices; after the selection is completed, the target bill execution device then sends the verification request to the target bill verification devices.
[0127] (3) The bill request carries field information regarding whether to use the device allocator, and the number of devices of the verification device for verifying the bill issuance certificate.
[0128] Based on this, it can be known that the specific implementation of step S404 can be: if the target bill execution device determines that the field information indicates to use the device allocator, the target bill execution device can send the verification request to the device allocator, so that the device allocator selects from multiple bill verification devices the target bill verification devices with the number equal to the number of devices; after the device allocator determines the target bill verification devices, the device allocator then sends the verification request to the target bill verification devices.
[0129] In this case, the target bill execution device can send the verification request to the device allocator, and the device allocator selects the target bill verification devices on behalf of it and waits to collect the corresponding verification results and returns them to the target bill execution device.
[0130] There is an interaction among the target bill execution device, the device allocator, and the target bill verification device here, and the process can be: the bill execution device sends the verification request to the device allocator; the device allocator receives the verification request and determines the target bill verification devices from multiple bill verification devices; the device allocator sends the verification request to the target bill verification devices.
[0131] The following elaborates on the specific implementation of the device allocator determining the target bill verification devices.
[0132] In one implementation, the device allocator determines the device parameters of multiple ticket verification devices, and based on the device parameters of each ticket verification device, selects a target ticket verification device with the number equal to the number of devices from the multiple ticket verification devices.
[0133] Among them, the device parameters of any ticket verification device may include one or more of the following: the trust level of any ticket verification device, the scale of the ticket verification service provider corresponding to any ticket verification device, etc. The trust level can be used to measure the probability of successful verification of historical ticket issuance certificates by any ticket verification device. Here, the historical ticket issuance certificate may refer to the ticket issuance certificate within a historical time period. The historical time period may refer to a time period before the current time and with a preset time interval (such as 7 days, 10 days, etc.) from the current time. The current time here may refer to the moment when the determination requirement for determining the target ticket verification device is detected.
[0134] Optionally, when the device parameters of the ticket verification device include the trust level of the ticket verification device, the multiple ticket verification devices can be sorted in descending order of the trust level to obtain a sorting result of the ticket verification devices (which can be called the first sorting result); the ticket verification devices in the first N positions in the first sorting result are used as the target ticket verification devices. Here, N is the number of devices.
[0135] In this selection method, the ticket verification device with a higher trust level can be used as the target ticket verification device to improve the reliability of ticket verification for ticket issuance certificates.
[0136] Optionally, when the device parameters of the ticket verification device include the scale of the ticket verification service provider corresponding to the ticket verification device, the multiple ticket verification devices can be sorted in descending order of the scale to obtain a sorting result of the ticket verification devices (which can be called the second sorting result); the ticket verification devices in the first N positions in the second sorting result are used as the target ticket verification devices.
[0137] In this selection method, the ticket verification device corresponding to the ticket verification service provider with a larger scale can be used as the target ticket verification device. It can be understood that the larger the scale of the ticket verification service provider, the higher the authority of the ticket verification service provider may be or the more experience in participating in ticket verification. Then, through this method, the reliability of ticket verification for ticket issuance certificates can be effectively improved.
[0138] Optionally, when the device parameters of the bill verification device include the trust level of the bill verification device and the scale of the bill verification service provider corresponding to the bill verification device, multiple bill verification devices can be sorted in descending order of trust level to obtain a first sorting result of the bill verification devices; and multiple bill verification devices can be sorted in descending order of scale to obtain a second sorting result of the bill verification devices. Then, the ranking of each bill verification device in the first sorting result (which can be called the first ranking) can be obtained, and the ranking of each bill verification device in the second sorting result (which can be called the second ranking) can be obtained. Finally, the target ranking of the corresponding bill verification device can be determined based on the first ranking and the second ranking of each bill verification device, so as to determine the target bill verification device from multiple bill verification devices based on the target ranking of each bill verification device; for example, the bill verification devices with the target ranking in the top N can be determined as the target bill verification devices.
[0139] In this selection method, the trust level and the scale dimension can be combined to select the target bill verification device, which can enhance the rationality of the selection while ensuring the reliability of the bill verification. It should be noted that the above selection method of the target bill verification device by the target bill execution device can be a random selection method. Since the random selection method cannot well ensure the selection of a bill verification device with better verification performance for bill verification, to ensure the reliability of the bill verification, when the object sets the relevant information in the bill request and configures the field information regarding whether to use the device allocator, the field information of using the device allocator can be preferentially configured.
[0140] S405. Receive the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, store the bill issuance certificate on the blockchain network.
[0141] Among them, the verification result received by the target bill execution device can be the verification result signed by the target bill verification device for the verification result, or the unsigned verification result, which is not limited. To ensure the security of communication transmission, the target bill verification device can sign the verification result and send the signed verification result to the target bill execution device.
[0142] In one implementation, when the verification request is directly sent to each target bill verification device through the target bill execution device, the bill execution device can directly receive the verification results returned by each target bill verification device.
[0143] In one implementation, when the verification request is sent to each target ticket verification device by calling the device allocator, the target ticket execution device can obtain the verification devices returned by each target ticket verification device by calling the device allocator. That is, the target ticket execution device can receive the verification results returned by the device allocator, and the verification results on the device allocator are those returned by the target ticket verification devices.
[0144] Among them, the number of target ticket verification devices can be multiple. One target ticket verification device can correspond to one verification result. The verification results of each target ticket verification device for verifying the ticket issuance certificate can include: the corresponding target ticket verification device determines that the ticket issuance certificate passes the ticket verification, or the corresponding target ticket verification device determines that the ticket issuance certificate fails the ticket verification. Simply put, the verification results can include the results of passing the ticket verification and the results of failing the ticket verification.
[0145] In one implementation, after the target ticket execution device receives the verification results of each target ticket verification device, it can determine whether the ticket issuance certificate passes the ticket verification based on each verification result; if it is determined based on the verification results that the ticket issuance certificate passes the ticket verification, it indicates that the ticket issuance certificate is true and reliable, that is, the ticket issuance certificate can be stored on the blockchain network; if it is determined based on the verification results that the ticket issuance certificate fails the ticket verification, it indicates that there is a problem with the authenticity of the ticket issuance certificate. For example, the information in the ticket issuance certificate may be different from the ticket information provided by the object. In this case, it is prohibited to store the ticket issuance certificate on the blockchain network.
[0146] Optionally, the specific implementation of the target ticket execution device determining whether the ticket issuance certificate passes the ticket verification based on each verification result can be: the target ticket execution device can count the number of target verification results (which can be called the first number); among them, the target verification results include the verification results used to indicate that the corresponding target ticket verification device determines that the ticket issuance certificate passes the ticket verification, that is, the target verification results are the verification results of passing the ticket verification. After obtaining the first number, the first number can be compared with the preset number to determine whether the ticket issuance certificate passes the ticket verification based on the comparison result. If the first number is greater than or equal to the preset number, it is determined that the ticket issuance certificate can pass the ticket verification; if the first number is less than the preset number, it can be determined that the ticket issuance certificate fails the ticket verification.
[0147] Among them, the preset quantity can be preset by the system or an object (such as the preset quantity can be carried in the bill request). The preset quantity can be set to a value larger than half of the quantity of the target bill verification devices, so as to ensure that when it is determined that the bill verification is passed, it is determined that the bill issuance certificate passes the bill verification through more than half of the target bill verification devices, thereby improving the reliability and effectiveness of the bill verification.
[0148] Optionally, the specific implementation of determining whether the bill issuance certificate passes the bill verification based on each verification result can be: the quantity of the target verification results can be counted (which can be called the first quantity), and the quantity of the target bill verification devices (which can be called the second quantity); after obtaining the first quantity and the second quantity, it can be determined whether the bill issuance certificate passes the bill verification based on the first quantity and the second quantity. In one embodiment, the ratio of the first quantity to the second quantity can be calculated, and this ratio can be compared with a preset ratio to determine whether the bill issuance certificate passes the bill verification based on the comparison result.
[0149] If the ratio between the first quantity and the second quantity is greater than or equal to the preset ratio, it is determined that the bill issuance certificate can pass the bill verification; if the ratio between the first quantity and the second quantity is less than the preset ratio, it can be determined that the bill issuance certificate fails to pass the bill verification.
[0150] Among them, the preset ratio can be preset by the system or an object (such as the preset ratio can be carried in the bill request), such as it can be set to 2 / 3, 4 / 5, etc. The preset ratio can be set to a ratio larger than 1 / 2, so as to ensure that when it is determined that the bill verification is passed, it is determined that the bill issuance certificate passes the bill verification through more than half of the target bill verification devices, thereby improving the reliability and effectiveness of the bill verification.
[0151] In one implementation manner, the target bill execution device can call the bill issuance program to construct a bill issuance certificate transaction for uploading the bill issuance certificate to the blockchain network, so as to send this bill issuance certificate transaction to the blockchain network to achieve the purpose of storing the bill issuance certificate on the blockchain network. Among them, the process of transaction uploading here can be executed by calling the bill issuance certificate contract.
[0152] In addition to directly uploading the bill issuance certificate transaction to the blockchain, other information can also be uploaded together. For example, when generating the verification request in step S403, the bill request and the bill issuance certificate can be packaged and assembled into a data packet for the verification request. Then, after the bill verification device completes the bill verification of the bill issuance certificate, the data packet can be signed, and the signed data packet (which can be understood as the signed verification result) can be returned to the target bill execution device. After the target bill execution device determines that the bill issuance certificate passes the bill verification based on the signed data packet, the original data packet can be signed, and the data packet, the signature of the target bill execution device on the data packet, and the signature of the target bill verification device on the data packet can be assembled into an on-chain transaction and sent to the blockchain network for deposit. In this way of deposit, all the data involved in the bill processing process can be deposited on the blockchain network, so that relevant personnel can trace the entire bill processing process based on the data on the blockchain network, realizing complete openness and transparency for bill inspection.
[0153] In the embodiment of the present application, when issuing a bill, the bill execution device can be used to generate a bill issuance certificate corresponding to the bill, and the bill issuance certificate can be saved to the blockchain network to ensure openness, transparency, and traceability. To upload the bill issuance certificate to the blockchain, it is necessary to use the bill verification device to verify the bill issuance certificate. Only when it passes the verification can the bill issuance certificate be uploaded to ensure that the bill execution device cannot perform abnormal behaviors such as malicious acts when issuing bills, thereby effectively improving the reliability and security of bill services.
[0154] Based on the above embodiments, the embodiment of the present application provides another data processing method based on the blockchain network. The data processing method of the embodiment of the present application is mainly described from the perspective of the target bill verification device. Please refer to Figure 5 , and this data processing method based on the blockchain network includes but is not limited to the following steps:
[0155] S501, obtain a verification request sent by the target bill execution device; the verification request carries a bill issuance certificate of the target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object.
[0156] In one implementation, the target bill verification device can obtain the verification request sent by the target bill execution device so that the target bill verification device can perform bill verification on the bill issuance certificate of the target bill.
[0157] As described in the previous step S404, the verification request can be directly sent by the target bill execution device to the target bill verification device. In this case, the target bill verification device can directly obtain the verification request sent by the target bill execution device. Alternatively, the verification request can also be sent by the target bill execution device to the target bill verification device by calling the device allocator. In this case, the target bill verification device can obtain the verification request sent by the target bill execution device by calling the device allocator.
[0158] It should be noted that the bill service provider can maintain one or more devices, and the bill service provider can independently select a certain device as the bill verification device or devices. If the devices maintained by the bill service provider want to join the decentralized network as nodes and act as bill verification devices; to ensure that no abnormal behaviors (such as refusing to provide bill verification services, malicious acts (such as fraud, etc.)) occur when the bill verification device conducts bill verification, and to ensure the reliability of the bill verification by the bill verification device, the bill service provider can pay a deposit on the blockchain network and lock the deposit to ensure that no abnormal behaviors occur when the bill verification device conducts bill verification. When the bill verification device needs to withdraw from the decentralized network, the bill verification device can also apply to unlock the deposit, and the deposit on the chain can be returned to the bill service provider corresponding to the bill verification device.
[0159] In one implementation, the handling of the above-mentioned deposit (such as payment, refund, etc.) can be achieved by calling the pledge gateway. The following specifically elaborates on the joining or withdrawal of the bill verification device from the decentralized network. It should be noted that there can be one or more bill verification devices in the decentralized network. Among them, each bill verification device can be maintained by a bill service provider, and the principle of each bill verification device applying to join or withdraw from the decentralized network is the same. Therefore, the following takes the joining and withdrawal of one bill verification device (such as a target bill verification device) as an example for explanation.
[0160] Optionally, when the bill service provider needs to join the bill service system, the target bill verification device maintained by the bill service provider can send a third resource processing event to the pledge gateway to enable the pledge gateway to respond to the third resource processing event. Among them, the third resource processing event can be used to indicate that the target bill verification device applies to join the decentralized network and locks the second pledge resource submitted by the target bill verification device in the blockchain network. The second pledge resource can be understood as the above-mentioned deposit. That is, the target bill verification device can pledge the deposit (second pledge resource) through the pledge gateway, and the pledge gateway can lock the deposit in the blockchain network.
[0161] As described above, only after the margin provided by the corresponding bill service provider is pledged in the blockchain network, it indicates that the bill service provider has joined the decentralized network, and then the target bill verification device maintained by the bill service provider has the function of bill verification. Based on this, it can be known that after the target bill verification device detects the successful locking of the second pledged resource, it can execute the step of obtaining the verification request sent by the target execution device.
[0162] Optionally, when the bill service provider wants to withdraw from the decentralized network, the target bill verification device maintained by the bill service provider can send a fourth resource processing event to the pledge gateway to enable the pledge gateway to respond to the fourth resource processing event. The fourth resource processing event can be used to indicate that the target bill verification device applies to withdraw from the decentralized network and unlocks the second pledged resource submitted by the target bill verification device in the blockchain network. That is, the target bill verification device can unlock the margin (second pledged resource) through the pledge gateway and return the unlocked second pledged resource to the bill service provider.
[0163] In one embodiment, the target bill verification device can directly unlock the second pledged resource in the blockchain network through the pledge gateway and return the second pledged resource to the account corresponding to the target bill verification device through the pledge gateway. This account is also the account corresponding to the bill service provider that maintains the target bill verification device.
[0164] In one embodiment, in addition to directly unlocking the second pledged resource, it is also possible to determine whether the second pledged resource can be unlocked after a challenge period. In a specific implementation, the target bill verification device can first determine the bill verification situation of the target bill verification device during the second challenge period through the pledge gateway; if it is determined that the target bill verification device has succeeded in the challenge based on the bill verification situation, the second pledged resource can be returned to the account corresponding to the target bill verification device through the pledge gateway; if it is determined that the target bill verification device has failed in the challenge based on the bill verification situation, the return of the second pledged resource to the account corresponding to the target bill verification device can be prohibited.
[0165] Among them, the second challenge period can refer to a time period after the target bill verification device initiates an application to withdraw from the decentralized network, and its specific duration is not limited. The bill verification situation can refer to whether there are any abnormal behaviors during the bill verification operation. That is, if there are no abnormal behaviors during the bill verification operation of the target bill verification device during the second challenge period, it can be determined that the target bill verification device has succeeded in the challenge. And if there are abnormal behaviors during the bill verification operation of the target bill verification device during the second challenge period, it can be determined that the target bill verification device has failed in the challenge. In summary, only when there are no abnormal behaviors of the target bill verification device during the second challenge period, the second pledged resource will be returned to the corresponding bill service provider.
[0166] It should be noted that the second pledge resources (i.e., margin) provided by each bill verification device can be the same or different, and no limitation is imposed thereon. Among them, the first pledge resource and the second pledge resource can be the same or different, and no limitation is imposed thereon.
[0167] Among them, to ensure the high-quality operation of the bill service system, the bill verification devices in the bill service system can ensure that they have sufficient machine resources. That is, when the bill service provider deploys the bill verification service, it can select the machine resources provided by the device and preferably use the devices with better machine resources (such as devices with dual-core CPUs, 4G of memory, and 50G of hard disks) as bill verification devices and add them to the bill service system.
[0168] In summary, to ensure the reliability of the bill verification devices added to the bill service system, the bill service provider can pay margin on the blockchain network to ensure that it will not perform abnormal behaviors such as malicious acts. Specifically, the margin can be pledged through the pledge gateway, that is, the pledge gateway locks the margin on the chain. When the bill verification device exits the bill service system, it can also apply for unlocking the margin. After the application is successful, the margin on the chain will also be refunded to the bill service provider corresponding to the bill verification device.
[0169] S502, respond to the verification request and obtain the bill information in the bill request submitted by the object.
[0170] In one implementation, as described above, when the target bill execution device generates a verification request, it can package the bill request and the bill issuance certificate and assemble them into a data packet for the verification request. Since the bill information is included in the bill request, the bill information in the bill request submitted by the object can be obtained from the verification request.
[0171] S503, perform bill verification on the bill issuance certificate based on the bill information, generate a verification result, and send the verification result to the target bill execution device so that the target bill execution device can determine whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0172] As described above, each bill verification device in the bill service system can independently run the bill verification program, and this bill verification program can be responsible for verifying the bill issuance certificate on the chain. After the target bill verification device obtains the verification request, it can call this bill verification program and perform bill verification on the bill issuance certificate based on the bill information, and generate the corresponding verification result.
[0173] Optionally, the specific implementation of invoking the bill verification program to implement bill verification can be as follows: The bill information can be verified for consistency with the bill information in the bill issuance certificate; if the consistency verification is passed, it can be determined that the verification result is that the bill issuance certificate passes the bill verification; if the consistency verification fails, it can be determined that the verification result is that the bill issuance certificate fails the bill verification.
[0174] Among them, the consistency verification can refer to comparing whether the bill information is consistent with the bill information in the bill issuance certificate; if they are consistent, it can be determined that the consistency verification is passed; if they are inconsistent, it can be determined that the consistency verification fails.
[0175] In one implementation manner, after the bill verification device obtains the corresponding verification result, the verification result can be sent to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0176] As described in the previous step S501, the verification request can be directly sent by the target bill execution device to the target bill verification device. In this case, the target bill verification device can directly send the verification result to the target bill execution device. Or, the verification request can also be sent by the target bill execution device to the target bill verification device by invoking the device allocator. In this case, the target bill verification device can send the verification result to the device allocator, so that the device allocator sends the verification result to the target bill execution device.
[0177] In one implementation manner, after the target bill verification device obtains the corresponding verification result, it can directly send the verification result to the target bill execution device. Or, to ensure the security of communication transmission, the target bill verification device can sign the verification result to obtain the signed verification result and send the signed verification result to the target bill execution device.
[0178] In the embodiments of the present application, to save the relevant certificates of bill issuance to the blockchain network and achieve the effect of public transparency and traceability, the bill verification device can be used to verify whether the bill issuance certificate is normal. Only when it passes the verification can the bill issuance certificate be uploaded to the chain, so as to ensure that the bill execution device cannot perform abnormal behaviors such as malicious acts when issuing bills, thereby effectively improving the reliability and security of bill services.
[0179] For the data processing method proposed in this application, the following set Figure 6 For further description, see Figure 6As shown, in this data processing method, a bill service hosting network (decentralized network) and a blockchain network are involved. The bill service hosting network may include multiple bill execution devices, multiple bill verification devices, a device allocator, and a pledge gateway. The following elaborates on data processing from two aspects. One is the execution process of the bill service, that is, the process of issuing a bill. The other is the process of devices (bill execution devices and bill verification devices) joining or leaving the bill service hosting network.
[0180] (1) Execution process of the bill service.
[0181] First, an object can send a bill request to a bill execution device. As mentioned above, the object can perform relevant operations on the bill issuance interface of the bill service platform running on the terminal device, so that the terminal device can generate a bill request based on the information set on the bill issuance interface, and then send the bill request to the bill execution device.
[0182] Among them, the bill request may include: the device identifier of the specified bill execution device, a program request (used to request the bill execution program of the bill execution device, so that the corresponding target bill and bill issuance certificate can be generated using this bill execution program), the number of bill verification devices required before the bill issuance certificate is uploaded to the chain or the list of device identifiers of the specified bill verification devices, the field information indicating whether to use the device allocator (if the number of bill verification devices is specified, the field information is the information indicating the use of the device allocator), the signature of the bill request (facilitating the bill execution device to perform signature verification on the bill request after receiving the signature, ensuring that the bill request received by the bill execution device is not tampered with during transmission), etc.
[0183] Then, after receiving the bill request, the bill execution device can respond to the program request in the bill request and call the bill execution program to generate a target bill and a bill issuance certificate. After processing the bill request using the bill execution program here, the output information (i.e., the execution result) may include: 1. The program request, 2. The invoice issuance certificate, 3. The number of bill verification devices required before the bill issuance certificate is uploaded to the chain or the list of device identifiers of the specified bill verification devices, the field information indicating whether to use the device allocator, 4. The device identifier of the bill execution device, 5. The signature of the bill execution device for the foregoing 1, 2, and 3. The execution result may also include the signature of the subsequent bill verification device for the verification request (or the signature of the data packet), and specific details can be found in the subsequent relevant descriptions.
[0184] Among them, the target bill can be stored locally. The bill execution device can call a bill execution program to construct a bill issuance certification transaction for uploading the invoice issuance certification, so that the invoice issuance certification transaction can be uploaded subsequently, that is, the invoice issuance certification is stored on the blockchain network.
[0185] Before storing the bill issuance certification on the blockchain network, it is necessary to first perform bill verification on the bill issuance certification. Only when the bill execution device determines that the bill issuance certification passes the bill verification can the bill issuance certification be stored on the blockchain network. To implement the bill verification of the bill issuance certification, the bill execution device can generate a verification request for the bill issuance certification and send the verification request to the bill verification device.
[0186] Among them, when the bill execution device generates a verification request for the bill issuance certification, the bill execution device can package the invoice issuance certification transaction, the number of device identities of the bill verification devices required before uploading the bill issuance certification or the list of device identities of the specified bill verification devices, the field information of whether to use a device allocator, the device identity of the bill execution device, and the program request, and assemble them into a data packet for the verification request, so as to implement the verification of the invoice issuance certification based on the verification request. After the verification passes, the invoice issuance certification can be uploaded to the blockchain.
[0187] If the list of device identities of the required bill verification devices is specified in the bill request, the bill verification device can directly send the verification request to the bill verification devices in the list of device identities, so that each bill verification device calls a bill verification program to perform bill verification on the invoice issuance certification. After the verification is completed, the signature of the data packet corresponding to the verification request can be returned to the bill execution device. After the bill execution device collects the signatures of the data packet from sufficient bill verification devices, the bill execution device can assemble the data packet, the signature of the data packet by the bill execution device, and the signature of the data packet by the bill verification program into an upload transaction and send it to the blockchain network for archiving.
[0188] Among them, the situation where the bill execution device collects the signatures of the data packet from sufficient bill verification devices can be understood as the bill execution device determining that the bill issuance certification passes the bill verification as mentioned above. The signature of the data packet here can be understood as the above verification result.
[0189] Among them, the process of the bill verification device calling a bill verification program to perform bill verification on the invoice issuance certification: The bill verification device obtains the bill information in the bill request and verifies whether the bill information matches the invoice issuance certification (that is, performs a consistency check on the bill information and the invoice issuance certification). If they match, it is determined that the verification result is that the invoice issuance certification passes the bill verification; if they do not match, it is determined that the verification result is that the invoice issuance certification fails the bill verification.
[0190] If the number of devices of the required bill verification device is specified in the bill request, the bill execution device needs to check whether to use the field information of the device allocator (the field information is carried in the bill request).
[0191] If the field information indicates not to use the device allocator, the bill execution device can directly randomly select a bill verification device and send a verification request to it, so that each bill verification device can implement the bill verification of the invoice issuance certificate. After the bill verification device completes the verification, it can sign the data packet corresponding to the verification request and return the signature of the data packet to the bill execution device. After the bill execution device collects the signatures of the data packets by enough bill verification devices, the bill execution device can assemble the data packet, the signature of the data packet by the bill execution device, and the signature of the data packet by the bill verification program into an on-chain transaction and send it to the blockchain network for evidence storage.
[0192] If the field information indicates to use the device allocator, the bill execution device can send the verification request to the device allocator. The device allocator selects the bill verification device on behalf of it and forwards the verification request to the selected bill verification device. The bill verification device calls the bill verification program to perform the bill verification on the invoice issuance certificate. After the verification is completed, it can return the signature of the data packet corresponding to the verification request to the device allocator. After the device allocator collects the signatures of the data packets returned by each bill verification device, it can return the signatures of these data packets to the bill execution device. After the bill execution device collects the signatures of the data packets by enough bill verification devices, it can assemble the data packet, the signature of the data packet by the bill execution device, and the signature of the data packet by the bill verification program into an on-chain transaction and send it to the blockchain network for evidence storage.
[0193] Among them, the specific implementation of the above related steps can refer to the description in the above embodiments and will not be elaborated here.
[0194] As can be seen from the above description, in the embodiments of the present application, the full-link decentralization of the bill service system can be achieved. An object can arbitrarily select one or more bill service providers in this decentralized service network to issue bills, realizing the decentralization of bill services and improving the scalability, stability, and transparency of the services. Moreover, the devices in the decentralized service network can be divided into bill execution devices and bill verification devices. The bill execution devices are responsible for providing bill services externally, and the relevant certificates for bill issuance will be saved to the blockchain network, which is publicly transparent and verifiable. The bill verification devices verify whether the relevant certificates on the chain are normal, ensuring that the bill execution devices cannot perform abnormal behaviors such as malicious acts, and improving the reliability and security of bill services. In addition, all bill service providers in the decentralized service network jointly bear the pressure of the entire bill service system, and each bill service provider can provide services externally according to its own resource conditions, effectively reducing the deployment cost and operation and maintenance cost. Generally speaking, compared with the traditional centralized bill service system, the embodiments of the present application introduce the deposit of bill issuance certificates on the blockchain network, which can effectively improve the security of bill services; compared with the traditional blockchain-based bill services, the embodiments of the present application can provide a decentralized off-chain business system, which can improve the user experience while having sufficient decentralization guarantees.
[0195] (2) Process for a device to join or exit the bill service hosting network.
[0196] If a device (bill execution device or bill verification device) maintained by a bill service provider wants to join the bill service hosting network as a node, the device needs to pledge corresponding pledge resources through the pledge gateway to lock the pledge resources on the blockchain network.
[0197] If a device (bill execution device or bill verification device) maintained by a bill service provider wants to exit the bill service hosting network, the device can apply to the pledge gateway to unlock the pledge resources. After a certain period of challenge period, the bill service provider can retrieve the pledge resources.
[0198] Among them, the specific implementation of the above relevant steps can refer to the description in the above embodiments and will not be elaborated here.
[0199] As can be seen from the above description, in the embodiments of the present application, the bill service providers in the decentralized service network can pay corresponding pledge resources on the blockchain network to ensure that no abnormal behaviors such as malicious acts occur when issuing or verifying bills, effectively ensuring the reliability and security of bill issuance.
[0200] Please refer to Figure 7, which is a schematic structural diagram of a data processing device provided by an embodiment of the present application. Optionally, the data processing device can be configured in a target bill execution device, and the target bill execution device can be deployed in a bill service system. The bill service system includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the target bill execution device is one of the multiple bill execution devices. Among them, the data processing device based on the blockchain network described in this embodiment includes:
[0201] An obtaining unit 701, configured to obtain a bill request submitted by an object; the target bill execution device is one of the multiple bill execution devices, and the bill request carries bill information required for generating a bill.
[0202] A processing unit 702, configured to respond to the bill request and generate a target bill and a bill issuance certificate of the target bill based on the bill information, and generate a verification request for verifying the bill issuance certificate, where the verification request carries the bill issuance certificate.
[0203] A sending unit 703, configured to send the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate; the target bill verification device is at least one of the multiple bill verification devices.
[0204] The processing unit 702 is further configured to receive a verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, the bill issuance certificate is stored on the blockchain network.
[0205] In an implementation manner, the number of the target bill verification devices is multiple, and the verification result of each target bill verification device for verifying the bill issuance certificate includes: the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification, or the corresponding target bill verification device determines that the bill issuance certificate does not pass the bill verification; the processing unit 702 is further configured to:
[0206] Count a first number of target verification results and a second number of the target bill verification devices; the target verification result includes a verification result for indicating that the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification.
[0207] If the ratio between the first quantity and the second quantity is greater than or equal to a preset ratio, it is determined that the bill issuance certificate passes the bill verification;
[0208] If the ratio between the first quantity and the second quantity is less than the preset ratio, it is determined that the bill issuance certificate fails the bill verification.
[0209] In one implementation, the bill service system further includes a device allocator for device selection; the bill request further carries field information indicating whether to use the device allocator, and the number of devices of the verification device for bill verification of the bill issuance certificate; the sending unit 703 is specifically configured to:
[0210] If it is determined that the field information indicates to use the device allocator, the verification request is sent to the device allocator, so that the device allocator selects a target bill verification device with a quantity of the number of devices from the multiple bill verification devices, and sends the verification request to the target bill verification device;
[0211] The processing unit 702 is specifically configured to:
[0212] Receive the verification result returned by the device allocator, and the verification result on the device allocator is returned by the target bill verification device.
[0213] In one implementation, the bill service system further includes a device allocator for device selection; the bill request further carries field information indicating whether to use the device allocator, and the number of devices of the verification device for bill verification of the bill issuance certificate; the sending unit 703 is specifically configured to:
[0214] If it is determined that the field information indicates not to use the device allocator, select a target bill verification device with a quantity of the number of devices from the multiple bill verification devices, and send the verification request to the target bill verification device.
[0215] In one implementation, the bill request further carries the device identifier of the bill verification device for bill verification of the bill issuance certificate; the sending unit 703 is specifically configured to:
[0216] Send the verification request to the target bill verification device indicated by the device identifier.
[0217] In one implementation, the bill service system further includes a pledge gateway for providing resource pledge services; the processing unit 702 is further configured to:
[0218] Send a first resource processing event to the pledge gateway to enable the pledge gateway to respond to the first resource processing event; the first resource processing event is used to indicate that the target bill execution device applies to join the decentralized network and locks the first pledge resource submitted by the target bill execution device in the blockchain network.
[0219] After detecting that the locking of the first pledge resource is successfully completed, execute the step of obtaining the bill request submitted by the object.
[0220] In one implementation, the processing unit 702 is further configured to:
[0221] Send a second resource processing event to the pledge gateway to enable the pledge gateway to respond to the second resource processing event; the second resource processing event is used to indicate that the target bill execution device applies to exit the decentralized network and unlocks the first pledge resource submitted by the target bill execution device in the blockchain network.
[0222] Determine the bill generation situation of the target bill execution device within the first challenge period through the pledge gateway.
[0223] If it is determined that the target bill execution device has successfully challenged based on the bill generation situation, the target bill execution device returns the first pledge resource to the account corresponding to the target bill execution device through the pledge gateway.
[0224] If it is determined that the target bill execution device has failed the challenge based on the bill generation situation, it is prohibited to return the first pledge resource to the account corresponding to the target bill execution device through the pledge gateway.
[0225] It can be understood that the division of units in the embodiments of the present application is illustrative, merely a logical function division, and there may be other division methods in actual implementation. Each functional unit in the embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0226] Please refer to Figure 8, which is a schematic structural diagram of another data processing device based on a blockchain network provided by an embodiment of the present application. Optionally, the data processing device can be configured in a target bill verification device, and the target bill verification device can be deployed in a bill service system. The bill service system includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the target bill verification device is at least one of the multiple bill verification devices. Among them, the data processing device based on the blockchain network described in this embodiment includes:
[0227] An acquisition unit 801, configured to acquire a verification request sent by a target bill execution device; the target bill execution device is one of the multiple bill execution devices; the verification request carries a bill issuance certificate of a target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object;
[0228] The acquisition unit 801 is further configured to respond to the verification request and acquire the bill information in the bill request submitted by the object;
[0229] A processing unit 802 is further configured to perform bill verification on the bill issuance certificate based on the bill information, generate a verification result, and send the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0230] In one implementation manner, the processing unit 802 is specifically configured to:
[0231] Perform a consistency check on the bill information and the bill information in the bill issuance certificate;
[0232] If the consistency check is passed, it is determined that the verification result is that the bill issuance certificate passes the bill verification;
[0233] If the consistency check fails, it is determined that the verification result is that the bill issuance certificate fails the bill verification.
[0234] In one implementation manner, the bill service system further includes a pledge gateway for providing resource pledge services; the processing unit 802 is further configured to:
[0235] Send a third resource processing event to the pledge gateway to enable the pledge gateway to respond to the third resource processing event; the third resource processing event is used to indicate that the target ticket verification device applies to join the decentralized network and locks the second pledge resource submitted by the target ticket verification device in the blockchain network;
[0236] After detecting that the locking of the second pledge resource is successfully completed, allow the step of obtaining the verification request sent by the target ticket execution device to be executed.
[0237] In one implementation, the processing unit 802 is further configured to:
[0238] Send a fourth resource processing event to the pledge gateway to enable the pledge gateway to respond to the fourth resource processing event; the fourth resource processing event is used to indicate that the target ticket verification device applies to exit the decentralized network and unlocks the second pledge resource submitted by the target ticket verification device in the blockchain network;
[0239] Determine the ticket verification situation of the target ticket verification device within the second challenge period through the pledge gateway;
[0240] If the target ticket verification device determines that the target ticket verification device has successfully challenged based on the ticket verification situation, return the second pledge resource to the account corresponding to the target ticket verification device through the pledge gateway;
[0241] If the target ticket verification device determines that the target ticket verification device has failed the challenge based on the ticket verification situation, prohibit the pledge gateway from returning the second pledge resource to the account corresponding to the target ticket verification device.
[0242] It can be understood that the division of units in the embodiments of the present application is illustrative, only a logical function division, and there may be other division methods in actual implementation. The functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0243] Please refer to Figure 9 , Figure 9 which is a schematic structural diagram of a computer device provided by an embodiment of the present application. As Figure 9As shown in the figure, the computer device includes: at least one processor 901 and a memory 902. Optionally, the computer device may further include a network interface 903. Among them, data can be exchanged between the processor 901, the memory 902, and the network interface 903. The network interface 903 is controlled by the processor 901 to send and receive messages. The memory 902 is used to store a computer program, and the computer program includes program instructions. The processor 901 is used to execute the program instructions stored in the memory 902. Among them, the processor 901 is configured to call the program instructions to execute the above method.
[0244] Among them, the memory 902 may include a volatile memory, such as a random-access memory (RAM); the memory 902 may also include a non-volatile memory, such as a flash memory, a solid-state drive (SSD), etc.; the memory 902 may further include a combination of two or more types of the above memories.
[0245] Among them, the processor 901 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In one embodiment, the processor 901 may also be a graphics processing unit (GPU). The processor 901 may also be a combination of a CPU and a GPU.
[0246] In a possible implementation manner, the memory 902 is used to store program instructions, and the processor 901 may call the program instructions.
[0247] Optionally, in some embodiments, the computer device may be a target bill execution device, or may execute some or all of the steps executed by the target bill execution device. The target bill execution device may be deployed in a bill service system, which includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the target bill execution device is one of the multiple bill execution devices.
[0248] For example, when the processor 901 calls the program instructions, it is used to execute:
[0249] Obtain a bill request submitted by an object; the bill request carries bill information required for generating a bill;
[0250] Respond to the bill request and generate a target bill and a bill issuance certificate for the target bill based on the bill information, and generate a verification request for verifying the bill issuance certificate, where the verification request carries the bill issuance certificate;
[0251] Send the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate; the target bill verification device is at least one of the multiple bill verification devices;
[0252] Receive the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, store the bill issuance certificate on the blockchain network.
[0253] In one implementation, the number of the target bill verification devices is multiple. The verification result of each target bill verification device for verifying the bill issuance certificate includes: the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification, or the corresponding target bill verification device determines that the bill issuance certificate does not pass the bill verification; the processor 901 is further used for:
[0254] Count the first quantity of the target verification results and the second quantity of the target bill verification devices; the target verification results include verification results used to indicate that the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification;
[0255] If the ratio between the first quantity and the second quantity is greater than or equal to a preset ratio, determine that the bill issuance certificate passes the bill verification;
[0256] If the ratio between the first quantity and the second quantity is less than a preset ratio, it is determined that the bill issuance certificate fails the bill verification.
[0257] In one implementation, the bill service system further includes a device allocator for device selection; the bill request also carries field information indicating whether to use the device allocator, and the number of devices of the verification device for bill verification of the bill issuance certificate; the processor 901 is specifically configured to:
[0258] If it is determined that the field information indicates to use the device allocator, the target bill execution device sends the verification request to the device allocator, so that the device allocator selects target bill verification devices with the number of devices from the multiple bill verification devices, and sends the verification request to the target bill verification devices;
[0259] Receive the verification result returned by the device allocator, and the verification result on the device allocator is returned by the target bill verification device.
[0260] In one implementation, the bill service system further includes a device allocator for device selection; the bill request also carries field information indicating whether to use the device allocator, and the number of devices of the verification device for bill verification of the bill issuance certificate; the processor 901 is specifically configured to:
[0261] If it is determined that the field information indicates not to use the device allocator, the target bill execution device selects target bill verification devices with the number of devices from the multiple bill verification devices, and sends the verification request to the target bill verification devices.
[0262] In one implementation, the bill request also carries the device identifier of the bill verification device for bill verification of the bill issuance certificate; the processor 901 is specifically configured to:
[0263] Send the verification request to the target bill verification device indicated by the device identifier.
[0264] In one implementation, the bill service system further includes a pledge gateway for providing resource pledge services; the processor 901 is further configured to:
[0265] Send a first resource processing event to the pledge gateway, so that the pledge gateway responds to the first resource processing event; the first resource processing event is used to indicate that the target bill execution device applies to join the decentralized network and locks the first pledge resource submitted by the target bill execution device in the blockchain network;
[0266] After detecting the successful completion of the locking of the first pledged resource, perform the step of obtaining the bill request submitted by the object.
[0267] In one implementation, the processor 901 is further configured to:
[0268] Send a second resource processing event to the pledge gateway to cause the pledge gateway to respond to the second resource processing event; the second resource processing event is used to indicate that the target bill execution device applies to exit the decentralized network and unlocks the first pledged resource submitted by the target bill execution device in the blockchain network;
[0269] Determine the bill generation situation of the bill execution device within the first challenge period through the pledge gateway;
[0270] If it is determined that the target bill execution device has successfully challenged based on the bill generation situation, the target bill execution device returns the first pledged resource to the account corresponding to the target bill execution device through the pledge gateway;
[0271] If it is determined that the target bill execution device has failed the challenge based on the bill generation situation, the target bill execution device is prohibited from returning the first pledged resource to the account corresponding to the target bill execution device through the pledge gateway.
[0272] Optionally, in some embodiments, the computer device may be a target bill verification device, or may execute some or all of the steps executed by the target bill verification device. The target bill verification device may be deployed in a bill service system, which includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the target bill verification device is at least one of the multiple bill verification devices. For example, when the processor 901 invokes the program instructions, it is configured to:
[0273] Obtain a verification request sent by a target bill execution device; the target bill execution device is one of the multiple bill execution devices; the verification request carries a bill issuance certificate of the target bill, and the target bill is generated by the target bill execution device in response to the bill request submitted by the object;
[0274] Respond to the verification request and obtain the bill information in the bill request submitted by the object;
[0275] Perform bill verification on the bill issuance certificate based on the bill information, generate a verification result, and send the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
[0276] In one implementation, the processor 901 is specifically configured to:
[0277] Perform consistency check on the bill information in the bill issuance certificate;
[0278] If the consistency check is passed, determine that the verification result is that the bill issuance certificate passes the bill verification;
[0279] If the consistency check fails, determine that the verification result is that the bill issuance certificate fails the bill verification.
[0280] In one implementation, the bill service system further includes a pledge gateway for providing resource pledge services; the processor 901 is further configured to:
[0281] Send a third resource processing event to the pledge gateway to make the pledge gateway respond to the third resource processing event; the third resource processing event is used to indicate that the target bill verification device applies to join the decentralized network and locks the second pledge resources submitted by the target bill verification device in the blockchain network;
[0282] After detecting the successful locking of the second pledge resources, allow the step of executing the verification request sent by the target bill execution device.
[0283] In one implementation, the processor 901 is further configured to:
[0284] Send a fourth resource processing event to the pledge gateway to make the pledge gateway respond to the fourth resource processing event; the fourth resource processing event is used to indicate that the target bill verification device applies to withdraw from the decentralized network and unlocks the second pledge resources submitted by the target bill verification device in the blockchain network;
[0285] Determine the bill verification situation of the target bill verification device during the second challenge period through the pledge gateway;
[0286] If it is determined that the target bill verification device has successfully challenged based on the bill verification situation, return the second pledge resources to the account corresponding to the target bill verification device through the pledge gateway;
[0287] If it is determined that the challenge of the target bill verification device fails based on the bill verification situation, the return of the second pledged resource to the account corresponding to the target bill verification device through the pledge gateway is prohibited.
[0288] In specific implementation, the above-described devices, processors, memories, etc. can execute the implementation manners described in the above method embodiments, and can also execute the implementation manners described in the embodiments of the present application, which will not be elaborated herein.
[0289] In the embodiments of the present application, a computer (readable) storage medium is further provided. The computer storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by a processor, the processor can execute some or all of the steps executed in the above method embodiments. Optionally, the computer storage medium can be volatile or non-volatile. The computer-readable storage medium mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of blockchain nodes, etc.
[0290] The embodiments of the present application further provide a computer program product. The computer program product includes program instructions, and when the program instructions are executed by a processor, some or all of the steps in the above resource processing method based on a blockchain network can be implemented. Optionally, the program instructions can be stored in a computer-readable storage medium. A processor of a computer device, such as a computer device, reads the program instructions from the computer-readable storage medium, and the processor executes the program instructions, so that the computer device executes the above-provided resource processing method based on a blockchain network.
[0291] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraint conditions of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but this implementation should not be considered to exceed the scope of the present application.
[0292] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more program instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The program instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium.
[0293] The program instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a Solid State Disk (SSD)), etc.
[0294] As described above, the above are only the specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data processing method based on a blockchain network, characterized in that, The method is applied to a bill service system, which includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the method includes: The target bill execution device obtains a bill request submitted by an object; the target bill execution device is one of the multiple bill execution devices, and the bill request carries bill information required for generating a bill; the target bill execution device responds to the bill request and generates a target bill and a bill issuance certificate for the target bill based on the bill information, and generates a verification request for verifying the bill issuance certificate, and the verification request carries the bill issuance certificate; The target bill execution device sends the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate; the target bill verification device is at least one of the multiple bill verification devices; The target bill execution device receives the verification result of the target bill verification device. If it is determined based on the verification result that the bill issuance certificate passes the bill verification, the bill issuance certificate is stored on the blockchain network.
2. The method according to claim 1, wherein The number of the target bill verification devices is multiple. The verification result of each target bill verification device for verifying the bill issuance certificate includes: the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification, or the corresponding target bill verification device determines that the bill issuance certificate fails to pass the bill verification; it further includes: The target bill execution device counts the first number of target verification results and the second number of the target bill verification devices; the target verification result includes a verification result for indicating that the corresponding target bill verification device determines that the bill issuance certificate passes the bill verification; If the ratio between the first number and the second number is greater than or equal to a preset ratio, the target bill execution device determines that the bill issuance certificate passes the bill verification; If the ratio between the first number and the second number is less than the preset ratio, the target bill execution device determines that the bill issuance certificate fails to pass the bill verification.
3. The method according to claim 1, wherein The bill service system further includes a device allocator for device selection; the bill request further carries field information on whether to use the device allocator and the number of devices of the verification device for verifying the bill issuance certificate; The target bill execution device sending the verification request to the target bill verification device includes: If the target bill execution device determines that the field information indicates using the device allocator, the target bill execution device sends the verification request to the device allocator, so that the device allocator selects target bill verification devices with the number of device quantity from the multiple bill verification devices and sends the verification request to the target bill verification devices; Among them, the target bill execution device receiving the verification result of the target bill verification device includes: The target bill execution device receives the verification result returned by the device allocator, and the verification result on the device allocator is returned by the target bill verification device.
4. The method according to claim 1, wherein The bill service system further includes a device allocator for device selection; the bill request further carries field information indicating whether to use the device allocator, and the number of devices of the verification device for verifying the bill issuance certificate. The target bill execution device sending the verification request to the target bill verification device includes: If the target bill execution device determines that the field information indicates not to use the device allocator, the target bill execution device selects a target bill verification device with a quantity equal to the number of devices from the multiple bill verification devices, and sends the verification request to the target bill verification device.
5. The method according to claim 1, characterized in that, The bill request further carries the device identifier of the bill verification device for verifying the bill issuance certificate; the target bill execution device sending the verification request to the target bill verification device includes: The target bill execution device sends the verification request to the target bill verification device indicated by the device identifier.
6. The method according to claim 1, wherein The bill service system further includes a pledge gateway for providing resource pledge services. Before the target bill execution device obtains the bill request submitted by the object, the method further includes: The target bill execution device sends a first resource processing event to the pledge gateway to enable the pledge gateway to respond to the first resource processing event; the first resource processing event is used to indicate that the target bill execution device applies to join the decentralized network and locks the first pledge resource submitted by the target bill execution device in the blockchain network. After detecting the successful locking of the first pledge resource, the target bill execution device executes the step of obtaining the bill request submitted by the object.
7. The method according to claim 6, characterized in that, The method further includes: The target bill execution device sends a second resource processing event to the pledge gateway to enable the pledge gateway to respond to the second resource processing event; the second resource processing event is used to indicate that the target bill execution device applies to withdraw from the decentralized network and unlocks the first pledge resource submitted by the target bill execution device in the blockchain network. The target bill execution device determines the bill generation situation of the target bill execution device within the first challenge period through the pledge gateway. If the target bill execution device determines that the target bill execution device has succeeded in the challenge based on the bill generation situation, the target bill execution device returns the first pledge resource to the account corresponding to the target bill execution device through the pledge gateway. If the target bill execution device determines that the target bill execution device has failed in the challenge based on the bill generation situation, the target bill execution device prohibits the pledge gateway from returning the first pledge resource to the account corresponding to the target bill execution device.
8. A data processing method based on a blockchain network, characterized in that, The method is applied to a bill service system, which includes a decentralized network and a blockchain network. The decentralized network includes a bill execution network and a bill verification network. The bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; the method includes: A target bill verification device obtains a verification request sent by a target bill execution device; the target bill verification device is at least one of the multiple bill verification devices, and the target bill execution device is one of the multiple bill execution devices; the verification request carries a bill issuance certificate of a target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object. The target bill verification device responds to the verification request and obtains the bill information in the bill request submitted by the object. The target bill verification device performs bill verification on the bill issuance certificate based on the bill information, generates a verification result, and sends the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
9. The method according to claim 8, wherein The target bill verification device performs bill verification on the bill issuance certificate based on the bill information, generates a verification result, including: The target bill verification device performs a consistency check on the bill information and the bill information in the bill issuance certificate. If the consistency check is passed, the target bill verification device determines that the verification result is that the bill issuance certificate passes the bill verification. If the consistency check fails, the target bill verification device determines that the verification result is that the bill issuance certificate fails the bill verification.
10. The method according to claim 8, characterized in that The bill service system further includes a pledge gateway for providing resource pledge services. Before the target bill verification device obtains the verification request sent by the bill execution device, the method further includes: The target bill verification device sends a third resource processing event to the pledge gateway, so that the pledge gateway responds to the third resource processing event; the third resource processing event is used to indicate that the target bill verification device applies to join the decentralized network and locks the second pledge resource submitted by the target bill verification device in the blockchain network. After detecting the successful locking of the second pledge resource, the target bill verification device allows the step of obtaining the verification request sent by the target bill execution device to be executed.
11. The method according to claim 10, wherein The method further includes: The target bill verification device sends a fourth resource processing event to the pledge gateway, so that the pledge gateway responds to the fourth resource processing event; the fourth resource processing event is used to indicate that the target bill verification device applies to exit the decentralized network and unlocks the second pledge resource submitted by the target bill verification device in the blockchain network. The target bill verification device determines the bill verification situation of the target bill verification device within a second challenge period through the pledge gateway. If the target bill verification device determines that the target bill verification device has succeeded in the challenge based on the bill verification situation, the target bill verification device returns the second pledged resource to the account corresponding to the target bill verification device through the pledge gateway; If the target bill verification device determines that the target bill verification device has failed in the challenge based on the bill verification situation, the target bill verification device prohibits the return of the second pledged resource to the account corresponding to the target bill verification device through the pledge gateway.
12. A data processing device based on a blockchain network, characterized in that, The data processing device is configured in a target bill execution device, the target bill execution device is deployed in a bill service system, the bill service system includes a decentralized network and a blockchain network, the decentralized network includes a bill execution network and a bill verification network, the bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; The target bill execution device is one of the multiple bill execution devices; The device includes: An acquisition unit, configured to acquire a bill request submitted by an object; The bill request carries bill information required for generating a bill; A processing unit, configured to respond to the bill request, generate a target bill and a bill issuance certificate for the target bill based on the bill information, and generate a verification request for verifying the bill issuance certificate, the verification request carrying the bill issuance certificate; A sending unit, configured to send the verification request to a target bill verification device, so that the target bill verification device responds to the verification request and verifies the bill issuance certificate; The target bill verification device is at least one of the multiple bill verification devices; The processing unit is further configured to receive the verification result of the target bill verification device, and if it is determined based on the verification result that the bill issuance certificate passes the bill verification, store the bill issuance certificate on the blockchain network.
13. A data processing device based on a blockchain network, characterized in that, The data processing device is configured in a target bill verification device, the target bill verification device is deployed in a bill service system, the bill service system includes a decentralized network and a blockchain network, the decentralized network includes a bill execution network and a bill verification network, the bill execution network includes multiple bill execution devices for providing bill issuance services, and the bill verification network includes multiple bill verification devices for providing bill verification services; The target verification execution device is at least one of the multiple bill execution devices; The device includes: An acquisition unit, configured to acquire a verification request sent by a target bill execution device; The target bill execution device is one of the multiple bill execution devices; The verification request carries a bill issuance certificate of a target bill, and the target bill is generated by the target bill execution device in response to a bill request submitted by an object; The acquisition unit is further configured to respond to the verification request and acquire the bill information in the bill request submitted by the object; The processing unit is further configured to perform bill verification on the bill issuance certificate based on the bill information, generate a verification result, and send the verification result to the target bill execution device, so that the target bill execution device determines whether to store the bill issuance certificate on the blockchain network based on the verification result.
14. A computer device, characterized in that, It includes a processor and a memory. Among them, the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1-11.
15. A computer-readable storage medium, characterized in that, Program instructions are stored in the computer-readable storage medium, and when the program instructions are executed, they are used to implement the method according to any one of claims 1-11.