CN110750808B - Bill processing method and device and storage medium device - Google Patents
Bill processing method and device and storage medium device Download PDFInfo
- Publication number
- CN110750808B CN110750808B CN201910966717.4A CN201910966717A CN110750808B CN 110750808 B CN110750808 B CN 110750808B CN 201910966717 A CN201910966717 A CN 201910966717A CN 110750808 B CN110750808 B CN 110750808B
- Authority
- CN
- China
- Prior art keywords
- terminal
- bill
- information
- private key
- ticket
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000000034 method Methods 0.000 claims description 66
- 238000004590 computer program Methods 0.000 claims description 5
- 238000004891 communication Methods 0.000 description 20
- 238000012795 verification Methods 0.000 description 15
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000004044 response Effects 0.000 description 6
- 238000013500 data storage Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 230000001010 compromised effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6209—Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The embodiment of the invention discloses a bill processing method, a bill processing device and a storage medium device. The bill processing method comprises the following steps: receiving a bill acquisition request sent by a first terminal, wherein the bill acquisition request comprises bill information; generating a bill for the first terminal according to the bill information; processing the bill according to the first private key use right of the first terminal and the intelligent contract to obtain a first digital signature; and sending the bill and the first digital signature to a second terminal corresponding to a second terminal identifier included in the bill information, so that the second terminal obtains the bill. By adopting the embodiment of the invention, the service node equipment can generate the bill for the first terminal under the condition that the private key of the first terminal is not obtained and only the private key use right of the first terminal is obtained, so that the security of the private key of the first terminal can be improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a ticket processing method and apparatus, and a storage medium device.
Background
Currently, many businesses authorize ticket generation operations to third party facilitators, i.e., ticket facilitators, who generate tickets for the business based on ticket information sent by the business.
After the enterprise authorizes the bill service provider, the private key of the enterprise is sent to the bill service provider, so that after the bill service provider generates a bill for the enterprise, the bill is processed by using the private key of the enterprise, the bill is encrypted, the generated bill is approved by the enterprise, and the risk of leakage of the private key of the enterprise exists in the mode.
Disclosure of Invention
The embodiment of the invention provides a bill processing method, a bill processing device and a storage medium device.
In a first aspect, an embodiment of the present invention provides a ticket processing method, where the method includes:
Receiving a bill acquisition request sent by a first terminal, wherein the bill acquisition request comprises bill information; generating a bill for the first terminal according to the bill information; processing the bill according to the first private key use right of the first terminal and the intelligent contract to obtain a first digital signature; and sending the bill and the first digital signature to a second terminal corresponding to a second terminal identifier included in the bill information, so that the second terminal obtains the bill.
In the technical scheme, the service node equipment generates a bill for a first terminal according to bill information from the first terminal, encrypts the bill according to a first private key use right and an intelligent contract of the first terminal, and sends the bill after the encryption to a second terminal corresponding to a second terminal identifier included in the bill information.
In a second aspect, the present invention provides a bill handling apparatus comprising:
The receiving module is used for receiving a bill acquisition request sent by the first terminal, wherein the bill acquisition request comprises bill information;
the generation module is used for generating a bill for the first terminal according to the bill information;
the processing module is used for processing the bill according to the first private key use right of the first terminal and the intelligent contract to obtain a first digital signature;
And the sending module is used for sending the bill and the first digital signature to a second terminal corresponding to a second terminal identifier included in the bill information so as to enable the second terminal to obtain the bill.
In a third aspect, an embodiment of the present invention provides a bill processing apparatus, which is characterized by comprising a processor and a memory, where the processor and the memory are connected to each other, and the memory is configured to store a computer program, where the computer program includes program instructions, and where the processor is configured to invoke the program instructions to perform the method of the first aspect.
In a fourth aspect, the present invention provides a computer storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the first aspect.
By implementing the embodiment of the invention, the service node equipment generates the bill for the first terminal under the condition that only the first private key use right of the first terminal is obtained, and encrypts the bill according to the first private key use right and the intelligent contract. If the first terminal updates the private key of the first terminal, the private key usage right corresponding to the private key will also fail, at this time, the service node device may send an update request to the first terminal, requesting to update the second private key usage right corresponding to the first terminal after the private key is updated, or the service node device receives the second private key usage right sent by the first terminal every first preset period. Meanwhile, the service node equipment can generate the bill for the first terminal according to the target bill information containing the same second terminal identifier in the bill information or the target bill information with the highest credit rating of the second terminal corresponding to the second terminal identifier in the bill information, so that the bill generation efficiency of the service node equipment can be improved.
Drawings
In order to more clearly describe the embodiments of the present invention or the technical solutions in the background art, the following description will describe the drawings that are required to be used in the embodiments of the present invention or the background art.
In order to more clearly describe the embodiments of the present invention or the technical solutions in the background art, the following description will describe the drawings that are required to be used in the embodiments of the present invention or the background art.
FIG. 1 is a schematic diagram of a block chain electronic invoice generation process;
FIG. 2 is a schematic diagram of a bill handling system according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a bill processing method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of another bill processing method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of another bill processing method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a bill processing device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of another bill handling device according to an embodiment of the present invention.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings in the embodiments of the present invention.
At present, as shown in fig. 1, a generating process of a blockchain electronic invoice is shown in fig. 1, an enterprise a authorizes a bill generation operation to a bill service provider, after a seller (enterprise a) and a buyer (enterprise B) conduct transactions, transaction information is generated, the enterprise a needs to invoice the enterprise B according to the transaction information, at this time, the enterprise a sends bill information generated according to the transaction information and a private key of the enterprise a to the bill service provider, the bill service provider generates a bill for the enterprise a according to the bill information, then processes the bill by using the private key of the enterprise a, encrypts the bill and enables the bill to be generated to be approved by the enterprise a, and finally sends the processed bill to the buyer enterprise B, so that the enterprise B obtains the bill. In the bill generation process, the bill service provider can obtain the private key of the enterprise A, and the risk that the private key of the enterprise A is revealed exists.
The embodiment of the invention provides a bill processing method, a bill processing device and a storage medium device. In the method, a first terminal authorizes bill generation operation to service node equipment in a blockchain network, when the first terminal and a second terminal finish transaction, the first terminal sends a bill acquisition request to the service node equipment when the first terminal needs the service node equipment to generate a bill for the first terminal, the bill acquisition request comprises bill information, the service node equipment generates a bill for the first terminal according to the bill information, processes the bill according to a first private key use right of the first terminal and an intelligent contract to obtain a first digital signature, and finally sends the bill and the first digital signature to the second terminal corresponding to a second terminal identifier contained in the bill information so that the second terminal acquires the bill. In the mode, the service node equipment only obtains the private key use right of the first terminal, but does not obtain the private key of the first terminal, so that the risk of revealing the private key of the first terminal is avoided, and the security of the private key can be improved.
In the bill processing process, the first terminal is taken as a seller, the second terminal is taken as a buyer, the service node equipment is taken as an example of a bill service provider, and the bill service provider can issue an invoice for the seller. When the seller and the buyer finish the transaction, the seller needs to issue an invoice for the buyer, and the bill service provider can help the seller to realize the operation of issuing the invoice, so that the seller sends a bill acquisition request to the bill service provider, and the bill acquisition request comprises bill information; the bill service provider invoices the seller according to the bill information, and processes the bill according to the private key use right and the intelligent contract of the seller to obtain a first digital signature; finally, the ticket facilitator sends the ticket and the first digital signature to the buyer to cause the buyer to obtain the ticket. In the invoice issuing process, the bill service provider only obtains the private key use right of the seller, but does not obtain the private key of the seller, so that the safety of the private key can be improved.
Blockchain is a novel application mode of computer technologies such as distributed data storage, consensus mechanism and encryption algorithm, and is essentially a de-centralized database; the blockchain may be composed of a plurality of serial transaction records (also known as blocks) that are cryptographically concatenated and protected from content, and the distributed ledgers concatenated by the blockchain enable multiple parties to effectively record transactions and permanently verify the transactions (non-tamperable).
In the bill processing process, the business node equipment on the blockchain stores the intelligent contract, and the bill can be processed through the intelligent contract and the private key use right of the first terminal to obtain the first digital signature. Wherein a smart contract is a computer protocol intended to propagate, verify or execute contracts in an informative manner, allowing trusted transactions to be made without third parties, which transactions are traceable and irreversible. An intelligent contract is a set of digitally defined commitments, including agreements on which contract participants can execute the commitments, a piece of code written on the blockchain.
In order to better understand a bill processing method, a bill processing device and a storage medium device disclosed in the embodiments of the present invention, a description is first given below of a architecture of a system to which the embodiments of the present invention are applied.
Referring to fig. 2, fig. 2 is a schematic diagram of a ticket processing system according to an embodiment of the invention. As shown in fig. 2, the system is composed of a first terminal 201, a second terminal 202 and a blockchain network 203, where the blockchain network 203 includes a service node device 2031 and a consensus node device 2032, and there may be multiple consensus node devices in the blockchain network, where the consensus node device is used to perform uplink processing on notification information from the service node device, and the service node device is used to generate a ticket for the first terminal. The first terminal and the second terminal are outside the blockchain network, do not participate in the uplink process, and do not store information within the blockchain network. The system architecture shown in fig. 2 is for illustration only and is not to be construed as limiting the embodiments of the invention.
The first terminal may be a terminal device used by a seller in a transaction process, the second terminal may be a terminal device used by a buyer in a transaction process, and optionally, the first terminal may be a terminal device used by a buyer in a transaction process, the second terminal may be a terminal device used by a seller in a transaction process, for convenience of description, except for specific description, the first terminal in the embodiment of the present invention is a terminal device used by a seller in a transaction process, and the second terminal is a terminal device used by a buyer in a transaction process.
The first terminal and the second terminal may include, but are not limited to: smart phones (such as Android phones, iOS phones, etc.), tablet computers, portable personal computers, intelligent wearable devices, etc., and these terminal devices have functions of network communication, etc.
Based on the above description, the embodiment of the present invention proposes a ticket processing method as shown in fig. 3, where the ticket processing method may include S301-S308:
S301: the first terminal sends a ticket acquisition request to the service node equipment, wherein the ticket acquisition request comprises ticket information.
Specifically, after the first terminal and the second terminal complete the transaction, the first terminal needs to provide the ticket for the second terminal according to the transaction information, at this time, the first terminal sends a ticket acquisition request to the service node device, so that the service node device generates a ticket for the first terminal, the ticket acquisition request includes ticket information, and the ticket information includes relevant information of the issuer and the ticket receiver, such as enterprises, tax numbers, unit addresses, telephone numbers and the like of the issuer and the ticket receiver.
S302: and the service node equipment generates a bill for the first terminal according to the bill information.
After receiving the ticket obtaining request from the first terminal, the service node equipment indicates that the first terminal has the ticket obtaining requirement, and generates a ticket for the first terminal according to the ticket information contained in the ticket obtaining request.
In one implementation, before the service node device generates a ticket for the first terminal according to the ticket information, the service node device checks a ticket acquisition request, where the ticket acquisition request includes identity information of a sender of the ticket acquisition request, and the check of the service node device on the ticket acquisition request may include: and verifying the identity of the sender of the bill acquisition request, namely verifying the identity of the first terminal, thereby improving the credibility of the bill acquisition request. Specifically, the service node device uses the public key created by the first terminal to check the bill acquisition request, if the check is successful, the service node device indicates that the sender of the bill acquisition request is the first terminal for sending the bill acquisition request, and the service node device checks the bill acquisition request successfully. In this way, the reliability of the bill acquisition request, namely, the reliability of the bill information and the use right of the first private key is improved.
S303: the service node equipment generates notification information, wherein the notification information comprises the generation time of the bill, the node identification of the service node equipment and the terminal identification of the first terminal.
Specifically, after the service node device generates the ticket for the first terminal, the service node device generates notification information, where the notification information includes a generation time of the ticket, a node identifier of the service node device, and a terminal identifier of the first terminal, and the notification information is used to notify the common node device to perform uplink processing on the notification information, so that the notification information is stored in a distributed data manner in a block manner.
In one implementation, the notification information includes a time of generation of the ticket, a node identifier of the service node device, a terminal identifier of the first terminal, and ticket information, so that the common node device not only stores a participant and time in the ticket generation process, but also performs uplink processing on the ticket information, and stores the ticket information on the common node device, so that the ticket information is not tampered, and a detectable evidence can be provided for a subsequent ticket problem.
S304: the service node device sends the notification information to the consensus node device.
After the service node equipment generates the notification information, the notification information is sent to the consensus node equipment, so that the consensus node equipment performs uplink processing on the notification information.
S305: the consensus node device checks the notification information.
And after receiving the notification information, the consensus node equipment checks the notification information. The notification information includes identity information of a notification information sender, and the verification of the notification information by the consensus node device may include: and checking the identity of the sender of the notification information, namely checking the identity of the service node equipment, thereby improving the credibility of the notification information. Specifically, the public key created by the service node device is used by the common node device to check the notification information, if the verification is successful, the common node device indicates that the sender of the notification information is the service node device sending the notification information, and the common node device checks the notification information successfully. In this way, the reliability of the notification information is advantageously improved.
In one implementation, after the notification information is successfully checked by the common node device, the notification information is sent to each common node device, so that each common node device checks the notification information. And under the condition that the common node equipment checks the notification information successfully, the notification information is sent to each common node equipment in the blockchain network, so that the reliability of the notification information can be improved. Each consensus node device in the block chain network checks the notification information and sends a check result aiming at the notification information to the consensus node device receiving the notification information in the form of notification information check response.
Specifically, the verification of the notification information by each common node device is the same as the verification of the notification information by the common node device, which is not described herein. Each of the common node devices may transmit a check response of the notification information to the common node device that receives the notification information, regardless of whether the check result of the common node device on the notification information is passed or not passed. The verification results for the notification information included in the notification information verification response from each consensus node device in the blockchain network may be independent from each other.
The common node equipment receiving the notification information obtains a notification information verification result according to the notification information verification response, and further determines whether the notification information passes the verification of the blockchain network, namely, the bill information verification result is commonly determined according to the notification information verification response returned by each common node equipment in the blockchain network. By the method, the common node equipment in the block chain network can participate in the verification process of the notification information, and the reliability of the notification information is improved.
In one implementation, if the verification result included in the verification response of each consensus node device to the notification information is that the number of passes is greater than a preset threshold, the consensus node device that receives the notification information determines that the notification information passes the verification of the blockchain network. For example, the preset threshold is 50% of the number of the common node devices in the blockchain network, if the blockchain network is composed of 45 common node devices, and the checking result of 26 common node devices on the notification information is that the checking result of the common node devices in the blockchain network on the notification information is that the checking result is that the number of the common node devices is that the common node devices is larger than the preset threshold, the common node devices determine that the notification information passes the checking of each common node device in the blockchain network.
S306: and if the notification information is successfully checked, the common node equipment performs uplink processing on the notification information.
Specifically, if the common node device checks the notification information successfully, the notification information is subjected to uplink processing to generate a block including the notification information, so that the notification information is subjected to distributed data storage in a block manner, and is not easy to tamper. After each time the business node equipment generates the bill, the notification information about the bill is sent to the consensus node equipment, and the consensus node equipment carries out uplink processing on the notification information, so that the time and information of each time the business node equipment generates the bill for the first terminal can be recorded, and a detectable basis can be provided for the follow-up non-recognition problem.
In one implementation, if the notification information includes ticket information, the consensus node device performs uplink processing on the notification information, so that the ticket information is also stored in a distributed manner in a block manner, and a searchable evidence can be provided for subsequent ticket problems.
S307: and the service node equipment processes the bill according to the first private key use right and the intelligent contract to obtain a first digital signature.
In one implementation, after the first terminal authorizes the service node device, the first private key usage right of the first terminal is sent to the service node device, the first private key usage right corresponds to the private key of the first terminal, and the first private key usage right is used for encrypting the bill by the service node device. Optionally, when the first terminal first has a ticket obtaining requirement, the first terminal sends a ticket obtaining request to the service node device, where the ticket obtaining request includes ticket information and a first private key usage right of the first terminal.
After the service node equipment generates a bill for the first terminal, the bill is processed according to the first private key use right and the intelligent contract to obtain a first digital signature, and the intelligent contract comprises program codes for processing the bill according to the private key use right. The service node equipment invokes the program code, and the service node equipment can use the private key of the first terminal through the first private key use right, and can invoke the private key of the first terminal internally to process the bill. In the processing procedure, the service node device does not obtain the private key of the first terminal, but only calls the private key internally through the first private key usage right, and the private key is unknown to the service node device. The process may protect the private key of the first terminal from disclosure.
S308: and the service node equipment sends the bill and the first digital signature to a second terminal corresponding to a second terminal identifier included in the bill information.
The service node equipment obtains a first digital signature, and indicates that the bill is successfully processed, the bill and the first digital signature are sent to a second terminal corresponding to a second terminal identifier included in bill information, so that the second terminal obtains the processed bill, and the public key of the first terminal can be used for decrypting the bill to obtain the bill.
In the embodiment of the invention, the service node equipment can encrypt the bill only by using the private key use right of the first terminal, but the private key of the first terminal is not obtained, so that the security of the private key of the first terminal can be improved, and after the service node equipment generates the bill for the first terminal, the consensus node equipment can store the time and the participators of each bill generation of the service node equipment, and can provide verifiable data for subsequent processing problems.
Referring to fig. 4, fig. 4 is a flowchart of another ticket processing method according to an embodiment of the present invention, where the method is applied to service node devices, and the method includes, but is not limited to, S401-S410.
S401: the service node equipment receives bill acquisition request information sent by the first terminal, wherein the bill acquisition request comprises the bill information.
When the first terminal has a bill acquisition requirement, the first terminal sends a bill acquisition request to the service node equipment, and then the service node equipment receives the bill acquisition request sent by the first terminal, wherein the bill acquisition request comprises bill information.
S402: if the number of the bill information is a plurality of bill information, the service node equipment determines that the plurality of bill information contains target bill information with the same second terminal identification.
In one implementation, one ticket acquisition request received by the service node device includes a plurality of ticket information, so the number of ticket information is a plurality.
In one implementation, one acquisition request received by the service node device includes one ticket information, and if a plurality of ticket acquisition requests sent from the first terminal are received, the number of the ticket information is a plurality of ticket information.
The plurality of ticket information may include different second terminal identifiers, and similarly, the plurality of ticket information may also include the same second terminal identifier. When the number of the ticket information is multiple, the service node device determines that target ticket information containing the same second terminal identifier is included in the multiple ticket information, for example, the ticket information received by the service node device is ticket information a, ticket information B, ticket information C and ticket information D, the second terminal identifiers included in ticket information a, ticket information B, ticket information C and ticket information D are terminal identifier 1, terminal identifier 2, terminal identifier 3 and terminal identifier 2 respectively, and the same second terminal identifier is included in ticket information a and ticket information D, then the service node device determines that the target ticket information containing the same second terminal identifier is ticket information a and ticket information D.
In one implementation, if the second terminal identifier included in the plurality of ticket information does not have the same second terminal identifier, the service node device determines that the target ticket information does not exist in the plurality of ticket information.
S403: and the service node equipment generates bills for the first terminal according to the target bill information.
After the service node equipment determines target bill information in the bill information, generating a plurality of bills for the first terminal according to each target bill information, wherein the bill receiver of each bill is a second terminal corresponding to a second terminal identifier included in the target bill information. By means of generating the bill according to the target bill information, the service node equipment can provide the bill for the second terminal with the same second terminal identifier in the bill information preferentially, and billing efficiency of the service node equipment can be improved.
In one implementation, if the service node device determines that the target bill information does not exist in the plurality of bill information, generating a plurality of bills for the first terminal according to a preset rule and each bill information, wherein the preset rule is a preset rule. For example, if the preset rule is a time priority rule, the service node device generates a plurality of notes for the first terminal according to the time sequence of receiving each note information, thereby generating a plurality of notes for the first terminal according to each note information.
S404: the service node equipment generates notification information, wherein the notification information comprises the generation time of the bill, the node identification of the service node equipment and the terminal identification of the first terminal.
S405: and the service node equipment sends the notification information to the common node equipment so that the common node equipment performs uplink processing on the notification information.
The steps S404 to S405 in the embodiment of the present application may be specifically referred to the execution process of steps S303 to S304 in the above embodiment, and the embodiment of the present application is not repeated.
S406: and the service node equipment processes the bill according to the first private key use right and the intelligent contract.
In one implementation, after the first terminal authorizes the service node device, the first private key usage right of the first terminal is sent to the service node device, the first private key usage right corresponds to the private key of the first terminal, and the first private key usage right is used for encrypting the bill by the service node device. Optionally, when the first terminal first has a ticket obtaining requirement, the first terminal sends a ticket obtaining request to the service node device, where the ticket obtaining request includes ticket information and a first private key usage right of the first terminal.
After the service node equipment generates a plurality of notes for the first terminal, each note is processed according to the first private key use right and the intelligent contract to obtain a plurality of first digital signatures, and the intelligent contract comprises program codes for processing the notes according to the first private key use right. The service node equipment invokes the program code, and the service node equipment can use the private key of the first terminal through the first private key use right, can internally invoke the private key of the first terminal to process each bill, and encrypts each bill.
In the processing process, the service node equipment still does not acquire the private key of the first terminal, but only calls the private key internally through the first private key use right, the private key is still unknown to the service node equipment, and the security of the private key of the first terminal can be protected.
S407: if the bill processing fails, the service node equipment sends an update request to the first terminal, wherein the update request is used for requesting to update the first private key use right.
And the service node equipment processes the plurality of bills according to the first private key use right and the intelligent contract, if the processing fails, the first terminal is indicated to update the private key of the first terminal, and at the moment, the first private key use right corresponding to the private key of the first terminal is invalid, so that the service node equipment cannot use the first private key use right. And the service node equipment sends an update request to the first terminal, and requests to update the corresponding first private key use right after the first terminal updates the private key.
S408: the service node equipment receives a second private key use right sent by the first terminal, wherein the second private key use right is obtained by updating the private key of the first terminal by the first terminal.
After receiving the update request sent by the service node device, the first terminal sends the second private key usage right corresponding to the update private key to the service node device, so that the service node device receives the second private key usage right sent by the first terminal, and the second private key usage right is obtained by updating the private key of the first terminal by the first terminal.
S409: and the service node equipment processes the bill according to the second private key use right and the intelligent contract to obtain a second digital signature.
And after receiving the latest second private key use right, the service node equipment encrypts each bill according to the second private key use right and the intelligent contract to obtain a plurality of second digital signatures. The smart contract contains program code that processes the ticket based on the private key usage rights. The service node equipment calls the program code, and calls the private key of the first terminal internally through the first private key use right to process the bill.
In the processing procedure, the service node device does not obtain the private key of the first terminal, but only calls the private key internally through the first private key usage right, and the private key is unknown to the service node device. The process may be such that the private key of the first terminal is not compromised.
S410: and the service node equipment sends the bill and the second digital signature to a second terminal corresponding to a second terminal identifier contained in the target bill information.
And the service node equipment sends each bill and each second digital signature to a second terminal corresponding to a second terminal identifier contained in target bill information, so that the second terminal receives each bill and decrypts each second digital signature by using a public key created by the first terminal to obtain a plurality of bills.
In the embodiment of the invention, the number of the bill information is multiple, the service node equipment can preferentially generate the bill for the first terminal according to the target bill information with the same second terminal identifier contained in the bill information, and the bill generation efficiency of the service node equipment can be improved. Meanwhile, if the service node equipment fails to process the bill information according to the first private key usage right of the first terminal, an update request can be sent to the first terminal to obtain a second private key usage right corresponding to the updated private key of the first terminal, and then the bill is processed according to the second private key usage right. In this way, the first terminal may update the private key of the first terminal at intervals, so that the security of the private key may be improved.
Referring to fig. 5, fig. 5 is a flow chart of another bill processing method according to an embodiment of the invention, and the method includes, but is not limited to, S501-S511.
S501: the service node equipment receives bill acquisition request information sent by the first terminal, wherein the bill acquisition request comprises the bill information.
Step S501 in the embodiment of the present application may be specifically referred to the execution process of step S401 in the above embodiment, and the embodiment of the present application is not repeated.
S502: if the number of the bill information is a plurality of, the service node equipment determines a plurality of second terminals corresponding to the second terminal identifiers contained in each bill information.
One bill acquisition request received by the service node equipment comprises a plurality of bill information, and the number of the bill information is a plurality of bill information. Optionally, the one ticket obtaining request received by the service node device includes one ticket information, and the number of the ticket information is a plurality of when a plurality of ticket obtaining requests sent by the first terminal are received.
Each bill information comprises a second terminal identifier. If the number of the bill information is multiple, the service node equipment determines multiple second terminals corresponding to the second terminal identifiers contained in the bill information through the second terminal identifiers contained in the bill information.
S503: the service node equipment acquires the total transaction times and the successful transaction times of each second terminal in a preset period.
Each second terminal can trade with the first terminal for many times, each trade with the first terminal can generate a trade record, and the trade condition of each second terminal and the first terminal can be successful trade or failure trade. And the service node equipment acquires the total transaction times and the successful transaction times corresponding to the first terminals through the second terminal identifiers included in the bill information in a preset period, wherein the preset period is a second preset period, and the second preset period is preset.
S504: and the service node equipment determines the credit rating of each second terminal according to the total transaction times and the successful transaction times of each second terminal.
Specifically, the service node device determines the transaction success rate of each second terminal according to the total transaction times and the transaction success times of each second terminal, and then determines the credit rating of each second terminal according to the transaction success rate of each second terminal.
The second terminal corresponding to the second terminal identifier included in the plurality of ticket information is a second terminal a, a second terminal B and a second terminal C, the number of transactions of the second terminal a is 26, the number of successful transactions is 17, the number of transactions of the second terminal B is 12, the number of successful transactions is 4, the number of transactions of the second terminal C is 45, the number of successful transactions is 31, the success rate of transactions of the second terminal a is 65.4%, the success rate of transactions of the second terminal B is 33.3%, the success rate of transactions of the second terminal C is 68.9%, and if the credit levels of the three second terminals are ordered by capital letters, the credit levels of the second terminal a, the second terminal B and the second terminal C are B, C and a, respectively. The credit rating ordering of the second terminal may also be represented in other ways, such as numbers, etc., without limitation.
S505: and the service node equipment determines a target second terminal identifier corresponding to the highest credit level in the credit levels.
After the service node device determines the credit rating of each second terminal, determining the target second terminal identifier corresponding to the highest credit rating in each credit rating. For example, as shown in S504, the credit levels of the second terminals determined by the service node device are B, C and a, respectively, where the highest credit level of the three second terminals is the second terminal C, and the terminal identifier of the second terminal C is determined as the target second terminal identifier corresponding to the highest credit level in the respective credit levels.
S506: and the service node equipment generates a bill for the first terminal according to the bill information corresponding to the target second terminal identifier.
Specifically, the service node device determines bill information according to the target second terminal identifier, and then generates a bill for the first terminal according to the determined bill information.
In one implementation, the number of ticket information corresponding to the target second terminal identifier is one, and the service node device generates a ticket for the first terminal according to the determined ticket information.
In one implementation, the number of ticket information corresponding to the target second terminal identifier is a plurality of, and the service node device generates a plurality of tickets for the first terminal according to the determined plurality of ticket information.
In the method, the service node equipment generates the bill according to bill information corresponding to the target second terminal identifier of the second terminal with the highest credit rating, so that the service node equipment preferentially provides the bill for the second terminal with the highest credit rating. The probability of successful transaction between the second terminal with high credit level and the first terminal is larger than that of the second terminal with low credit level, and the service node equipment preferentially provides notes for the second terminal with high credit level, so that the number of tax refunds caused by subsequent transaction failure can be reduced.
S507: the service node equipment generates notification information, wherein the notification information comprises the generation time of the bill, the node identification of the service node equipment and the terminal identification of the first terminal.
S508: and the service node equipment sends the notification information to the common node equipment so that the common node equipment performs uplink processing on the notification information.
The steps S507 to S508 in the embodiment of the present application may be specifically referred to the execution process of steps S404 to S405 in the above embodiment, and the embodiment of the present application is not repeated.
S509: and the service node equipment receives the second private key use right sent by the first terminal every preset period.
And the service node equipment receives the second private key use right sent by the first terminal every interval of preset period, wherein the preset period is the first preset period, the first preset period is preset, and the second private key use right is obtained by updating the private key of the first terminal by the first terminal.
The service node device automatically receives the second private key use right sent by the first terminal every first preset period, so that the private key use right used every time is the private key use right corresponding to the latest private key from the first terminal.
S510: and the service node equipment processes the bill according to the second private key use right and the intelligent contract to obtain a second digital signature.
S511: and the service node equipment sends the bill and the second digital signature to a second terminal corresponding to a second terminal identifier contained in the target bill information.
The steps S510 to S511 in the embodiment of the present application may be specifically referred to the execution process of the steps S409 to S410 in the above embodiment, and the embodiment of the present application is not repeated.
In the embodiment of the invention, the service node equipment can generate the bill for the first terminal according to the credit grade of the second terminal corresponding to the second terminal identifier included in the bill information, preferentially according to the bill information corresponding to the credit grade of the second terminal, and the service node equipment can receive the second private key use right from the first terminal at each preset period, so that the owned private key use right is the private key use right obtained after the first terminal updates the private key of the first terminal, and further the condition of failure in bill processing caused by failure in the private key use right is avoided.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a bill handling device according to an embodiment of the present invention, where the bill handling device may be used in steps executed by a service node device in the embodiments shown in fig. 3 to fig. 5, and the bill handling device 60 may include:
A receiving module 601, configured to receive a ticket obtaining request sent by a first terminal, where the ticket obtaining request includes ticket information;
A generating module 602, configured to generate a ticket for the first terminal according to the ticket information;
The processing module 603 is configured to process the ticket according to the first private key usage right of the first terminal and the intelligent contract, to obtain a first digital signature;
And the sending module 604 is configured to send the ticket and the first digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.
In one implementation, the processing module 603 is further configured to, if the ticket processing fails according to the first private key usage right and the smart contract, send, through the sending module 604, an update request to the first terminal, where the update request is used to request updating of the first private key usage right;
the receiving module 601 is further configured to receive a second private key usage right sent by the first terminal, where the second private key usage right is obtained by updating a private key of the first terminal by the first terminal;
The processing module 603 is further configured to process the ticket according to the second private key usage right and the intelligent contract, to obtain a second digital signature;
the sending module 604 is further configured to send the ticket and the second digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.
In one implementation manner, the receiving module 601 is further configured to receive, at each first preset period, a second private key usage right sent by the first terminal, where the second private key usage right is obtained by updating a private key of the first terminal by the first terminal;
The processing module 603 is further configured to process the ticket according to the second private key usage right and the intelligent contract, to obtain a second digital signature;
the sending module 604 is further configured to send the ticket and the second digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.
In one implementation, after the generating module 602 generates a ticket for the first terminal according to the ticket information, the generating module 602 is further configured to generate notification information, where the notification information includes a generation time of the ticket, a node identifier of the service node device, and a terminal identifier of the first terminal;
The sending module 604 is further configured to send the notification information to the consensus node device, so that the consensus node device performs uplink processing on the notification information.
In one implementation, the number of the bill information is multiple, and the processing module 603 is further configured to determine that the multiple bill information includes target bill information with the same second terminal identifier;
the generating module 602 is further configured to generate a ticket for the first terminal according to each target ticket information.
In one implementation, the processing module 603 is further configured to determine a plurality of second terminals corresponding to the second terminal identifiers included in each ticket information;
the processing module 603 is further configured to determine a credit rating of each second terminal;
the processing module 603 is further configured to determine a target second terminal identifier corresponding to a highest credit level in the respective credit levels;
The generating module 602 is further configured to generate a ticket for the first terminal according to ticket information corresponding to the target second terminal identifier.
In one implementation, the processing module 603 is further configured to obtain a total number of transactions and a number of successful transactions of each second terminal in a second preset period;
The processing module 603 is further configured to determine a credit level of each second terminal according to the total number of transactions and the number of successful transactions of each second terminal.
The individual modules in the apparatus shown in fig. 6 may be combined into one or several additional modules separately or all, or some (some) of them may be further split into a plurality of modules with smaller functions, which may achieve the same operation without affecting the implementation of the technical effects of the embodiments of the present application. The above modules are divided based on logic functions, and in practical application, the functions of one module may be implemented by a plurality of modules, or the functions of a plurality of modules may be implemented by one module. In other embodiments of the present application, other modules may be included, and in practical applications, these functions may be implemented with assistance of other modules, and may be implemented by cooperation of multiple modules, which is not limited by the present application.
Referring to fig. 7, fig. 7 is a schematic structural diagram of another bill handling device according to an embodiment of the present invention, where the bill handling device 70 includes a processor 701, a memory 702, and a communication interface 703, and the processor 701, the memory 702, and the communication interface 703 are connected by one or more communication buses.
The processor 701 is configured to support the ticket handling means to perform the corresponding functions of the service node arrangement of the embodiments shown in fig. 3-5. The processor 701 may be a central processor (central processing unit, CPU), a network processor (network processor, NP), a hardware chip, or any combination thereof.
The memory 702 is used for storing program codes and the like. The memory 702 may include volatile memory (RAM), such as random access memory (random access memory); the memory 702 may also include a non-volatile memory (non-volatile memory), such as read-only memory (ROM), flash memory (flash memory), hard disk (HARD DISK DRIVE, HDD) or solid state disk (solid-state drive (STATE DRIVE, SSD); the memory 702 may also include a combination of the above types of memory.
The communication interface 703 is used for receiving and transmitting data, for example, the communication interface 703 is used for receiving a ticket acquisition request transmitted by a first terminal, or the communication interface 703 is used for transmitting a ticket and a first digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information.
In an embodiment of the present invention, the ticket processing apparatus 70 includes a plurality of communication interfaces, wherein the communication interface for transmitting data and the communication interface for receiving data may not be the same communication interface.
The processor 701 may call program code stored in the memory 702 to:
The communication interface 703 receives a ticket acquisition request sent by the first terminal, where the ticket acquisition request includes ticket information;
the processor 701 generates a ticket for the first terminal according to the ticket information;
the processor 701 processes the ticket according to the first private key use right of the first terminal and the intelligent contract to obtain a first digital signature;
The processor 701 transmits the ticket and the first digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.
In one implementation, the processor 701 may also perform the following operations:
If the processor 701 fails to process the ticket according to the first private key usage right and the intelligent contract, an update request is sent to the first terminal through the communication interface 703, where the update request is used for requesting to update the first private key usage right;
The processor 701 receives, through the communication interface 703, a second private key usage right sent by the first terminal, where the second private key usage right is obtained by updating a private key of the first terminal;
The processor 701 processes the ticket according to the second private key usage rights and the intelligent contract to obtain a second digital signature;
The processor 701 transmits the ticket and the second digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.
In one implementation, the processor 701 may also perform the following operations:
every first preset period, the processor 701 receives, through the communication interface 703, a second private key usage right sent by the first terminal, where the second private key usage right is obtained by updating a private key of the first terminal;
The processor 701 processes the ticket according to the second private key usage rights and the intelligent contract to obtain a second digital signature;
The processor 701 transmits the ticket and the second digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.
In one implementation, after the processor 701 generates a ticket for the first terminal according to the ticket information, the following operations may be further performed:
the processor 701 generates notification information, where the notification information includes a generation time of the ticket, a node identifier of the service node device, and a terminal identifier of the first terminal;
the processor 701 transmits the notification information to the consensus node device through the communication interface 703, so that the consensus node device performs uplink processing on the notification information.
In one implementation, the number of ticket information is a plurality, and the processor 701 may further perform the following operations:
the processor 701 determines that target bill information containing the same second terminal identifier in the plurality of bill information;
The processor 701 generates a ticket for the first terminal based on the respective target ticket information.
In one implementation, the number of ticket information is a plurality, and the processor 701 may further perform the following operations:
The processor 701 determines a plurality of second terminals corresponding to the second terminal identifiers contained in the respective ticket information;
the processor 701 determines the credit rating of each second terminal;
The processor 701 determines a target second terminal identifier corresponding to the highest credit level in the credit levels;
The processor 701 generates a ticket for the first terminal according to ticket information corresponding to the target second terminal identifier.
In one implementation, the processor 701 may also perform the following operations:
the processor 701 obtains the total number of transactions and the successful number of transactions of each second terminal in a second preset period;
the processor 701 determines the credit rating of each second terminal according to the total number of transactions and the number of successful transactions of each second terminal.
Embodiments of the present invention also provide a computer readable storage medium that may be used to store computer software instructions for a service node device in the embodiments shown in fig. 3-7, where the computer software instructions include a program for executing the program designed for the service node device in the embodiments described above.
The computer readable storage medium includes but is not limited to flash memory, hard disk, solid state disk.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (9)
1. A ticket processing method, wherein the method is applied to service node equipment, and the method comprises:
receiving a bill acquisition request sent by a first terminal, wherein the bill acquisition request comprises bill information;
generating a bill for the first terminal according to the bill information;
generating notification information, wherein the notification information comprises the generation time of the bill, the node identifier of the service node equipment and the terminal identifier of the first terminal;
sending the notification information to a consensus node device so that the consensus node device can perform uplink processing on the notification information;
invoking an intelligent contract, and determining that the service node equipment is authorized to use the private key of the first terminal through the first private key use right of the first terminal;
Calling a private key of the first terminal through the intelligent contract to process the bill to obtain a first digital signature;
And sending the bill and the first digital signature to a second terminal corresponding to a second terminal identifier included in the bill information, so that the second terminal obtains the bill.
2. The method according to claim 1, wherein the method further comprises:
If the bill processing fails according to the first private key use right and the intelligent contract, an update request is sent to the first terminal, wherein the update request is used for requesting to update the first private key use right;
Receiving a second private key use right sent by the first terminal, wherein the second private key use right is obtained by updating the private key of the first terminal by the first terminal;
processing the bill according to the second private key use right and the intelligent contract to obtain a second digital signature;
And sending the bill and the second digital signature to a second terminal corresponding to a second terminal identifier included in the bill information, so that the second terminal obtains the bill.
3. The method according to claim 1, wherein the method further comprises:
Receiving a second private key use right sent by the first terminal every first preset period, wherein the second private key use right is obtained by updating a private key of the first terminal by the first terminal;
processing the bill according to the second private key use right and the intelligent contract to obtain a second digital signature;
And sending the bill and the second digital signature to a second terminal corresponding to a second terminal identifier included in the bill information, so that the second terminal obtains the bill.
4. A method according to any one of claims 1-3, wherein the number of ticket information is a plurality, and the generating a ticket for the first terminal based on the ticket information comprises:
determining target bill information containing the same second terminal identifier in the bill information;
and generating a bill for the first terminal according to each target bill information.
5. A method according to any one of claims 1-3, wherein the number of ticket information is a plurality, and the generating a ticket for the first terminal based on the ticket information comprises:
determining a plurality of second terminals corresponding to the second terminal identifiers contained in the bill information;
determining the credit rating of each second terminal;
Determining a target second terminal identifier corresponding to the highest credit level in the credit levels;
and generating a bill for the first terminal according to the bill information corresponding to the target second terminal identifier.
6. The method of claim 5, wherein the determining the credit rating of each second terminal comprises:
Acquiring the total transaction times and the successful transaction times of each second terminal in a second preset period;
And determining the credit level of each second terminal according to the total transaction times and the successful transaction times of each second terminal.
7. A bill handling apparatus, comprising:
The receiving module is used for receiving a bill acquisition request sent by the first terminal, wherein the bill acquisition request comprises bill information;
The generation module is used for generating a bill for the first terminal according to the bill information; generating notification information, wherein the notification information comprises the generation time of the bill, the node identifier of service node equipment and the terminal identifier of the first terminal;
The sending module is used for sending the notification information to the consensus node equipment so that the consensus node equipment can perform uplink processing on the notification information;
the processing module is used for calling the intelligent contract and determining that the service node equipment is authorized to use the private key of the first terminal through the first private key use right of the first terminal; calling a private key of the first terminal through the intelligent contract to process the bill to obtain a first digital signature;
the sending module is further configured to send the ticket and the first digital signature to a second terminal corresponding to a second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.
8. A ticket processing apparatus comprising a processor and a memory, the processor and memory being interconnected, wherein the memory is adapted to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any of claims 1-6.
9. A computer storage medium storing a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910966717.4A CN110750808B (en) | 2019-10-10 | 2019-10-10 | Bill processing method and device and storage medium device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910966717.4A CN110750808B (en) | 2019-10-10 | 2019-10-10 | Bill processing method and device and storage medium device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110750808A CN110750808A (en) | 2020-02-04 |
CN110750808B true CN110750808B (en) | 2024-05-17 |
Family
ID=69277996
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910966717.4A Active CN110750808B (en) | 2019-10-10 | 2019-10-10 | Bill processing method and device and storage medium device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110750808B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001265687A (en) * | 2000-03-17 | 2001-09-28 | Canon Inc | Network system, device and method for accounting processing and computer readable storage medium |
CN105515768A (en) * | 2016-01-08 | 2016-04-20 | 腾讯科技(深圳)有限公司 | Method, device and system for updating secret key |
CN108632284A (en) * | 2018-05-10 | 2018-10-09 | 网易(杭州)网络有限公司 | User data authorization method, medium, device and computing device based on block chain |
CN110060111A (en) * | 2018-12-12 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Based on the invoice access method and device of block chain, electronic equipment |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040088576A1 (en) * | 2002-10-31 | 2004-05-06 | Foster Ward Scott | Secure resource access |
-
2019
- 2019-10-10 CN CN201910966717.4A patent/CN110750808B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001265687A (en) * | 2000-03-17 | 2001-09-28 | Canon Inc | Network system, device and method for accounting processing and computer readable storage medium |
CN105515768A (en) * | 2016-01-08 | 2016-04-20 | 腾讯科技(深圳)有限公司 | Method, device and system for updating secret key |
CN108632284A (en) * | 2018-05-10 | 2018-10-09 | 网易(杭州)网络有限公司 | User data authorization method, medium, device and computing device based on block chain |
CN110060111A (en) * | 2018-12-12 | 2019-07-26 | 阿里巴巴集团控股有限公司 | Based on the invoice access method and device of block chain, electronic equipment |
Non-Patent Citations (1)
Title |
---|
区块链技术的研析及其在商业银行领域的应用建议;缪锦春;;邵阳学院学报(社会科学版)(03);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110750808A (en) | 2020-02-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110365670B (en) | Blacklist sharing method and device, computer equipment and storage medium | |
CN111506901B (en) | Block chain-based data processing method, terminal and storage medium | |
CN109886026B (en) | Data storage query method, device, computer system and readable storage medium | |
CN110633963B (en) | Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device | |
CN111444273B (en) | Data authorization method and device based on block chain | |
CN113537984A (en) | Content verification method and device based on block chain and electronic equipment | |
CN113468602B (en) | Data inspection method, device and equipment | |
CN111460525B (en) | Block chain-based data processing method, device and storage medium | |
CN111107066A (en) | Sensitive data transmission method and system, electronic equipment and storage medium | |
US12107856B2 (en) | Secure management and provisioning of interaction data using permissioned distributed ledgers | |
CN106487518A (en) | A kind of real-name authentication system and method for express delivery industry | |
CN108734018B (en) | Authentication method, device, system and computer readable storage medium | |
CN110932859B (en) | User information processing method, device and equipment and readable storage medium | |
CN113572715A (en) | Data transmission method and system based on block chain | |
CN110084600B (en) | Processing and verifying method, device, equipment and medium for resolution transaction request | |
CN109741016B (en) | Electronic contract signing method, electronic contract signing device, computer equipment and storage medium | |
EP2110981A1 (en) | Personal information managing device for preventing personal information form being falsely altered and preventing personal information from being denied | |
CN111161056A (en) | Method, system and equipment for improving transaction security of digital assets | |
CN109347865B (en) | User data authentication and evidence storage method and system based on block chain technology | |
CN111814193B (en) | Information sharing method, device and equipment | |
CN111294203A (en) | Information transmission method | |
CN111062059B (en) | Method and device for service processing | |
CN113868713B (en) | Data verification method and device, electronic equipment and storage medium | |
CN107423583A (en) | A kind of software protecting device remapping method and device | |
CN116976890A (en) | Multi-sign encryption transaction system of block chain |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40020188 Country of ref document: HK |
|
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |