A data processing method, device and storage medium based on blockchain network

By using blockchain network and smart contract technology in tax calculation machines, automatic allocation and broadcast invoice number segments are solved, the high invoice cost and low convenience caused by tax calculation machine failures are solved, and convenient and low Cost invoicing process.

CN110599275BActive Publication Date: 2024-12-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910932366.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-27
Publication Date
2024-12-17
Estimated Expiration
2039-09-27

AI Technical Summary

Technical Problem

In the prior art, invoices cannot be issued when the tax calculation machine fails, resulting in high cost and low convenience for enterprises to issue invoices, and lack of convenient and low-cost alternative solutions.

Method used

Using a data processing method based on blockchain network, the invoice number segment is allocated through smart contracts and broadcasts between multiple nodes to realize automated invoice issuance and reduce the cost of corporate invoice issuance.

Benefits of technology

The convenient invoice issuance process is achieved through blockchain technology, which reduces the invoice cost of enterprises, improves the convenience and efficiency of invoice issuance, and avoids the chaos in the allocation of invoice number segments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110599275B_ABST
    Figure CN110599275B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a data processing method, device and storage medium based on a blockchain network, wherein the blockchain network includes multiple nodes, and the data processing method based on the blockchain network includes: the node receives an invoicing request submitted by a client running on a user terminal, responds to the invoicing request by calling a smart contract to allocate an invoice number segment, and broadcasts the allocated invoice number segment to other nodes in the multiple nodes in the blockchain, and after the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the node issues an invoice according to the allocated invoice number segment, and transmits the issued invoice back to the client on the user terminal. By adopting such a data processing method based on a blockchain network, invoicing can be conveniently performed through blockchain technology, thereby reducing the invoicing cost of business operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device and storage medium based on a blockchain network. Background Art

[0002] The tax counting and cash register is a cash register with a tax counting function that is legally serious and indestructible. It is not only a powerful assistant for business management, but also a law enforcement representative for tax personnel to collect sales data in stores. Enterprises need to purchase tax counting and cash registers to issue invoices, which increases the business invoicing costs of enterprises. Moreover, if the tax counting and cash register fails, it will not be able to issue invoices, and the invoicing convenience is low. It can be seen that how to provide a convenient and low-cost invoicing method to replace tax control equipment has become an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present invention provide a data processing method, device and storage medium based on a blockchain network, which can quickly issue invoices through blockchain technology and reduce the invoicing costs of business operations.

[0004] In a first aspect, an embodiment of the present invention provides a data processing method based on a blockchain network, wherein the blockchain network includes multiple nodes, and the method includes:

[0005] A node receives a ticketing request submitted by a client running on a user terminal, and the node is any one of the multiple nodes;

[0006] The node allocates an invoice number segment in response to the invoicing request by calling a smart contract, and broadcasts the allocated invoice number segment to other nodes among the multiple nodes, wherein the smart contract runs on a virtual machine of any one of the nodes;

[0007] After the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment, the node issues an invoice according to the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal.

[0008] In a second aspect, an embodiment of the present invention provides a data processing device based on a blockchain network, and the data processing device based on a blockchain network includes:

[0009] An acquisition unit, used for receiving a ticketing request submitted by a client running on a user terminal;

[0010] A number segment allocation unit, configured to allocate an invoice number segment in response to the invoicing request by calling a smart contract, and broadcast the allocated invoice number segment to other nodes among the multiple nodes;

[0011] An invoicing unit, configured to issue an invoice according to the allocated invoice number segment after the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment;

[0012] The output unit is used to transmit the issued invoice back to the client on the user terminal.

[0013] In a third aspect, an embodiment of the present invention provides a terminal device, the terminal device comprising an input device and an output device, the terminal device further comprising a processor adapted to implement one or more instructions; and

[0014] A computer storage medium, wherein the computer storage medium stores one or more instructions, wherein the one or more instructions are suitable for being loaded by the processor and executing the data processing method based on the blockchain network described in the first aspect above.

[0015] In a fourth aspect, an embodiment of the present invention provides a computer storage medium, wherein instructions are stored in the computer storage medium, and when the computer storage medium is run on a computer, the computer executes the data processing method based on the blockchain network described in the first aspect above.

[0016] In the embodiment of the present application, the blockchain network node receives the invoicing request submitted by the client running on the user terminal, and responds to the invoicing request by calling the smart contract to allocate the invoice number segment, and broadcasts the allocated invoice number segment to other nodes in the multiple nodes of the blockchain. Furthermore, after the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the blockchain network node issues an invoice according to the allocated invoice number segment, and transmits the issued invoice back to the client on the user terminal. By adopting such a data processing method based on the blockchain network, invoicing can be conveniently issued through blockchain technology, reducing the invoicing cost of business operations. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1a is a schematic diagram of the architecture of a data processing system provided by an embodiment of the present invention;

[0019] Figure 1b It is a schematic diagram of the structure of a blockchain provided by an embodiment of the present invention;

[0020] Figure 1c is a schematic diagram of a process of generating a new block provided by an embodiment of the present invention;

[0021] Figure 2 It is a flowchart of a data processing method based on a blockchain network provided by an embodiment of the present invention;

[0022] Figure 3a is a schematic diagram of an invoice provided by an embodiment of the present invention;

[0023] Figure 3b This is a client login interface diagram provided by an embodiment of the present invention;

[0024] Figure 4 It is a flowchart of another data processing method based on a blockchain network provided by an embodiment of the present invention;

[0025] Figure 5 It is a flowchart of another data processing method based on a blockchain network provided by an embodiment of the present invention;

[0026] Figure 6 It is a structural schematic diagram of a data processing device based on a blockchain network provided by an embodiment of the present invention;

[0027] Figure 7 It is a structural diagram of a terminal device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0029] In response to the current problems of high invoicing costs and low invoicing convenience, an embodiment of the present invention provides a data processing method based on a blockchain network, which can facilitate invoicing through blockchain technology and reduce the invoicing costs of business operations.

[0030] See also Figure 1a , is a schematic diagram of the architecture of a data processing system provided by an embodiment of the present invention, the data processing system includes a blockchain network 10, a user terminal 102 and a tax bureau terminal 103, wherein:

[0031] The blockchain network 10 refers to a network for data sharing between nodes, and the blockchain network may include multiple nodes 101. Each node 101 can receive input information when performing normal work, and maintain the shared data (i.e., blockchain) in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there can be an information connection between each node, and peer-to-peer (P2P) communication can be achieved between any two nodes, and P2P communication can be performed specifically through a wired communication link or a wireless communication link. 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 are consistent.

[0032] The user terminal 102 and the tax bureau terminal 103 can access the blockchain network and communicate with nodes in the blockchain network, for example, submit an invoice request to a node, receive an invoice issued by a node, etc. The user terminal 102 and the tax bureau terminal 103 can be specifically a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted smart terminal, etc., which is not limited in the embodiment of the present invention.

[0033] It should be noted that Figure 1a The number of nodes shown is only indicative. Any number of nodes can be deployed according to actual needs. The user terminal 102 and the tax bureau terminal 103 can communicate with the same node in the blockchain network, or communicate with different nodes in the blockchain network respectively.

[0034] Among them, for each node in the blockchain network, there is a node identifier corresponding to it, and each node in the blockchain network can store the node identifiers of other nodes in the blockchain network, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. Each node can maintain a node identifier list as shown in the following table, and the node name and node identifier are stored in the node identifier list accordingly. Among them, the node identifier can be an Internet Protocol (IP) address and any other information that can be used to identify the node. The table only uses the IP address as an example for illustration.

[0035]

[0036]

[0037] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 1bThe blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores the input information characteristic value, version number, timestamp and difficulty value, and the block body stores the input information; the next block of the genesis block takes the genesis block as the parent block, and the next block also includes a block header and a block body. The block header stores the input information characteristic value of the current block, the block header characteristic value, version number, timestamp and difficulty value of the parent block, and so on, so that 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.

[0038] 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, the input information is stored in the memory pool and the hash tree used to record the input information is updated. After that, the update timestamp is updated to the time when the input information is received, and different random numbers are tried to calculate the eigenvalue multiple times so that the calculated eigenvalue can satisfy the following formula:

[0039] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET

[0040] 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 of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the eigenvalue threshold, which can be determined based on nbits.

[0041] In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, and the current block can be obtained. Subsequently, the node where the blockchain is located sends the newly generated block to other nodes in the blockchain network according to the node identification of other nodes in the blockchain network. Other nodes verify the newly generated block and add the newly generated block to the blockchain stored in them after the verification is completed.

[0042] Among them, smart contracts can be run on the nodes of the blockchain network. Smart contracts are code implementations that are executed when certain conditions are met. Developers can define the contract logic through programming languages ​​and publish it to the blockchain (smart contract registration). According to the logic of the contract terms, they call keys or other events to trigger execution and complete the contract logic. At the same time, it also provides the function of upgrading and canceling smart contracts.

[0043] In some feasible implementations, a node 101 of the blockchain network can receive an invoicing request submitted by a user through a client running on a user terminal device 102, allocate an invoice number segment in response to the invoicing request by calling a smart contract, and broadcast the allocated invoice number segment to other nodes in the multiple nodes. Furthermore, after the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment, node 101 issues an invoice based on the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal. By adopting such a data processing method based on a blockchain network, invoicing can be conveniently issued through blockchain technology, reducing the invoicing costs of business operations.

[0044] The implementation details of the technical solution of the embodiment of the present invention are described in detail below:

[0045] See also Figure 2 , is an embodiment of the present invention based on Figure 1a The data processing system shown is a flow chart of a data processing method based on a blockchain network. The data processing method based on a blockchain network in an embodiment of the present invention is described from the node side. The blockchain network includes multiple nodes. The data processing method based on the blockchain network includes the following steps:

[0046] S201: A node receives a billing request submitted by a client running on a user terminal.

[0047] The node is any one of the above multiple nodes. The above invoice request carries transaction information, and the transaction information includes one or more of the information of the issuer, the information of the recipient, the transaction amount and the transaction content.

[0048] S202: The node responds to the invoicing request by calling a smart contract to allocate an invoice number segment, and broadcasts the allocated invoice number segment to other nodes in the blockchain network, wherein the smart contract runs on a virtual machine of any of the above nodes.

[0049] In one embodiment, the invoicing request also carries a first digital certificate assigned by the tax bureau server. Before the blockchain network node responds to the invoicing request and allocates a number segment by calling a smart contract, it can also verify whether the first digital certificate is legal. If the first digital certificate is legal, the node executes the step of responding to the invoicing request and allocating an invoice number segment by calling a smart contract.

[0050] If the first digital certificate is illegal, an error user information prompt is output to the client running on the user terminal, and the invoicing request is rejected by calling the smart contract to allocate a number segment.

[0051] The first digital certificate is used to uniquely identify the invoice issuer. The user can specifically refer to a corporate user. The user can submit a request to register corporate information on the tax bureau server to become a legal invoice issuer. The corporate information includes the company name, corporate taxpayer identification number, detailed corporate address, contact information, bank and account number. The tax bureau server verifies the authenticity of the corporate information. After the verification is passed, the first digital certificate is issued to the user to make the user a legal invoice issuer, and the first digital certificate and the above corporate information are written into the tax bureau server registry.

[0052] In one embodiment, if the registered enterprise information changes, the user can submit a registration table change request to the tax bureau server. The tax bureau server responds to the registration table change request, accepts the changed registered enterprise information, and writes the changed enterprise registration information into the registration table to replace the original registered enterprise information.

[0053] For example, Company A submits its registered company information to the tax bureau server and requests to become a legal invoice issuer. The registered company information is shown in the following table:

[0054] Company Name A Limited Liability Company Corporate Taxpayer Identification Number 123456789123456 Company detailed address 19-12, XX Building, XX Road, XX District, XX City, XX Province Bank and account number Bank of China XX Branch 6021344556XXX Contact Details 139XXXXXXXXX

[0055] The tax bureau server verifies the authenticity of the above enterprise information. After the verification is passed, the first digital certificate, for example, 00001, is issued to the user, and the first digital certificate and the above enterprise information are written into the tax bureau server registry. The first digital certificate 00001 is uniquely corresponding to the above enterprise information in the tax bureau server registry. As shown in the following table:

[0056] The first digital certificate Company Name Registry information 00001 A Limited Liability Company ACompany Information 00002 B LLC BCompany Information 00003 C LLC CCompany Information

[0057] Exemplarily, before responding to the invoicing request of enterprise A by calling the smart contract to allocate a number segment, the blockchain network node obtains the first digital certificate 00001 submitted by enterprise A from the invoicing request, and queries and verifies from the tax bureau server registry whether the first digital certificate has been registered as a legal invoicing party based on the first digital certificate 00001. If the query verifies that the enterprise A corresponding to the first digital certificate is a legal invoicing party, then the first digital certificate 00001 is verified to be legal and the step of responding to the above-mentioned invoicing request by calling the smart contract to allocate a number segment is executed. If the query verifies that the enterprise A corresponding to the first digital certificate is not a legal invoicing party, then the first digital certificate 00001 is verified to be illegal, and an error user information prompt is output on the client where enterprise A submits the invoicing request, and the response to the above-mentioned invoicing request by calling the smart contract to allocate a number segment is refused.

[0058] After the company registration information of A company changes, it can submit a registration change request to the tax bureau server. The tax bureau server responds to the registration change request and accepts the changed registered company information, such as the contact number is changed to 177XXXXXXXX, and writes the changed company registration information into the registration table to replace the original registered company information. The registered company information table will be as follows:

[0059] Company Name A Limited Liability Company Corporate Taxpayer Identification Number 123456789123456 Company detailed address 19-12, XX Building, XX Road, XX District, XX City, XX Province Bank and account number Bank of China XX Branch 6021344556XXX Contact Details 177XXXXXXXXX

[0060] In one embodiment, before responding to the above-mentioned invoicing request and allocating invoice number segments by calling a smart contract, the blockchain network node can also receive a smart contract broadcasted by the tax bureau server to the blockchain network. The smart contract is used to allocate invoice number segments, issue invoices, and manage the permissions of multiple nodes.

[0061] The permissions of multiple nodes may specifically refer to the query permissions for transaction information. The blockchain network node corresponding to the tax terminal has the query permission for querying transaction information within the jurisdiction of the tax bureau corresponding to the tax terminal, and the blockchain network node corresponding to the user terminal has the query permission for querying transaction information related to the user.

[0062] For example, the transaction information query authority scope of the blockchain network node corresponding to enterprise A is to query the transaction information with enterprise A users as the seller, or to query the transaction information with enterprise A users as the buyer. The transaction information query authority scope of the blockchain network node corresponding to the tax bureau in region a is to query the transaction information of enterprises registered in region a, and the transaction information query authority scope of the blockchain network node corresponding to the tax bureau in region b is to query the transaction information of enterprises registered in region b.

[0063] In one embodiment, the node obtains a preset invoice number segment pool in response to the invoicing request. Further, the node can randomly select an invoice number segment from the preset invoice number segment pool by calling a smart contract.

[0064] Among them, the above-mentioned pre-set invoice number segment pool is shared by all nodes in the above-mentioned blockchain network, and the range of the invoice number segment in the invoice number segment pool is set by the tax bureau server.

[0065] Exemplarily, the blockchain network node responds to the invoice request of Company A and obtains the invoice number segment pool pre-set by the tax bureau server. The invoice number segment range in the invoice number segment pool is 10000000 to 99999999, and 12345678 is randomly selected from the invoice number segment pool as the invoice number segment for Company A's invoice request.

[0066] In one embodiment, after a node selects an invoice number segment from a preset invoice number segment pool by calling a smart contract, it should mark the invoice number segment in the invoice number segment pool, or move the invoice number segment out of the invoice number segment pool, and notify other nodes to mark the invoice number segment accordingly in the invoice pool, or move the invoice number segment out of the invoice number segment pool accordingly, so as to avoid the same invoice number segment being used multiple times.

[0067] S203: After the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the node issues an invoice according to the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal.

[0068] In one embodiment, after the smart contract detects that other nodes have reached a consensus on the above-mentioned allocated invoice number segment, the blockchain network node can obtain the registered enterprise information of the invoicing party by calling the smart contract to generate an invoice template, and issue an invoice based on the transaction information in the invoicing request and the allocated invoice number segment. This invoicing method not only improves the convenience of invoicing, but also avoids the confusion of invoice number segment allocation when multiple companies issue invoices at the same time.

[0069] For example, in response to the invoicing request of enterprise A, the blockchain network node allocates the number segment 12345678 by calling the smart contract. After the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, it calls the smart contract to obtain the registered enterprise information of enterprise A and generates an invoice template. The invoice is issued according to the transaction information in the invoicing request and the allocated invoice number segment. Figure 3a shown.

[0070] In one embodiment, after the blockchain network node issues an invoice according to the assigned invoice number segment and transmits the issued invoice back to the client on the user terminal, the transaction information can also be sent to the tax bureau server so that the tax bureau server can store the transaction information, and the transaction information is used by the tax authorities to query tax information.

[0071] In one embodiment, after the blockchain network node sends the transaction information to the tax bureau server, the tax bureau server can perform data risk control analysis based on the transaction information to check whether the charging status of the transaction information is abnormal. Abnormal charging status includes unreasonable charging and fraudulent behavior. If the transaction status is found to be abnormal, the enterprise information will be marked as abnormal. Subsequently, the data can be checked in detail based on the abnormal marking to improve the efficiency of tax audits.

[0072] In the embodiment of the present application, the blockchain network node receives an invoicing request submitted by a client running on a user terminal, allocates an invoice number segment in response to the invoicing request by calling a smart contract, and broadcasts the allocated invoice number segment to other nodes in the blockchain. Furthermore, after the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the blockchain network node issues an invoice based on the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal. By adopting such a data processing method based on a blockchain network, invoicing can be conveniently issued through blockchain technology, reducing the invoicing costs of business operations.

[0073] See also Figure 4 , is an embodiment of the present invention based on Figure 1a The data processing system shown is a flow chart of another data processing method based on a blockchain network. The data processing method based on a blockchain network in an embodiment of the present invention is described from the node side. The blockchain network includes multiple nodes. The data processing method based on the blockchain network includes the following steps:

[0074] S401: A node receives a billing request submitted by a client running on a user terminal.

[0075] S402: The node allocates an invoice number segment in response to the invoicing request by calling a smart contract, and broadcasts the allocated invoice number segment to other nodes in the blockchain network.

[0076] S403: After the node detects that other nodes have reached a consensus on the allocated invoice number segment in the smart contract, it issues an invoice according to the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal.

[0077] The specific implementation of steps S401-S403 can refer to the specific description of steps S201-S203 in the above embodiment, which will not be repeated here.

[0078] S404: The node writes the issued invoice into a block and broadcasts the block to other nodes. Further, after other nodes reach a consensus on the block, the block is added to the blockchain.

[0079] Before the specific implementation, the blockchain network node first uses an asymmetric encryption algorithm to create a key pair for the user; the asymmetric encryption algorithm here may include but is not limited to: Elgamal algorithm (an asymmetric encryption algorithm), Rabin algorithm (an asymmetric encryption algorithm), Diffie-Hellman algorithm (an asymmetric encryption algorithm), ECC algorithm (elliptic curve encryption algorithm). Among them, the key pair includes a public key and a private key; the public key is used to identify the transaction address of the client on the user terminal, and the private key is used by the client on the user terminal to sign the invoice information. After creating the key pair, the client on the user terminal can upload the public key in the key pair to the blockchain network, so that the blockchain network uses the public key in the key pair as the transaction address of the client on the user terminal; and the private key is kept by the client on the user terminal. It should be noted that the transaction address in the blockchain network is unique, and one transaction address corresponds to one client (ie, user); that is, the public key can mark the user identity of the user indicated by the client on the user terminal.

[0080] In a specific implementation, the blockchain network node uses a private key to sign the issued invoice, and then uploads the signed invoice to the blockchain network. After receiving the signed invoice, the blockchain network uses the public key corresponding to the private key to verify the identity of the invoice to determine the authenticity and validity of the invoice. If the verification is successful, the first block is obtained from the blockchain, and then all the information in the block header of the first block is obtained, and based on all the information in the block header of the first block, the block header feature value of the first block is obtained, and the invoice information to be stored in the block body of the second block is obtained, and then the feature value of the invoice information is calculated to obtain the block body feature value of the second block, and then the block header feature value of the first block and the block body feature value of the second block are stored in the block header of the second block. The blockchain network calls the consensus mechanism of the network, and after the consensus is passed, the above-mentioned second block is saved in the blockchain. In this way, the authenticity and traceability of the data can be guaranteed.

[0081] In one embodiment, the blockchain network node may receive feedback information regarding the issued invoice sent by the client, where the feedback information indicates whether the content of the issued invoice is abnormal.

[0082] If the feedback information indicates that the content of the issued invoice is abnormal, the issued invoice will be marked as invalid. The abnormal content of the issued invoice means that after the client receives the invoice information, the issuer or the recipient has doubts about the content of the invoice.

[0083] In the specific implementation, the blockchain network node receives the feedback information sent by the client regarding the invoice issued. If the feedback information indicates that the content of the invoice issued is abnormal, the invoice issued will be marked as invalid and the identification information of the invalid invoice will be sent to the blockchain network. The identification information of the invalid invoice will be written into the block and the block will be broadcast to other nodes. After the other nodes in the blockchain reach a consensus on the block, the block will be added to the blockchain. This invoicing method ensures that the data cannot be tampered with while also monitoring the data in real time to prevent random charges.

[0084] S405: The node receives a tax information query request submitted by a client on a tax bureau terminal. The tax information query request carries identification information of the query object and a second digital certificate.

[0085] The client on the tax bureau terminal can be the same client as the client on the user terminal. The client has two login interfaces, such as Figure 3b As shown, the login interface can be switched with the identity of the login user. The query object can be any legal invoicing party. The second digital certificate is issued by the tax authority and uniquely identifies the tax bureau information so that the smart contract can manage the query authority based on the second digital certificate. Providing such a query method for the tax bureau improves the convenience of tax audits and improves the efficiency of tax audits.

[0086] S406: The node calls the smart contract to determine the query authority that matches the second digital certificate, and obtains the associated tax information of the query object that matches the query authority in the blockchain based on the identification information of the query object, and transmits the associated tax information back to the client on the tax bureau terminal.

[0087] In the specific implementation, after receiving the tax information query request submitted by the client on the tax bureau terminal, which carries the second digital certificate and the query object identification information, the blockchain network node calls the smart contract to determine the query authority of the tax bureau according to the second digital certificate. If the tax bureau has the authority to the query object, it searches for the associated tax information of the query object in the blockchain according to the query object identification information, and transmits the associated tax information back to the client of the tax bureau terminal.

[0088] The query object identification information may refer to identification information of all tax information of the query object, or may refer to identification information of tax information of the query object within a period of time.

[0089] In the embodiment of the present application, the blockchain network node receives the invoicing request submitted by the client running on the user terminal, responds to the invoicing request by calling the smart contract to allocate the invoice number segment, and broadcasts the allocated invoice number segment to other nodes in the multiple nodes of the blockchain network. After the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, an invoice is issued according to the allocated invoice number segment, and the issued invoice is returned to the client on the user terminal, and the issued invoice is written into the block, and the block is broadcast to other nodes. Further, after the consensus of the block is passed by other nodes, the block is added to the blockchain. Further, the blockchain network node can receive a tax information query request submitted by a client on the tax bureau terminal, the tax information query request carries the identification information of the query object and the second digital certificate, and calls the smart contract to determine the query authority matching the second digital certificate, and obtains the associated tax information of the query object matching the query authority in the blockchain according to the identification information of the query object, and returns the associated tax information to the client on the tax bureau terminal. By adopting such a blockchain-based data processing method, invoices can be issued quickly through blockchain technology, the efficiency of tax information query can be improved, and the authenticity and traceability of data can be effectively guaranteed.

[0090] See also Figure 5 , is an embodiment of the present invention based on Figure 1a The data processing system shown is a flowchart of another data processing method based on a blockchain network. The data processing method based on a blockchain network includes the following steps:

[0091] S501: The client running on the user terminal submits a billing request to the node.

[0092] The invoice request carries transaction information, and the transaction information includes one or more of the invoice issuer information, the invoice recipient information, the transaction amount and the transaction content.

[0093] S502: The node allocates an invoice number segment in response to the invoicing request by calling a smart contract, and broadcasts the allocated invoice number segment to other nodes in the multiple nodes of the blockchain network.

[0094] S503: After the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the node issues an invoice according to the allocated invoice number segment and transmits the issued invoice back to the client on the user terminal.

[0095] The specific implementation of steps S502-S503 can refer to the specific description of steps S202-S203 in the above embodiment, which will not be repeated here.

[0096] S504: The node writes the issued invoice into a block and broadcasts the block to other nodes. Further, after other nodes reach a consensus on the block, the block is added to the blockchain.

[0097] The specific implementation of step S504 can refer to the specific description of step S404 in the above embodiment, which will not be repeated here.

[0098] S505: The client on the tax bureau terminal sends a tax information query request to the above node.

[0099] The tax information query request carries the identification information of the query object and the second digital certificate. The client on the tax bureau terminal can be the same client as the client on the user terminal, and the client has two login interfaces.

[0100] S506: The node receives the tax information query request, calls the smart contract to determine the query authority that matches the second digital certificate, and obtains the associated tax information of the query object that matches the query authority in the blockchain based on the identification information of the query object, and transmits the associated tax information back to the client on the tax bureau terminal.

[0101] The specific implementation of step S506 can refer to the specific description of step S406 in the above embodiment, which will not be repeated here.

[0102] In the embodiment of the present application, the client running on the user terminal submits an invoicing request to the blockchain network node. The blockchain network node responds to the invoicing request by calling the smart contract to allocate an invoice number segment, and broadcasts the allocated invoice number segment to other nodes in the multiple nodes of the blockchain network. After the smart contract detects that other nodes have reached a consensus on the allocated invoice number segment, the blockchain network node issues an invoice according to the allocated invoice number segment, and returns the issued invoice to the client on the user terminal, writes the issued invoice into the block, and broadcasts the block to other nodes. Further, after other nodes have reached a consensus on the block, the block is added to the blockchain. The client on the tax bureau terminal submits a tax information query request to the blockchain network node, and the tax information query request carries the identification information of the query object and the second digital certificate. The blockchain network node receives the tax information query request, calls the smart contract to determine the query authority that matches the second digital certificate, and obtains the associated tax information of the query object in the blockchain that matches the query authority based on the identification information of the query object, and returns the associated tax information to the client on the tax bureau terminal. By adopting this blockchain-based data processing method, blockchain technology can be used to quickly issue invoices, improve the efficiency of tax information queries, and effectively ensure the authenticity and traceability of data.

[0103] Based on the description of the above method embodiment, the present invention also proposes a data processing device based on a blockchain network. Figure 6 As shown, the data processing device based on the blockchain network can run the following units:

[0104] The acquisition unit 601 is used to receive a billing request submitted by a client running on a user terminal;

[0105] A number segment allocation unit 602, configured to allocate an invoice number segment in response to the invoicing request by calling a smart contract, and broadcast the allocated invoice number segment to other nodes among the multiple nodes, wherein the smart contract runs on a virtual machine of any one of the nodes;

[0106] The invoicing unit 603 is used to issue an invoice according to the allocated invoice number segment after the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment;

[0107] The output unit 604 is used to transmit the issued invoice back to the client on the user terminal.

[0108] The invoice request carries transaction information, and the transaction information includes one or more of the invoice issuer information, the invoice recipient information, the transaction amount and the transaction content.

[0109] In one embodiment, the data processing device based on the blockchain network also includes a verification unit 605, and the invoicing request also carries a first digital certificate assigned by the tax bureau server. Before the number segment allocation unit 602 responds to the invoicing request by calling a smart contract to allocate invoice number segments, the verification unit 605 is used to verify whether the first digital certificate is legal. If the first digital certificate is legal, the number segment allocation unit 602 executes the step of allocating invoice number segments in response to the invoicing request by calling a smart contract.

[0110] In one embodiment, before the number segment allocation unit 602 executes the allocation of invoice number segments in response to the invoicing request by calling a smart contract, the acquisition unit 601 can also be used to receive the smart contract broadcast by the tax bureau server to the blockchain network, and the smart contract is used to allocate invoice number segments, issue invoices, and manage the permissions of the multiple nodes.

[0111] In one embodiment, the invoicing unit 603 issues an invoice according to the assigned invoice number segment. After the output unit 604 returns the issued invoice to the client, the output unit 604 is also used to send the transaction information to the tax bureau server so that the tax bureau server can store the transaction information. The transaction information is used by the tax authorities to query tax information.

[0112] In one embodiment, the data processing device based on the blockchain network also includes a writing unit 606, and the invoicing unit 603 issues an invoice according to the allocated invoice number segment. After the output unit 604 returns the issued invoice to the client, the writing unit is used to write the issued invoice into a block and broadcast the block to the other nodes. After the other nodes reach a consensus on the block, the block is added to the blockchain.

[0113] In one embodiment, the data processing device based on the blockchain network further includes a query unit 607, and the acquisition unit 601 is further used to receive a tax information query request submitted by a client running on a tax bureau terminal, and the tax information query request carries the identification information of the query object and the second digital certificate. The query unit 607 is used to call the smart contract to determine the query authority that matches the second digital certificate; and obtain the associated tax information of the query object in the blockchain that matches the query authority according to the identification information of the query object. The output unit 604 is also used to transmit the associated tax information back to the client on the tax bureau terminal.

[0114] In one embodiment, the data processing device based on the blockchain network further includes a marking unit 608. The acquisition unit 601 is further configured to receive feedback information sent by the client regarding the issued invoice, wherein the feedback information indicates whether the content of the issued invoice is abnormal. The marking unit 608 is configured to mark the issued invoice as invalid if the feedback information indicates that the content of the issued invoice is abnormal.

[0115] In one embodiment, the number segment allocation unit 602 is further used to obtain a preset invoice number segment pool in response to the invoicing request, and randomly select an invoice number segment from the preset invoice number segment pool by calling a smart contract.

[0116] It should be noted that the functions of each unit module of the data processing device based on the blockchain network described in the embodiment of the present invention can be based on Figure 2 , Figure 4 or Figure 5 The specific implementation process of the method in the method embodiment can be referred to Figure 2 , Figure 4 or Figure 5 The relevant description of the method embodiment will not be repeated here.

[0117] Based on the description of the above method embodiment and the device embodiment, the present invention also provides a terminal device. Figure 7, the terminal device may include at least a processor 701, an input device 702, an output device 703 and a memory 704; wherein the processor 701, the input device 702, the output device 703 and the memory 704 may be connected via a bus or other connection methods. The memory 704 is used to store a computer program, the computer program includes program instructions, and the processor 701 is used to execute the program instructions stored in the memory 704. The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the terminal device, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions to implement the corresponding method flow or corresponding function in the above-mentioned data processing method embodiment based on the blockchain network. Among them, the processor 701 is configured to call the program instructions to execute: receiving an invoicing request submitted by a client running on the user terminal; responding to the invoicing request by calling a smart contract to allocate an invoice number segment, and broadcasting the allocated invoice number segment to other nodes among the multiple nodes; after the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment, an invoice is issued according to the allocated invoice number segment, and the issued invoice is returned to the client on the user terminal.

[0118] In one embodiment, the invoice request carries transaction information, and the transaction information includes one or more of the invoice issuer information, the invoice recipient information, the transaction amount and the transaction content.

[0119] In one embodiment, the invoicing request also carries a first digital certificate assigned by the tax bureau server. Before the node responds to the invoicing request and allocates an invoice number segment by calling a smart contract, the processor 701 is also used to verify whether the first digital certificate is legal; if the first digital certificate is legal, the step of responding to the invoicing request and allocating an invoice number segment by calling a smart contract is executed.

[0120] In one embodiment, before allocating invoice number segments by calling a smart contract in response to the invoicing request, the processor 701 is also used to receive the smart contract broadcasted by the tax bureau server to the blockchain network, and the smart contract is used to allocate invoice number segments, issue invoices, and manage the permissions of the multiple nodes.

[0121] In one embodiment, after the invoice is issued according to the allocated invoice number segment and the issued invoice is returned to the client, the processor 701 is also used to send the transaction information to the tax bureau server so that the tax bureau server can store the transaction information, and the transaction information is used by the tax authority to query tax information.

[0122] In one embodiment, after the invoice is issued according to the allocated invoice number segment and the issued invoice is returned to the client, the processor 701 is further used to write the issued invoice into a block and broadcast the block to the other nodes; after the other nodes reach a consensus on the block, the block is added to the blockchain.

[0123] In one embodiment, the processor 701 is also used to receive a tax information query request submitted by a client running on a tax bureau terminal, wherein the tax information query request carries identification information of a query object and a second digital certificate; call the smart contract to determine a query authority that matches the second digital certificate; obtain associated tax information of the query object in the blockchain that matches the query authority based on the identification information of the query object; and transmit the associated tax information back to the client on the tax bureau terminal.

[0124] In one embodiment, the processor 701 is further used to receive feedback information sent by the client regarding the issued invoice, wherein the feedback information indicates whether the content of the issued invoice is abnormal; if the feedback information indicates that the content of the issued invoice is abnormal, the issued invoice is marked as invalid.

[0125] In one embodiment, the processor 701 is further configured to obtain a preset invoice number segment pool in response to the invoicing request; and randomly select an invoice number segment from the preset invoice number segment pool by calling a smart contract.

[0126] It should be understood that in the embodiment of the present invention, the processor 701 may be a central processing unit (CPU), and the processor 701 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0127] The memory 704 may include a read-only memory and a random access memory, and provide instructions and data to the processor 701. A portion of the memory 704 may also include a non-volatile random access memory. For example, the memory 704 may also store information about the device type. The input device 703 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of the user), a microphone, a physical keyboard, etc., and the output device 703 may include a display (LCD, etc.), a speaker, etc.

[0128] In a specific implementation, the processor 701, the memory 704, the input device 702 and the output device 703 described in the embodiment of the present invention can execute the Figure 2 , Figure 4 or Figure 5 The implementation method described in the method embodiment can also execute the implementation method of the data processing device based on the blockchain network described in the embodiment of the present invention, which will not be repeated here.

[0129] In another embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the following are implemented: receiving an invoicing request submitted by a client running on a user terminal; allocating an invoice number segment by calling a smart contract in response to the invoicing request, and broadcasting the allocated invoice number segment to other nodes among the multiple nodes; after the smart contract detects that the other nodes have reached a consensus on the allocated invoice number segment, issuing an invoice according to the allocated invoice number segment, and transmitting the issued invoice back to the client on the user terminal.

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

[0131] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0132] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A data processing method based on a blockchain network, characterized in that: The blockchain network includes multiple nodes, and the method includes: The node receives a smart contract broadcasted by the tax bureau server to the blockchain network, wherein the smart contract is used to allocate invoice number segments, issue invoices, and manage the query rights of transaction information of the multiple nodes, and the node is any one of the multiple nodes; The node receives a ticketing request submitted by a client running on a user terminal; The node obtains a preset invoice number segment pool in response to the invoice request, wherein the range of the invoice number segments in the invoice number segment pool is set by the tax bureau server; The node randomly selects an invoice number segment from the invoice number segment pool by calling the smart contract, and broadcasts the randomly selected invoice number segment to other nodes among the multiple nodes, and the smart contract runs on a virtual machine of any one of the nodes; After the smart contract detects that the other nodes have reached a consensus on the randomly selected invoice number segment, the node issues an invoice according to the randomly selected invoice number segment, and transmits the issued invoice back to the client on the user terminal; The node receives feedback information regarding the issued invoice sent by the client, wherein the feedback information indicates whether the content of the issued invoice is abnormal; If the feedback information indicates that the content of the issued invoice is abnormal, the node marks the issued invoice as invalid, writes the identification information of the invalid invoice into the block, and broadcasts the block to the other nodes, so that the other nodes add the block to the blockchain after reaching a consensus on the block; If the feedback information indicates that the content of the issued invoice is normal, the node marks the randomly selected invoice number segment in the invoice number segment pool, or moves the randomly selected invoice number segment out of the invoice number segment pool; the node notifies the other nodes to mark the randomly selected invoice number segment in the invoice number segment pool, or moves the randomly selected invoice number segment out of the invoice number segment pool; The node receives a tax information query request submitted by a client running on a tax bureau terminal, wherein the tax information query request carries identification information of the query object and a second digital certificate; The node calls the smart contract to determine the query authority matching the second digital certificate; The node obtains, according to the identification information of the query object, the associated tax information of the query object that matches the query authority in the blockchain; The node transmits the associated tax information back to the client on the tax bureau terminal.

2. The method according to claim 1, characterized in that: The invoice request carries transaction information, and the transaction information includes one or more of the invoice issuer information, the invoice recipient information, the transaction amount and the transaction content.

3. The method according to claim 2, characterized in that: The invoicing request also carries a first digital certificate assigned by the tax bureau server. Before the node responds to the invoicing request and obtains a preset invoice number segment pool, the method further includes: The node verifies whether the first digital certificate is legal; If the first digital certificate is legal, the node executes the step of obtaining a preset invoice number segment pool in response to the invoicing request.

4. The method according to claim 2, characterized in that: After the node issues an invoice according to the randomly selected invoice number segment and transmits the issued invoice back to the client, the method further includes: The node sends the transaction information to the tax bureau server so that the tax bureau server can store the transaction information. The transaction information is used by the tax bureau to query tax information.

5. A data processing device, characterized in that: The device comprises: An acquisition unit, used to receive a smart contract broadcasted by a tax bureau server to a blockchain network, wherein the smart contract is used to allocate invoice number segments, issue invoices, and manage query rights for transaction information of multiple nodes of the blockchain network; The acquisition unit is further configured to receive a billing request submitted by a client running on a user terminal; A number segment allocation unit is used to obtain a preset invoice number segment pool in response to the invoice request, wherein the range of invoice number segments in the invoice number segment pool is set by the tax bureau server; randomly select an invoice number segment from the invoice number segment pool by calling the smart contract, and broadcast the randomly selected invoice number segment to other nodes among the multiple nodes, wherein the smart contract runs on a virtual machine of any one of the multiple nodes; An invoicing unit, configured to issue an invoice according to the randomly selected invoice number segment after the smart contract detects that the other nodes have reached a consensus on the randomly selected invoice number segment; An output unit, used to transmit the issued invoice back to the client on the user terminal; The acquisition unit is further configured to receive feedback information regarding the issued invoice sent by the client, wherein the feedback information indicates whether the content of the issued invoice is abnormal; a marking unit, configured to mark the issued invoice as invalid if the feedback information indicates that the content of the issued invoice is abnormal, write identification information indicating the invalidation of the issued invoice into a block, and broadcast the block to the other nodes, so that the other nodes add the block to the blockchain after reaching a consensus on the block; The number segment allocation unit is further configured to mark the randomly selected invoice number segment in the invoice number segment pool, or remove the randomly selected invoice number segment from the invoice number segment pool if the feedback information indicates that the content of the issued invoice is normal; The number segment allocation unit is further used to notify the other nodes to mark the randomly selected invoice number segment in the invoice number segment pool, or to remove the randomly selected invoice number segment from the invoice number segment pool; The acquisition unit is further used to receive a tax information query request submitted by a client running on a tax bureau terminal, wherein the tax information query request carries identification information of the query object and a second digital certificate; A query unit, configured to call the smart contract to determine the query authority matching the second digital certificate; and obtain, according to the identification information of the query object, the associated tax information of the query object matching the query authority in the blockchain; The output unit is also used to transmit the associated tax information back to the client on the tax bureau terminal.

6. A computer storage medium, characterized in that: The computer storage medium stores instructions, which, when executed on a computer, enable the computer to execute the data processing method based on a blockchain network as described in any one of claims 1 to 4.