CN110750808B - A bill processing method, device and storage medium device - Google Patents

A bill processing method, device and storage medium device Download PDF

Info

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
private key
ticket
information
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
Application number
CN201910966717.4A
Other languages
Chinese (zh)
Other versions
CN110750808A (en
Inventor
蔡弋戈
秦青
戴传兵
张懿方
张建俊
王宗友
郑罗海
蓝虎
郭鹏
洪晓雯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910966717.4A priority Critical patent/CN110750808B/en
Publication of CN110750808A publication Critical patent/CN110750808A/en
Application granted granted Critical
Publication of CN110750808B publication Critical patent/CN110750808B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting 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

一种票据处理方法、装置及存储介质装置A bill processing method, device and storage medium device

技术领域Technical Field

本申请涉及通信技术领域,尤其涉及一种票据处理方法、装置及存储介质装置。The present application relates to the field of communication technology, and in particular to a bill processing method, device and storage medium device.

背景技术Background technique

目前,许多企业将票据生成操作授权给第三方服务商,即票据服务商,由票据服务商根据企业发送的票据信息为企业生成票据。At present, many enterprises authorize the bill generation operation to a third-party service provider, namely the bill service provider, and the bill service provider generates bills for the enterprise based on the bill information sent by the enterprise.

企业对票据服务商授权后,会将企业的私钥发送给票据服务商,使得票据服务商为企业生成票据后,使用企业的私钥对票据进行处理,加密票据且表明生成的票据得到了企业的认可,但该方式存在企业私钥泄露的风险。After the enterprise authorizes the bill service provider, it will send the enterprise's private key to the bill service provider. After the bill service provider generates a bill for the enterprise, it will use the enterprise's private key to process the bill, encrypt the bill and indicate that the generated bill has been approved by the enterprise. However, this method has the risk of leakage of the enterprise's private key.

发明内容Summary of the invention

本发明实施例提供了一种票据处理方法、装置及存储介质装置,实施本发明,可提高私钥的安全性。The embodiments of the present invention provide a bill processing method, device and storage medium device. The implementation of the present invention can improve the security of private keys.

第一方面,本发明实施例提供了一种票据处理方法,该方法包括:In a first aspect, an embodiment of the present invention provides a bill processing method, the method comprising:

接收第一终端发送的票据获取请求,票据获取请求包括票据信息;根据票据信息为第一终端生成票据;根据第一终端的第一私钥使用权和智能合约,对票据进行处理,得到第一数字签名;将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。Receive a ticket acquisition request sent by a first terminal, the ticket acquisition request including ticket information; generate a ticket for the first terminal according to the ticket information; process the ticket according to the first private key usage right and the smart contract of the first terminal to obtain a first digital signature; 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 this technical solution, the business node device generates a ticket for the first terminal based on the ticket information from the first terminal, and then encrypts the ticket based on the first private key usage right of the first terminal and the smart contract, and sends the encrypted ticket to the second terminal corresponding to the second terminal identifier included in the ticket information. During the entire ticket generation process, the business node device does not obtain the private key of the first terminal, but only obtains the right to use the first private key of the first terminal, which can improve the security of the private key of the first terminal.

第二方面,本发明提供了一种票据处理装置,该装置包括:In a second aspect, the present invention provides a bill processing device, the device comprising:

接收模块,用于接收第一终端发送的票据获取请求,票据获取请求包括票据信息;A receiving module, configured to receive a ticket acquisition request sent by the first terminal, wherein the ticket acquisition request includes ticket information;

生成模块,用于根据票据信息为第一终端生成票据;A generating module, used for generating a ticket for the first terminal according to the ticket information;

处理模块,用于根据第一终端的第一私钥使用权和智能合约,对票据进行处理,得到第一数字签名;A processing module, configured to process the bill according to the first private key usage right of the first terminal and the smart contract to obtain a first digital signature;

发送模块,用于将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The sending module is used to send the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.

第三方面,本发明实施例提供了一种票据处理装置,其特征在于,包括处理器和存储器,所述处理器和存储器相互连接,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行第一方面的所述方法。In a third aspect, an embodiment of the present invention provides a bill processing device, characterized in that it includes a processor and a memory, and the processor and the memory are interconnected, wherein the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.

第四方面,本发明提供了一种计算机存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行第一方面的所述方法。In a fourth aspect, the present invention provides a computer storage medium, characterized in that the computer storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method of the first aspect.

通过实施本发明例,业务节点设备在只获得第一终端的第一私钥使用权的情况下,为第一终端生成票据,并根据第一私钥使用权和智能合约对所述票据进行加密处理,该方法可提高第一终端的私钥的安全性。若第一终端对所述第一终端的私钥进行了更新,该私钥对应的私钥使用权也将失效,此时,业务节点设备可以向第一终端发送更新请求,请求更新第一终端更新私钥后对应的第二私钥使用权,或业务节点设备每间隔第一预设周期接收第一终端发送的第二私钥使用权,该方法使得即使第一终端更新了所述第一终端的私钥,业务节点设备仍然可获得更新私钥后对应的私钥使用权。同时,业务节点设备可以根据票据信息中包含相同第二终端标识的目标票据信息或票据信息中第二终端标识对应的第二终端的信用等级最高的目标票据信息为第一终端生成票据,可提高业务节点设备生成票据的效率。By implementing the example of the present invention, the service node device generates a ticket for the first terminal when only obtaining the first private key usage right of the first terminal, and encrypts the ticket according to the first private key usage right and the smart contract. This method can improve the security of the private key of the first terminal. If the first terminal updates the private key of the first terminal, the private key usage right corresponding to the private key will also become invalid. At this time, the service node device can send an update request to the first terminal to request the update of 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 at intervals of a first preset period. This method enables the service node device to obtain the corresponding private key usage right after the private key is updated even if the first terminal updates the private key of the first terminal. At the same time, the service node device can generate a ticket for the first terminal according to the target ticket information containing the same second terminal identifier in the ticket information or the target ticket information with the highest credit rating of the second terminal corresponding to the second terminal identifier in the ticket information, which can improve the efficiency of the service node device in generating tickets.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或背景技术中的技术方案,下面将对本发明实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

为了更清楚地说明本发明实施例或背景技术中的技术方案,下面将对本发明实施例或背景技术中所需要使用的附图进行说明。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the background technology, the drawings required for use in the embodiments of the present invention or the background technology will be described below.

图1为目前一种区块链电子发票生成的流程示意图;Figure 1 is a schematic diagram of the current process of blockchain electronic invoice generation;

图2为本发明实施例提供的一种票据处理系统的架构示意图;FIG2 is a schematic diagram of the architecture of a bill processing system provided by an embodiment of the present invention;

图3为本发明实施例提供的一种票据处理方法的流程示意图;FIG3 is a schematic diagram of a flow chart of a bill processing method provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种票据处理方法的流程示意图;FIG4 is a schematic flow chart of another bill processing method provided by an embodiment of the present invention;

图5为本发明实施例提供的另一种票据处理方法的流程示意图;FIG5 is a schematic diagram of a flow chart of another bill processing method provided by an embodiment of the present invention;

图6为本发明实施例提供的一种票据处理装置的结构示意图;FIG6 is a schematic diagram of the structure of a bill processing device provided by an embodiment of the present invention;

图7为本发明实施例提供的另一种票据处理装置的结构示意图。FIG. 7 is a schematic diagram of the structure of another bill processing device provided in an embodiment of the present invention.

具体实施方式Detailed ways

下面结合本发明实施例中的附图对本发明实施例进行描述。The embodiments of the present invention are described below in conjunction with the accompanying drawings in the embodiments of the present invention.

目前,区块链电子发票的生成过程如图1所示,企业A将票据的生成操作授权给票据服务商,当卖方(企业A)与买方(企业B)进行交易后,生成交易信息,企业A需根据交易信息给企业B开具发票,此时企业A将根据交易信息生成的票据信息和所述企业A的私钥发送至票据服务商,票服务商根据票据信息为企业A生成票据,再使用企业A的私钥对票据进行处理,加密该票据且让票据的生成得到了企业A的认可,最后将处理后的票据发送至买方企业B,使得企业B获得该票据。该票据生成过程中,票据服务商可以获得企业A的私钥,存在企业A的私钥被泄露的风险。At present, the generation process of blockchain electronic invoices is shown in Figure 1. Enterprise A authorizes the bill generation operation to the bill service provider. When the seller (Enterprise A) and the buyer (Enterprise B) conduct a transaction, transaction information is generated. Enterprise A needs to issue an invoice to Enterprise B based on the transaction information. At this time, Enterprise A sends the bill information generated based on the transaction information and the private key of Enterprise A to the bill service provider. The bill service provider generates a bill for Enterprise A based on the bill information, and then uses the private key of Enterprise A to process the bill, encrypt the bill, and allow the generation of the bill to be recognized by Enterprise A. Finally, the processed bill is sent to the buyer Enterprise B, so that Enterprise B obtains the bill. During the bill generation process, the bill service provider can obtain the private key of Enterprise A, and there is a risk that the private key of Enterprise A will be leaked.

本发明实施例提出了一种票据处理方法、装置及存储介质装置。该方法中,第一终端将票据生成操作授权给区块链网络中的业务节点设备,当第一终端和第二终端完成交易,第一终端需要业务节点设备为其生成票据时,第一终端将票据获取请求发送至业务节点设备,票据获取请求包括票据信息,业务节点设备根据票据信息为第一终端生成票据,并根据第一终端的第一私钥使用权和智能合约对票据进行处理,得到第一数字签名,最后将票据和第一数字签名发送至票据信息包含的第二终端标识对应的第二终端,以使第二终端获取该票据。该方式中,业务节点设备只获得了第一终端的私钥使用权,而未获得第一终端的私钥,不会存在第一终端的私钥被泄露的风险,可提高私钥的安全性。The embodiment of the present invention proposes a bill processing method, device and storage medium device. In this method, the first terminal authorizes the bill generation operation to the business node device in the blockchain network. When the first terminal and the second terminal complete the transaction, and the first terminal needs the business node device to generate a bill for it, the first terminal sends a bill acquisition request to the business node device. The bill acquisition request includes bill information. The business node device generates a bill for the first terminal according to the bill information, and processes the bill according to the first private key usage right of the first terminal and the smart contract to obtain a first digital signature. Finally, the bill and the first digital signature are sent to the second terminal corresponding to the second terminal identifier included in the bill information, so that the second terminal obtains the bill. In this way, the business node device only obtains the right to use the private key of the first terminal, but does not obtain the private key of the first terminal. There is no risk of the private key of the first terminal being leaked, which can improve the security of the private key.

在票据处理过程中,以第一终端为卖方,以第二终端为买方,以业务节点设备为票据服务商为例,票据服务商可为卖方开具发票。当卖方与买方完成交易后,卖方需为买方开具发票,此时票据服务商可以帮卖方实现开票操作,因此,卖方将票据获取请求发送至票据服务商,票据获取请求包括票据信息;票据服务商根据票据信息为卖方开具发票,并根据卖方的私钥使用权和智能合约对票据进行处理,得到第一数字签名;最后,票据服务商将票据和第一数字签名发送至买方,以使买方获得该票据。此发票开具过程中,票据服务商只获得了卖方的私钥使用权,而未得到卖方的私钥,因此可提高私钥的安全性。In the process of bill processing, taking the first terminal as the seller, the second terminal as the buyer, and the business node device as the bill service provider as an example, the bill service provider can issue an invoice for the seller. When the seller and the buyer complete the transaction, the seller needs to issue an invoice for the buyer. At this time, the bill service provider can help the seller to implement the invoicing operation. Therefore, the seller sends a bill acquisition request to the bill service provider, and the bill acquisition request includes bill information; the bill service provider issues an invoice for the seller based on the bill information, and processes the bill based on the seller's private key usage rights and smart contracts to obtain the first digital signature; finally, the bill service provider sends the bill and the first digital signature to the buyer so that the buyer can obtain the bill. In this invoice issuance process, the bill service provider only obtains the seller's private key usage rights, but does not obtain the seller's private key, so the security of the private key can be improved.

区块链是一种分布式数据存储、共识机制和加密算法等计算机技术的新型应用模式,其本质上是一个去中心化的数据库;区块链可由多个借由密码学串接并保护内容的串连交易记录(又称区块)构成,用区块链所串接的分布式账本能让多方有效记录交易,且可永久查验此交易(不可篡改)。Blockchain is a new application model of computer technologies such as distributed data storage, consensus mechanism and encryption algorithm. It is essentially a decentralized database. Blockchain can be composed of multiple serial transaction records (also known as blocks) that are connected and protected by cryptography. The distributed ledger connected by blockchain allows multiple parties to effectively record transactions and can permanently check the transactions (cannot be tampered with).

在本申请的票据处理过程中,区块链上的业务节点设备存储有智能合约,可以通过智能合约和第一终端的私钥使用权对票据进行处理,得到第一数字签名。其中,智能合约是一种旨在以信息化方式传播、验证或执行合同的计算机协议,允许在没有第三方的情况下进行可信交易,这些交易可追踪且不可逆转。一个智能合约是一套以数字形式定义的承诺,包括合约参与方可以在上面执行这些承诺的协议,是一段写在区块链上的代码。In the bill processing process of the present application, the business node device on the blockchain stores a smart contract, and the bill can be processed through the smart contract and the private key usage right of the first terminal to obtain the first digital signature. Among them, a smart contract is a computer protocol designed to disseminate, verify or execute a contract in an information-based manner, allowing trusted transactions without a third party, which are traceable and irreversible. A smart contract is a set of commitments defined in digital form, including an agreement on which the contract participants can execute these commitments, and is a piece of code written on the blockchain.

为了更好的理解本发明实施例公开的一种票据处理方法、装置及存储介质装置,下面首先对本发明实施例适用的系统的架构进行描述。In order to better understand the bill processing method, device and storage medium device disclosed in the embodiments of the present invention, the architecture of the system to which the embodiments of the present invention are applicable is first described below.

请参见图2,图2是本发明实施例提供的一种票据处理系统的架构示意图。如图2所示,该系统由第一终端201、第二终端202和区块链网络203组成,区块链网络203包括业务节点设备2031和共识节点设备2032,区块链网络中可以有多个共识节点设备,共识节点设备用于对来自业务节点设备的通知信息进行上链处理,业务节点设备用于为第一终端生成票据。第一终端和第二终端在区块链网络外,不参与上链过程,且不存储区块链网络内的信息。图2所示的系统架构仅用于示例,并不构成对本发明实施例的限定。Please refer to Figure 2, which is a schematic diagram of the architecture of a bill processing system provided by an embodiment of the present invention. As shown in Figure 2, the system is composed of a first terminal 201, a second terminal 202 and a blockchain network 203. The blockchain network 203 includes a business node device 2031 and a consensus node device 2032. There can be multiple consensus node devices in the blockchain network. The consensus node device is used to process the notification information from the business node device on the chain, and the business node device is used to generate a bill for the first terminal. The first terminal and the second terminal are outside the blockchain network, do not participate in the chain process, and do not store information in the blockchain network. The system architecture shown in Figure 2 is for example only and does not constitute a limitation on the embodiments of the present invention.

其中,第一终端可以为交易过程中的卖方所使用的终端设备,第二终端可以为交易过程中的买方使用的终端设备,可选的,第一终端可以为交易过程中的买方使用的终端设备,第二终端可以为交易过程中的卖方使用的终端设备,为了方便描述,后续除特殊说明外,本发明实施例中的第一终端为交易过程中的卖方使用的终端设备,第二终端为交易过程中的买方使用的终端设备。Among them, the first terminal can be a terminal device used by the seller during the transaction process, and the second terminal can be a terminal device used by the buyer during the transaction process. Optionally, the first terminal can be a terminal device used by the buyer during the transaction process, and the second terminal can be a terminal device used by the seller during the transaction process. For the convenience of description, unless otherwise specified, the first terminal in the embodiment of the present invention is a terminal device used by the seller during the transaction process, and the second terminal is a terminal device used by the buyer during the transaction process.

第一终端和第二终端可以包括但不限于:智能手机(如Android手机、iOS手机等)、平板电脑、便携式个人计算机、智能可穿戴设备等设备,这些终端设备具备网络通信等功能。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, smart wearable devices and other devices, and these terminal devices have functions such as network communication.

基于上述描述,本发明实施例提出一种如图3所示的票据处理方法,该票据处理方法可以包括S301-S308:Based on the above description, the embodiment of the present invention proposes a bill processing method as shown in FIG3 . The bill processing method may include S301-S308:

S301:第一终端将票据获取请求发送至业务节点设备,票据获取请求包括票据信息。S301: The first terminal sends a ticket acquisition request to a service node device, where the ticket acquisition request includes ticket information.

具体的,当第一终端和第二终端完成交易之后,第一终端需要根据交易信息为第二终端提供票据,此时,第一终端将票据获取请求发送至业务节点设备,以使业务节点设备为第一终端生成票据,票据获取请求包括票据信息,票据信息包括开票方和受票方的相关信息,例如开票方和受票方的企业、税号、单位地址、电话号码等。Specifically, after the first terminal and the second terminal complete the transaction, the first terminal needs to provide a ticket to the second terminal based on the transaction information. At this time, the first terminal sends a ticket acquisition request to the business node device so that the business 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 recipient, such as the company, tax number, unit address, telephone number, etc. of the issuer and the recipient.

S302:业务节点设备根据票据信息为第一种终端生成票据。S302: The service node device generates a ticket for the first terminal according to the ticket information.

业务节点设备接收到来自第一终端的票据获取请求之后,表明第一终端有票据获取需求,则业务节点设备根据票据获取请求包含的票据信息为第一终端生成票据。After the service node device receives the ticket acquisition request from the first terminal, indicating that the first terminal has a ticket acquisition requirement, the service node device generates a ticket for the first terminal according to the ticket information included in the ticket acquisition request.

在一种实现方式中,业务节点设备根据票据信息为第一终端生成票据之前,业务节点设备对票据获取请求进行校验,票据获取请求中包括票据获取请求发送方的身份信息,业务节点设备对票据获取请求的校验可以包括:校验票据获取请求发送方的身份,即校验第一终端的身份,进而提高票据获取请求的可信度。具体的,业务节点设备使用第一终端创建的公钥对票据获取请求进行校验,若校验成功,则表明票据获取请求的发送方为发送该票据获取请求的第一终端,业务节点设备对票据获取请求校验成功。通过这种方式,有利于提高票据获取请求的可信度,即提高票据信息和第一私钥使用权的可信度。In one implementation, before the service node device generates a ticket for the first terminal based on the ticket information, the service node device verifies the ticket acquisition request, which includes the identity information of the sender of the ticket acquisition request. The service node device's verification of the ticket acquisition request may include: verifying the identity of the sender of the ticket acquisition request, that is, verifying the identity of the first terminal, thereby improving the credibility of the ticket acquisition request. Specifically, the service node device uses the public key created by the first terminal to verify the ticket acquisition request. If the verification is successful, it indicates that the sender of the ticket acquisition request is the first terminal that sent the ticket acquisition request, and the service node device successfully verifies the ticket acquisition request. In this way, it is helpful to improve the credibility of the ticket acquisition request, that is, to improve the credibility of the ticket information and the right to use the first private key.

S303:业务节点设备生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识。S303: The service node device generates notification information, where the notification information includes the generation time of the ticket, the node identifier of the service node device, and the terminal identifier of the first terminal.

具体的,业务节点设备为第一终端生成票据之后,业务节点设备生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识,通知信息用于通知共识节点设备将通知信息进行上链处理,使得通知信息以区块的方式进行分布式数据存储。Specifically, after the business node device generates a ticket for the first terminal, the business node device generates notification information, which includes the generation time of the ticket, the node identifier of the business node device and the terminal identifier of the first terminal. The notification information is used to notify the consensus node device to process the notification information on the chain, so that the notification information is stored in a distributed data manner in the form of blocks.

在一种实现方式中,通知信息包括票据的生成时间、业务节点设备的节点标识、第一终端的终端标识和票据信息,以使共识节点设备不仅存储票据生成过程中的参与方和时间,还将票据信息也进行上链处理,存储在共识节点设备上,使其不被篡改,可为后续的票据问题提供可查证据。In one implementation, the notification information includes the generation time of the ticket, the node identifier of the business node device, the terminal identifier of the first terminal, and the ticket information, so that the consensus node device not only stores the participants and time in the ticket generation process, but also processes the ticket information on the chain and stores it on the consensus node device to prevent it from being tampered with, thereby providing verifiable evidence for subsequent ticket issues.

S304:业务节点设备将通知信息发送至共识节点设备。S304: The service node device sends the notification information to the consensus node device.

业务节点设备生成通知信息后,将所述通知信息发送至共识节点设备,以使共识节点设备对通知信息进行上链处理。After the service node device generates the notification information, it sends the notification information to the consensus node device so that the consensus node device processes the notification information on the chain.

S305:共识节点设备对通知信息进行校验。S305: The consensus node device verifies the notification information.

共识节点设备接收到通知信息后,对通知信息进行校验。通知信息包括通知信息发送方的身份信息,共识节点设备对通知信息的校验可以包括:校验通知信息发送方的身份,即校验业务节点设备的身份,进而提高通知信息的可信度。具体的,共识节点设备使用业务节点设备创建的公钥对通知信息进行校验,若校验成功,则表明通知信息的发送方为发送该通知信息的业务节点设备,共识节点设备对通知信息校验成功。通过这种方式,有利于提高通知信息的可信度。After receiving the notification information, the consensus node device verifies the notification information. The notification information includes the identity information of the sender of the notification information. The verification of the notification information by the consensus node device may include: verifying the identity of the sender of the notification information, that is, verifying the identity of the business node device, thereby improving the credibility of the notification information. Specifically, the consensus node device uses the public key created by the business node device to verify the notification information. If the verification is successful, it indicates that the sender of the notification information is the business node device that sent the notification information, and the consensus node device successfully verifies the notification information. In this way, it is helpful to improve the credibility of the notification information.

在一种实现方式中,共识节点设备对通知信息校验成功后,将通知信息发送至各个共识节点设备,以使各个共识节点设备对通知信息进行校验。在共识节点设备对通知信息校验成功的情况下,才将通知信息发送给区块链网络中的各个共识节点设备,可以提高通知信息的可信度。区块链网络中的各个共识节点设备对通知信息进行校验,并将针对通知信息的校验结果以通知信息校验响应的形式发送给接收通知信息的共识节点设备。In one implementation, after the consensus node device successfully verifies the notification information, it sends the notification information to each consensus node device so that each consensus node device verifies the notification information. Only when the consensus node device successfully verifies the notification information, the notification information is sent to each consensus node device in the blockchain network, which can improve the credibility of the notification information. Each consensus node device in the blockchain network verifies the notification information and sends the verification result of the notification information to the consensus node device receiving the notification information in the form of a notification information verification response.

具体的,各个共识节点设备对通知信息的校验和上述共识节点设备对通知信息的校验方式相同,在此不再赘述。不管共识节点设备对通知信息的校验结果为通过或者不通过,各个共识节点设备均可以向接收通知信息的共识节点设备发送通知信息的校验响应。其中,来自区块链网络中的各个共识节点设备的通知信息校验响应所包含的针对通知信息的校验结果可以是相互独立的。Specifically, the verification of notification information by each consensus node device is the same as the verification method of notification information by the above-mentioned consensus node device, which will not be repeated here. Regardless of whether the verification result of the notification information by the consensus node device is passed or failed, each consensus node device can send a verification response of the notification information to the consensus node device receiving the notification information. Among them, the verification results for the notification information contained in the notification information verification response from each consensus node device in the blockchain network can be independent of each other.

接收通知信息的共识节点设备根据通知信息校验响应,得到通知信息校验结果,进而确定通知信息是否通过区块链网络的校验,即票据信息校验结果是根据区块链网络中的各个共识节点设备返回的通知信息校验响应共同确定的。通过这种方式,可以使得区块链网络中的共识节点设备均参与针对通知信息的校验过程,有利于提高通知信息的可信度。The consensus node device that receives the notification information obtains the verification result of the notification information based on the verification response of the notification information, and then determines whether the notification information has passed the verification of the blockchain network, that is, the verification result of the bill information is jointly determined based on the verification response of the notification information returned by each consensus node device in the blockchain network. In this way, all consensus node devices in the blockchain network can participate in the verification process for the notification information, which is conducive to improving the credibility of the notification information.

在一种实现方式中,各个共识节点设备对通知信息的校验响应包含的校验结果为通过的数量大于预设阈值,则接收通知信息的共识节点设备确定通知信息通过区块链网络的校验。例如,预设阈值为区块链网络中共识节点设备数量的50%,若该区块链网络由45个共识节点设备组成,有26个共识节点设备对通知信息的校验结果为校验通过,区块链网络中共识节点设备对通知信息的校验结果为通过的数量大于预设阈值,则共识节点设备确定通知信息通过区块链网络中各个共识节点设备的校验。In one implementation, if the number of verification results of each consensus node device for verification of the notification information is greater than a preset threshold, the consensus node device receiving the notification information determines that the notification information has passed the verification of the blockchain network. For example, the preset threshold is 50% of the number of consensus node devices in the blockchain network. If the blockchain network consists of 45 consensus node devices, 26 consensus node devices have a verification result of passing the verification of the notification information, and the number of verification results of the consensus node devices in the blockchain network for the notification information is greater than the preset threshold, the consensus node device determines that the notification information has passed the verification of each consensus node device in the blockchain network.

S306:若对通知信息校验成功,则共识节点设备对通知信息进行上链处理。S306: If the notification information is successfully verified, the consensus node device processes the notification information on the chain.

具体的,若共识节点设备对通知信息校验成功,则对通知信息进行上链处理,以生成包括通知信息的区块,使得通知信息以区块的方式进行分布式数据存储,使其不易被篡改。业务节点设备每次生成票据后,都将关于票据的通知信息发送至共识节点设备,共识节点设备对通知信息进行上链处理,可以记录每次业务节点设备为第一终端生成票据的时间和信息,可为后续出现的不认可问题提供可查依据。Specifically, if the consensus node device successfully verifies the notification information, it processes the notification information on the chain to generate a block including the notification information, so that the notification information is stored in a distributed data form in the form of blocks, making it difficult to be tampered with. Each time the business node device generates a bill, it sends the notification information about the bill to the consensus node device. The consensus node device processes the notification information on the chain, and can record the time and information of each time the business node device generates a bill for the first terminal, which can provide a traceable basis for subsequent non-recognition issues.

在一种实现方式中,若通知信息包括票据信息,则共识节点设备对通知信息进行上链处理,使得票据信息也以区块的方式进行分布式存储,可为后续的票据问题提供可查证据。In one implementation, if the notification information includes ticket information, the consensus node device processes the notification information on the chain so that the ticket information is also distributed and stored in the form of blocks, which can provide verifiable evidence for subsequent ticket issues.

S307:业务节点设备根据第一私钥使用权和智能合约对票据进行处理,得到第一数字签名。S307: The business node device processes the bill according to the first private key usage right and the smart contract to obtain a first digital signature.

在一种实现方式中,第一终端为业务节点设备授权后,将所述第一终端的第一私钥使用权发送至业务节点设备,第一私钥使用权和第一终端的私钥相对应,第一私钥使用权用于业务节点设备对票据进行加密处理。可选的,当第一终端首次有票据获取需求时,第一终端将票据获取请求发送至业务节点设备,票据获取请求包括票据信息和第一终端的第一私钥使用权。In one implementation, after the first terminal is authorized by the service node device, the first terminal sends the first private key usage right of the first terminal 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 by the service node device to encrypt the ticket. Optionally, when the first terminal has a ticket acquisition requirement for the first time, the first terminal sends a ticket acquisition request to the service node device, and the ticket acquisition request includes ticket information and the first private key usage right of the first terminal.

业务节点设备为第一终端生成票据后,根据第一私钥使用权和智能合约对票据进行处理,得到第一数字签名,智能合约包含有根据私钥使用权对票据进行处理的程序代码。业务节点设备调用该程序代码,通过第一私钥使用权证明业务节点设备可以使用第一终端的私钥,可以在内部调用第一终端的私钥对票据进行处理。该处理过程中,业务节点设备未获得第一终端的私钥,只是在内部通过第一私钥使用权调用了私钥,私钥对于业务节点设备来说是未知的。该过程可以保护第一终端的私钥不被泄露。After the service node device generates a bill for the first terminal, it processes the bill according to the first private key usage right and the smart contract to obtain a first digital signature. The smart contract contains a program code for processing the bill according to the private key usage right. The service node device calls the program code, and proves through the first private key usage right that the service node device can use the private key of the first terminal, and can call the private key of the first terminal internally to process the bill. During this processing, 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. The private key is unknown to the service node device. This process can protect the private key of the first terminal from being leaked.

S308:业务节点设备将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端。S308: The service node device sends the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information.

业务节点设备得到第一数字签名,表明对票据处理成功,则将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端得到处理后的票据,且可使用第一终端的公钥对票据进行解密,获得此票据。The business node device obtains the first digital signature, indicating that the ticket is processed successfully, and then sends the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information, so that the second terminal obtains the processed ticket and can use the public key of the first terminal to decrypt the ticket to obtain the ticket.

该发明实施例中,业务节点设备可以只使用第一终端的私钥使用权对票据进行加密处理,而未得到第一终端的私钥,可提高第一终端私钥的安全性,且业务节点设备为第一终端生成票据后,共识节点设备可存储业务节点设备的每一次生成票据的时间和参与方,可为后续的处理问题提供可查证据。In the embodiment of the invention, the business node device can only use the private key usage right of the first terminal to encrypt the ticket without obtaining the private key of the first terminal, which can improve the security of the private key of the first terminal. After the business node device generates a ticket for the first terminal, the consensus node device can store the time and participants of each ticket generation by the business node device, which can provide traceable evidence for subsequent problem handling.

请参见图4,图4是本发明实施例提供的另一种票据处理方法的流程示意图,所述方法应用于业务节点设备,该方法包括但不限于S401-S410。Please refer to FIG. 4 , which is a flow chart of another bill processing method provided by an embodiment of the present invention. The method is applied to a service node device, and the method includes but is not limited to S401 - S410 .

S401:业务节点设备接收第一终端发送的票据获取请求信息,票据获取请求包括票据信息。S401: The service node device receives a ticket acquisition request message sent by a first terminal, where the ticket acquisition request message includes ticket information.

当第一终端有票据获取需求时,第一终端将票据获取请求发送至业务节点设备,进而,业务节点设备接收第一终端发送的票据获取请求,票据获取请求包括票据信息。When the first terminal has a ticket acquisition demand, the first terminal sends a ticket acquisition request to the service node device, and then the service node device receives the ticket acquisition request sent by the first terminal, where the ticket acquisition request includes ticket information.

S402:若票据信息的数量为多个,则业务节点设备确定多个票据信息中包含相同第二终端标识的目标票据信息。S402: If there are multiple ticket information, the service node device determines target ticket information containing the same second terminal identifier in the multiple ticket information.

在一种实现方式中,业务节点设备接收到的一个票据获取请求包括多个票据信息,因此票据信息的数量为多个。In one implementation, a ticket acquisition request received by the service node device includes multiple ticket information, so the number of ticket information is multiple.

在一种实现方式中,业务节点设备接收到的一个获取请求包括一个票据信息,若接收到来自第一终端发送的多个票据获取请求,则票据信息的数量为多个。In one implementation, one acquisition request received by the service node device includes one ticket information. If multiple ticket acquisition requests are received from the first terminal, the number of ticket information is multiple.

多个票据信息中可以包括不同的第二终端标识,同理,多个票据信息中也可以包括相同的第二终端标识。当票据信息的数量为多个时,业务节点设备确定多个票据信息中包含相同第二终端标识的目标票据信息,例如,业务节点设备接收到的票据信息为票据信息A,票据信息B、票据信息C和票据信息D,票据信息A、票据信息B、票据信息C和票据信息D包括的第二终端标识分别为终端标识1、终端标识2、终端标识3和终端标识2,票据信息A和票据信息D中包括相同的第二终端标识,则业务节点设备确定出包含相同第二终端标识的目标票据信息为票据信息A和票据信息D。A plurality of ticket information may include different second terminal identifiers. Similarly, a plurality of ticket information may also include the same second terminal identifier. When the number of ticket information is multiple, the service node device determines the target ticket information that includes the same second terminal identifier among the plurality of 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. Ticket information A and ticket information D include the same second terminal identifier. Then, the service node device determines that the target ticket information that includes the same second terminal identifier is ticket information A and ticket information D.

在一种实现方式中,多个票据信息中包括的第二终端标识没有相同的第二终端标识,则业务节点设备确定多个票据信息中不存在目标票据信息。In an implementation manner, if the second terminal identifiers included in the multiple ticket information do not have the same second terminal identifier, the service node device determines that the target ticket information does not exist in the multiple ticket information.

S403:业务节点设备根据各个目标票据信息为第一终端生成票据。S403: The service node device generates a ticket for the first terminal according to each target ticket information.

业务节点设备确定出多个票据信息中的目标票据信息后,根据各个目标票据信息为第一终端生成多个票据,每个票据的受票方都为目标票据信息中包括的第二终端标识对应的第二终端。通过根据目标票据信息生成票据的方式,可以让业务节点设备优先为票据信息中包含相同第二终端标识的第二终端提供票据,可以提高业务节点设备的开票效率。After the service node device determines the target ticket information among the multiple ticket information, it generates multiple tickets for the first terminal according to each target ticket information, and the recipient of each ticket is the second terminal corresponding to the second terminal identifier included in the target ticket information. By generating tickets according to the target ticket information, the service node device can give priority to providing tickets to the second terminal containing the same second terminal identifier in the ticket information, which can improve the invoicing efficiency of the service node device.

在一种实现方式中,若业务节点设备确定多个票据信息中不存在目标票据信息,则根据预设规则和各个票据信息为第一终端生成多个票据,预设规则为预先设定的规则。例如,预设规则为接收时间优先原则,则业务节点设备根据接收到各个票据信息的时间顺序,以此根据各个票据信息为第一终端生成多个票据。In one implementation, if the service node device determines that the target ticket information does not exist in the multiple ticket information, multiple tickets are generated for the first terminal according to a preset rule and each ticket information, where the preset rule is a pre-set rule. For example, if the preset rule is a receiving time priority principle, the service node device generates multiple tickets for the first terminal according to the time sequence of receiving each ticket information.

S404:业务节点设备生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识。S404: The service node device generates notification information, where the notification information includes the generation time of the ticket, the node identifier of the service node device, and the terminal identifier of the first terminal.

S405:业务节点设备将通知信息发送至共识节点设备,以使共识节点设备对通知信息进行上链处理。S405: The service node device sends the notification information to the consensus node device, so that the consensus node device processes the notification information on the chain.

本申请实施例中的步骤S404-S405具体可参见上述实施例中步骤S303-S304的执行过程,本发明实施例不再赘述。The specific details of steps S404-S405 in the embodiment of the present application can refer to the execution process of steps S303-S304 in the above embodiment, and will not be repeated in the embodiment of the present invention.

S406:业务节点设备根据第一私钥使用权和智能合约,对票据进行处理。S406: The business node device processes the bill according to the first private key usage right and the smart contract.

在一种实现方式中,第一终端为业务节点设备授权后,将所述第一终端的第一私钥使用权发送至业务节点设备,第一私钥使用权和第一终端的私钥相对应,第一私钥使用权用于业务节点设备对票据进行加密处理。可选的,当第一终端首次有票据获取需求时,第一终端将票据获取请求发送至业务节点设备,票据获取请求包括票据信息和第一终端的第一私钥使用权。In one implementation, after the first terminal is authorized by the service node device, the first terminal sends the first private key usage right of the first terminal 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 by the service node device to encrypt the ticket. Optionally, when the first terminal has a ticket acquisition requirement for the first time, the first terminal sends a ticket acquisition request to the service node device, and the ticket acquisition request includes ticket information and the first private key usage right of the first terminal.

业务节点设备为第一终端生成多个票据后,根据第一私钥使用权和智能合约对各个票据进行处理,得到多个第一数字签名,智能合约包含有根据第一私钥使用权对票据进行处理的程序代码。业务节点设备调用该程序代码,通过第一私钥使用权证明业务节点设备可以使用第一终端的私钥,可以在内部调用第一终端的私钥对各个票据进行处理,加密各个票据。After the service node device generates multiple bills for the first terminal, it processes each bill according to the first private key usage right and the smart contract to obtain multiple first digital signatures. The smart contract contains program code for processing the bill according to the first private key usage right. The service node device calls the program code, and proves that the service node device can use the private key of the first terminal through the first private key usage right, and can call the private key of the first terminal internally to process each bill and encrypt each bill.

该处理过程中,业务节点设备仍然未获得第一终端的私钥,只是在内部通过第一私钥使用权调用了私钥,私钥对于业务节点设备来说仍然是未知的,可以保护第一终端的私钥的安全。During this process, the service node device still does not obtain the private key of the first terminal, but only calls the private key internally through the first private key usage right. The private key is still unknown to the service node device, which can protect the security of the private key of the first terminal.

S407:若对票据处理失败,则业务节点设备向第一终端发送更新请求,更新请求用于请求更新第一私钥使用权。S407: If the ticket processing fails, the service node device sends an update request to the first terminal, where the update request is used to request an update of the right to use the first private key.

业务节点设备根据第一私钥使用权和智能合约对多个票据进行处理,若处理失败,则表明第一终端更新了所述第一终端的私钥,此时第一终端的私钥对应的第一私钥使用权失效,因此业务节点设备不能使用所述第一私钥使用权。业务节点设备向第一终端发送更新请求,请求更新第一终端更新私钥后对应的第一私钥使用权。The service node device processes multiple bills according to the first private key usage right and the smart contract. If the processing fails, it indicates that the first terminal has updated the private key of the first terminal. At this time, the first private key usage right corresponding to the private key of the first terminal is invalid, so the service node device cannot use the first private key usage right. The service node device sends an update request to the first terminal, requesting to update the first private key usage right corresponding to the first terminal after the private key is updated.

S408:业务节点设备接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的。S408: The service node device receives the second private key usage right sent by the first terminal, where the second private key usage right is obtained by the first terminal by updating the private key of the first terminal.

第一终端接收到业务节点设备发送的更新请求后,会将更新私钥对应的第二私钥使用权发送至业务节点设备,因此业务节点设备接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的。After the first terminal receives the update request sent by the business node device, it will send the second private key usage right corresponding to the updated private key to the business node device. Therefore, the business node device receives the second private key usage right sent by the first terminal. The second private key usage right is obtained by the first terminal by updating the private key of the first terminal.

S409:业务节点设备根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名。S409: The business node device processes the bill according to the second private key usage right and the smart contract to obtain a second digital signature.

业务节点设备接收到最新的第二私钥使用权后,根据第二私钥使用权和智能合约,对各个票据进行加密处理,得到多个第二数字签名。智能合约包含有根据私钥使用权对票据进行处理的程序代码。业务节点设备调用该程序代码,通过第一私钥使用权在内部调用第一终端的私钥对票据进行处理。After receiving the latest second private key usage rights, the service node device encrypts each bill according to the second private key usage rights and the smart contract to obtain multiple second digital signatures. The smart contract contains program code for processing bills according to the private key usage rights. The service node device calls the program code and processes the bill by internally calling the private key of the first terminal through the first private key usage rights.

该处理过程中,业务节点设备未获得第一终端的私钥,只是在内部通过第一私钥使用权调用了私钥,私钥对于业务节点设备来说是未知的。该过程可以使得第一终端的私钥不被泄露。In this process, 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. This process can prevent the private key of the first terminal from being leaked.

S410:业务节点设备将票据和第二数字签名发送至目标票据信息包含的第二终端标识对应的第二终端。S410: The service node device sends the ticket and the second digital signature to the second terminal corresponding to the second terminal identifier included in the target ticket information.

业务节点设备将各个票据和各个第二数字签名发送至目标票据信息包含的第二终端标识对应的第二终端,以使所述第二终端接收各个票据且使用第一终端创建的公钥对各个第二数字签名进行解密,得到多个票据。The service node device sends each ticket and each second digital signature to the second terminal corresponding to the second terminal identifier included in the target ticket information, so that the second terminal receives each ticket and decrypts each second digital signature using the public key created by the first terminal to obtain multiple tickets.

在本发明实施例中,票据信息的数量为多个,业务节点设备可以优先根据多个票据信息中包含的相同第二终端标识的目标票据信息,为第一终端生成票据,可提高业务节点设备生成票据的效率。同时,若业务节点设备在根据第一终端的第一私钥使用权对票据信息处理失败时,可向第一终端发送更新请求,得到第一终端更新私钥后对应的第二私钥使用权,进而根据第二私钥使用权对票据进行处理,该方式使得第一终端更新了私钥后,业务节点设备仍可以仅使用更新后私钥对应的私钥使用权对票据进行加密处理。该方式中,第一终端可不定时更新所述第一终端的私钥,可提高私钥的安全性。In an embodiment of the present invention, the number of ticket information is multiple, and the service node device can preferentially generate tickets for the first terminal based on the target ticket information with the same second terminal identifier contained in the multiple ticket information, which can improve the efficiency of the service node device in generating tickets. At the same time, if the service node device fails to process the ticket information according to the first private key usage right of the first terminal, it can send an update request to the first terminal to obtain the second private key usage right corresponding to the first terminal after the private key is updated, and then process the ticket according to the second private key usage right. This method allows the service node device to encrypt the ticket only using the private key usage right corresponding to the updated private key after the first terminal updates the private key. In this method, the first terminal can update the private key of the first terminal from time to time, which can improve the security of the private key.

请参见图5,图5是本发明实施例提供的另一种票据处理方法的流程示意图,该方法包括但不限于S501-S511。Please refer to FIG. 5 , which is a schematic flow chart of another bill processing method provided by an embodiment of the present invention, the method including but not limited to S501 - S511 .

S501:业务节点设备接收第一终端发送的票据获取请求信息,票据获取请求包括票据信息。S501: The service node device receives a ticket acquisition request message sent by a first terminal, where the ticket acquisition request message includes ticket information.

本申请实施例中的步骤S501具体可参见上述实施例中步骤S401的执行过程,本发明实施例不再赘述。The specific details of step S501 in the embodiment of the present application may refer to the execution process of step S401 in the above embodiment, and will not be repeated in the embodiment of the present invention.

S502:若票据信息的数量为多个,则业务节点设备确定各个票据信息中包含的第二终端标识对应的多个第二终端。S502: If there are multiple ticket information, the service node device determines multiple second terminals corresponding to the second terminal identifiers included in each ticket information.

业务节点设备接收到的一个票据获取请求包括多个票据信息,票据信息的数量为多个。可选的,业务节点设备接收到的一个票据获取请求包括一个票据信息,收到来自第一终端发送的多个票据获取请求,票据信息的数量为多个。A ticket acquisition request received by the service node device includes multiple ticket information, and the number of ticket information is multiple. Optionally, a ticket acquisition request received by the service node device includes a ticket information, and multiple ticket acquisition requests sent by the first terminal are received, and the number of ticket information is multiple.

每个票据信息中包括有一个第二终端标识。若票据信息的数量为多个,则业务节点设备通过各个票据信息中包含的第二终端标识,确定出各个票据信息包含的第二终端标识对应的多个第二终端。Each ticket information includes a second terminal identifier. If there are multiple ticket information, the service node device determines multiple second terminals corresponding to the second terminal identifiers included in each ticket information through the second terminal identifiers included in each ticket information.

S503:业务节点设备获取各个第二终端在预设周期内的交易总次数和交易成功次数。S503: The service node device obtains the total number of transactions and the number of successful transactions of each second terminal within a preset period.

各个第二终端可以多次与第一终端进行交易,每与第一终端交易一次就会产生一次交易记录,各个第二终端与第一终端的交易情况可能为交易成功,也可能为交易失败。业务节点设备在预设周期内,通过各个票据信息包括的第二终端标识,获取出各个第二终端与第一终端对应的交易总次数和交易成功次数,预设周期为第二预设周期,第二预设周期为预先设定的。Each second terminal can conduct transactions with the first terminal multiple times, and each transaction with the first terminal will generate a transaction record. The transaction status of each second terminal with the first terminal may be a successful transaction or a failed transaction. The service node device obtains the total number of transactions and the number of successful transactions corresponding to each second terminal with the first terminal through the second terminal identifier included in each ticket information within a preset period. The preset period is a second preset period, and the second preset period is pre-set.

S504:业务节点设备根据各个第二终端的交易总次数和交易成功次数,确定各个第二终端的信用等级。S504: The service node device determines the credit level of each second terminal according to the total number of transactions and the number of successful transactions of each second terminal.

具体的,业务节点设备根据各个第二终端的交易总次数和交易成功次数,确定各个第二终端的交易成功率,再根据各个第二终端的交易成功率确定各个第二终端的信用等级。Specifically, the service node device determines the transaction success rate of each second terminal according to the total number of transactions and the number of successful transactions of each second terminal, and then determines the credit level of each second terminal according to the transaction success rate of each second terminal.

示例性的,多个票据信息中包含的第二终端标识对应的第二终端为第二终端A、第二终端B和第二终端C,第二终端A的交易次数为26次,交易成功次数为17次,第二终端B的交易次数为12次,交易成功次数为4次,第二终端C的交易次数为45次,交易成功次数为31次,则第二终端A的交易成功率为65.4%,第二终端B的交易成功率为33.3%,第二终端C的交易成功率为68.9%,若用大写字母对三个第二终端的的信用等级进行排序,A代表信用等级最高的第二终端,则第二终端A、第二终端B和第二终端C的信用等级分别为B、C和A。第二终端的信用等级排序还可以用其他方式进行表示,如数字等,在此不做限定。For example, the second terminals corresponding to the second terminal identifiers included in the multiple bill information are second terminal A, second terminal B, and second terminal C. The number of transactions of second terminal A is 26, and the number of successful transactions is 17. The number of transactions of second terminal B is 12, and the number of successful transactions is 4. The number of transactions of second terminal C is 45, and the number of successful transactions is 31. Then, the transaction success rate of second terminal A is 65.4%, the transaction success rate of second terminal B is 33.3%, and the transaction success rate of second terminal C is 68.9%. If the credit ratings of the three second terminals are sorted by capital letters, A represents the second terminal with the highest credit rating, and the credit ratings of second terminal A, second terminal B, and second terminal C are B, C, and A, respectively. The credit rating ranking of the second terminal can also be expressed in other ways, such as numbers, etc., which are not limited here.

S505:业务节点设备确定各个信用等级中最高信用等级对应的目标第二终端标识。S505: The service node device determines a target second terminal identifier corresponding to the highest credit level among the credit levels.

业务节点设备确定出各个第二终端的信用等级后,确定各个信用等级中最高信用等级对应的目标第二终端标识。例如,业务节点设备确定的各个第二终端的信用等级如S504中所示,第二终端A、第二终端B和第二终端C的信用等级分别为B、C和A,则三个第二终端中信用等级最高的为第二终端C,则确定出各个信用等级中最高信用等级对应的目标第二终端标识为第二终端C的终端标识。After the service node device determines the credit level of each second terminal, it determines the target second terminal identifier corresponding to the highest credit level among the credit levels. For example, the credit levels of each second terminal determined by the service node device are as shown in S504, and the credit levels of the second terminal A, the second terminal B, and the second terminal C are B, C, and A, respectively. The second terminal C has the highest credit level among the three second terminals, and it is determined that the target second terminal identifier corresponding to the highest credit level among the credit levels is the terminal identifier of the second terminal C.

S506:业务节点设备根据目标第二终端标识对应的票据信息,为第一终端生成票据。S506: The service node device generates a ticket for the first terminal according to the ticket information corresponding to the target second terminal identifier.

具体的,业务节点设备根据目标第二终端标识确定出票据信息,再根据确定出的票据信息为第一终端生成票据。Specifically, the service node device determines the ticket information according to the target second terminal identifier, and then 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 one, and the service node device generates a ticket for the first terminal according to the determined ticket information.

在一种实现方式中,与目标第二终端标识对应的票据信息的数量为多个,业务节点设备根据确定出的多个票据信息为第一终端生成多个票据。In one implementation, there are multiple ticket information corresponding to the target second terminal identifier, and the service node device generates multiple tickets for the first terminal according to the multiple ticket information determined.

该方法中,业务节点设备是根据信用等级最高的第二终端的目标第二终端标识对应的票据信息生成票据,使得业务节点设备优先为信用等级最高的第二终端提供票据。信用等级高的第二终端与第一终端的交易成功的概率大于信用等级较低的第二终端,业务节点设备优先为信用等级高的第二终端提供票据,可减少后续因交易失败造成退税的次数。In this method, the service node device generates a bill according to the bill information corresponding to the target second terminal identifier of the second terminal with the highest credit rating, so that the service node device preferentially provides bills to the second terminal with the highest credit rating. The probability of successful transactions between the second terminal with a high credit rating and the first terminal is greater than that of the second terminal with a low credit rating. The service node device preferentially provides bills to the second terminal with a high credit rating, which can reduce the number of tax refunds caused by subsequent transaction failures.

S507:业务节点设备生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识。S507: The service node device generates notification information, where the notification information includes the generation time of the ticket, the node identifier of the service node device, and the terminal identifier of the first terminal.

S508:业务节点设备将通知信息发送至共识节点设备,以使共识节点设备对通知信息进行上链处理。S508: The service node device sends the notification information to the consensus node device, so that the consensus node device processes the notification information on the chain.

本申请实施例中的步骤S507-S508具体可参见上述实施例中步骤S404-S405的执行过程,本发明实施例不再赘述。The specific details of steps S507-S508 in the embodiment of the present application can refer to the execution process of steps S404-S405 in the above embodiment, and will not be repeated in the embodiment of the present invention.

S509:业务节点设备每间隔预设周期,接收第一终端发送的第二私钥使用权。S509: The service node device receives the second private key usage right sent by the first terminal at every preset period.

业务节点设备每间隔预设周期,接收第一终端发送的第二私钥使用权,预设周期为第一预设周期,第一预设周期为预先设定的,第二私钥使用权为第一终端通过对所述第一终端的私钥进行更新得到的。The service node device receives the second private key usage right sent by the first terminal at every preset period, the preset period is a first preset period, the first preset period is pre-set, and the second private key usage right is obtained by the first terminal by updating the private key of the first terminal.

业务节点设备每间第一隔预设周期,自动接收第一终端发送的第二私钥使用权,可使得每次使用的私钥使用权都是来自第一终端的最新私钥对应的私钥使用权。The service node device automatically receives the second private key usage right sent by the first terminal at every first preset period, so that the private key usage right used each time is the private key usage right corresponding to the latest private key from the first terminal.

S510:业务节点设备根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名。S510: The business node device processes the bill according to the second private key usage right and the smart contract to obtain a second digital signature.

S511:业务节点设备将票据和第二数字签名发送至目标票据信息包含的第二终端标识对应的第二终端。S511: The service node device sends the ticket and the second digital signature to the second terminal corresponding to the second terminal identifier included in the target ticket information.

本申请实施例中的步骤S510-S511具体可参见上述实施例中步骤S409-S410的执行过程,本发明实施例不再赘述。For details of steps S510-S511 in the embodiment of the present application, reference may be made to the execution process of steps S409-S410 in the above embodiment, which will not be described in detail in the embodiment of the present invention.

在本发明实施例中,业务节点设备可根据票据信息包括的第二终端标识对应的第二终端的信用等级,优先根据第二终端的信用等级最高对应的票据信息为第一终端生成票据,且业务节点设备可以在每间隔预设周期接收来自第一终端的第二私钥使用权,使得拥有的私钥使用权是第一终端更新所述第一终端的私钥后得到的私钥使用权,进而对票据处理时不会因私钥使用权失效,造成对对票据处理失败的情况。In an embodiment of the present invention, the business node device can generate a ticket for the first terminal based on the credit level of the second terminal corresponding to the second terminal identifier included in the ticket information, and give priority to the ticket information corresponding to the second terminal with the highest credit level. The business node device can receive the second private key usage right from the first terminal at every preset period, so that the private key usage right possessed is the private key usage right obtained by the first terminal after updating the private key of the first terminal, and thus the ticket processing will not fail due to the invalidation of the private key usage right.

请参见图6,图6是本发明实施例提供的一种票据处理装置的结构示意图,所述票据处理装置可以用于图3-图5所示实施例中业务节点设备所执行的步骤,所述票据处理装置60可以包括:Please refer to FIG. 6, which is a schematic diagram of the structure of a bill processing device provided in an embodiment of the present invention. The bill processing device can be used in the steps performed by the service node device in the embodiments shown in FIG. 3 to FIG. 5. The bill processing device 60 may include:

接收模块601,用于接收第一终端发送的票据获取请求,票据获取请求包括票据信息;The receiving module 601 is used to receive a ticket acquisition request sent by the first terminal, where the ticket acquisition request includes ticket information;

生成模块602,用于根据票据信息为第一终端生成票据;A generating module 602, configured to generate a ticket for the first terminal according to the ticket information;

处理模块603,用于根据第一终端的第一私钥使用权和智能合约,对票据进行处理,得到第一数字签名;A processing module 603 is used to process the bill according to the first private key usage right of the first terminal and the smart contract to obtain a first digital signature;

发送模块604,用于将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The sending module 604 is used to send the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.

在一种实现方式中,处理模块603,还用于若根据第一私钥使用权和智能合约,对票据处理失败,则通过发送模块604向第一终端发送更新请求,更新请求用于请求更新第一私钥使用权;In one implementation, the processing module 603 is further configured to send an update request to the first terminal through the sending module 604 if the bill processing fails according to the first private key usage right and the smart contract, and the update request is used to request to update the first private key usage right;

接收模块601,还用于接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的;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 the first terminal by updating the private key of the first terminal;

处理模块603,还用于根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名;The processing module 603 is further used to process the bill according to the second private key usage right and the smart contract to obtain a second digital signature;

发送模块604,还用于将票据和第二数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The sending module 604 is further configured to send the ticket and the second digital signature to a second terminal corresponding to the second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.

在一种实现方式中,接收模块601,还用于每间隔第一预设周期,接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的;In one implementation, the receiving module 601 is further configured to receive, at intervals of a first preset period, a second private key usage right sent by the first terminal, where the second private key usage right is obtained by the first terminal by updating the private key of the first terminal;

处理模块603,还用于根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名;The processing module 603 is further used to process the bill according to the second private key usage right and the smart contract to obtain a second digital signature;

发送模块604,还用于将票据和第二数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The sending module 604 is further configured to send the ticket and the second digital signature to a second terminal corresponding to the second terminal identifier included in the ticket information, so that the second terminal obtains the ticket.

在一种实现方式中,生成模块602根据票据信息为第一终端生成票据之后,生成模块602,还用于生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识;In one implementation, after the generation module 602 generates a ticket for the first terminal according to the ticket information, the generation module 602 is further used to generate notification information, the notification information including the generation time of the ticket, the node identifier of the service node device and the terminal identifier of the first terminal;

发送模块604,还用于将通知信息发送至共识节点设备,以使共识节点设备对通知信息进行上链处理。The sending module 604 is also used to send the notification information to the consensus node device, so that the consensus node device processes the notification information on the chain.

在一种实现方式中,票据信息的数量为多个,处理模块603,还用于确定多个票据信息中包含相同第二终端标识的目标票据信息;In one implementation, there are multiple ticket information, and the processing module 603 is further used to determine target ticket information containing the same second terminal identifier among the multiple ticket information;

生成模块602,还用于根据各个目标票据信息为第一终端生成票据。The generating module 602 is further configured to generate a ticket for the first terminal according to each target ticket information.

在一种实现方式中,处理模块603,还用于确定各个票据信息中包含的第二终端标识对应的多个第二终端;In one implementation, the processing module 603 is further used to determine multiple second terminals corresponding to the second terminal identifiers included in each ticket information;

处理模块603,还用于确定各个第二终端的信用等级;The processing module 603 is further used to determine the credit rating of each second terminal;

处理模块603,还用于确定各个信用等级中最高信用等级对应的目标第二终端标识;The processing module 603 is further used to determine the target second terminal identifier corresponding to the highest credit level among the credit levels;

生成模块602,还用于根据目标第二终端标识对应的票据信息为第一终端生成票据。The generating module 602 is further configured to generate a ticket for the first terminal according to the ticket information corresponding to the target second terminal identifier.

在一种实现方式中,处理模块603,还用于获取各个第二终端在第二预设周期内的交易总次数和交易成功次数;In one implementation, the processing module 603 is further configured to obtain the total number of transactions and the number of successful transactions of each second terminal within the second preset period;

处理模块603,还用于根据各个第二终端的交易总次数和交易成功次数,确定各个第二终端的信用等级。The processing module 603 is further configured to determine the credit rating of each second terminal according to the total number of transactions and the number of successful transactions of each second terminal.

图6所示的装置中的各个模块可以分别或全部合并为一个或若干个另外的模块来构成,或者其中的某个(些)模块还可以再拆分为功能上更小的多个模块来构成,这可以实现同样的操作,而不影响本申请的实施例的技术效果的实现。上述模块是基于逻辑功能划分的,在实际应用中,一个模块的功能也可以由多个模块来实现,或者多个模块的功能由一个模块实现。在本申请的其它实施例中,也可以包括其它模块,在实际应用中,这些功能也可以由其它模块协助实现,并且可以由多个模块协作实现,本申请不做限定。Each module in the device shown in Fig. 6 can be separately or all merged into one or several other modules to constitute, or some of the modules can also be split into multiple smaller modules in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the function of a module can also be realized by multiple modules, or the function of multiple modules can be realized by one module. In other embodiments of the present application, other modules may also be included. In practical applications, these functions can also be implemented with the assistance of other modules, and can be implemented by the collaboration of multiple modules, which is not limited in the present application.

请参见图7,图7是本发明实施例提供的另一种票据处理装置的结构示意图,该票据处理装置70包括处理器701、存储器702、通信接口703,所述处理器701、所述存储器702、所述通信接口703通过一条或多条通信总线连接。Please refer to Figure 7, which is a structural diagram of another bill processing device provided by an embodiment of the present invention. The bill processing device 70 includes a processor 701, a memory 702, and a communication interface 703. The processor 701, the memory 702, and the communication interface 703 are connected via one or more communication buses.

处理器701被配置为支持票据处理装置执行图3-图5所示实施例业务节点设备相应的功能。该处理器701可以是中央处理器(central processing unit,CPU),网络处理器(network processor,NP),硬件芯片或者其任意组合。The processor 701 is configured to support the bill processing device to perform the corresponding functions of the service node device of the embodiments shown in Figures 3 to 5. The processor 701 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof.

存储器702用于存储程序代码等。存储器702可以包括易失性存储器(volatilememory),例如随机存取存储器(random access memory,RAM);存储器702也可以包括非易失性存储器(non-volatile memory),例如只读存储器(read-only memory,ROM),快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储器702还可以包括上述种类的存储器的组合。The memory 702 is used to store program codes, etc. The memory 702 may include a volatile memory, such as a random access memory (RAM); the memory 702 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory 702 may also include a combination of the above-mentioned types of memory.

通信接口703用于接收和发送数据,例如,通信接口703用于接收第一终端发送的票据获取请求,或者,通信接口703用于将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端。The communication interface 703 is used to receive and send data. For example, the communication interface 703 is used to receive a ticket acquisition request sent by the first terminal, or the communication interface 703 is used to send the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information.

在本发明实施例中,该票据处理装置70包括多个通信接口,其中,用于发送数据的通信接口和用于接收数据的通信接口可以不为同一个通信接口。In the embodiment of the present invention, the bill processing device 70 includes multiple communication interfaces, wherein the communication interface for sending data and the communication interface for receiving data may not be the same communication interface.

处理器701可以调用存储器702中存储的程序代码以执行以下操作:The processor 701 may call the program code stored in the memory 702 to perform the following operations:

通信接口703接收第一终端发送的票据获取请求,票据获取请求包括票据信息;The communication interface 703 receives a ticket acquisition request sent by the first terminal, where the ticket acquisition request includes ticket information;

处理器701根据票据信息为第一终端生成票据;The processor 701 generates a ticket for the first terminal according to the ticket information;

处理器701根据第一终端的第一私钥使用权和智能合约,对票据进行处理,得到第一数字签名;The processor 701 processes the bill according to the first private key usage right of the first terminal and the smart contract to obtain a first digital signature;

处理器701通过通信接口703将票据和第一数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The processor 701 sends the ticket and the first digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.

在一种实现方式中,处理器701还可以执行以下操作:In one implementation, the processor 701 may further perform the following operations:

处理器701若根据第一私钥使用权和智能合约,对票据处理失败,则通过通信接口703向第一终端发送更新请求,更新请求用于请求更新第一私钥使用权;If the processor 701 fails to process the bill according to the first private key usage right and the smart contract, the processor 701 sends an update request to the first terminal through the communication interface 703, where the update request is used to request to update the first private key usage right;

处理器701通过通信接口703接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的;The processor 701 receives, through the communication interface 703, the second private key usage right sent by the first terminal, where the second private key usage right is obtained by the first terminal by updating the private key of the first terminal;

处理器701根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名;The processor 701 processes the bill according to the second private key usage right and the smart contract to obtain a second digital signature;

处理器701通过通信接口703将票据和第二数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The processor 701 sends the ticket and the second digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.

在一种实现方式中,处理器701还可以执行以下操作:In one implementation, the processor 701 may further perform the following operations:

每间隔第一预设周期,处理器701通过通信接口703接收第一终端发送的第二私钥使用权,第二私钥使用权是第一终端通过对第一终端的私钥进行更新得到的;At intervals of a first preset period, the processor 701 receives, through the communication interface 703, the second private key usage right sent by the first terminal, where the second private key usage right is obtained by the first terminal by updating the private key of the first terminal;

处理器701根据第二私钥使用权和智能合约,对票据进行处理,得到第二数字签名;The processor 701 processes the bill according to the second private key usage right and the smart contract to obtain a second digital signature;

处理器701通过通信接口703将票据和第二数字签名发送至票据信息包括的第二终端标识对应的第二终端,以使第二终端获得票据。The processor 701 sends the ticket and the second digital signature to the second terminal corresponding to the second terminal identifier included in the ticket information through the communication interface 703, so that the second terminal obtains the ticket.

在一种实现方式中,处理器701根据票据信息为第一终端生成票据之后,还可以执行以下操作:In one implementation, after the processor 701 generates a ticket for the first terminal according to the ticket information, it may further perform the following operations:

处理器701生成通知信息,通知信息包括票据的生成时间、业务节点设备的节点标识和第一终端的终端标识;The processor 701 generates notification information, where the notification information includes the generation time of the ticket, the node identifier of the service node device, and the terminal identifier of the first terminal;

处理器701通过通信接口703将通知信息发送至共识节点设备,以使共识节点设备对通知信息进行上链处理。The processor 701 sends the notification information to the consensus node device through the communication interface 703, so that the consensus node device processes the notification information on the chain.

在一种实现方式中,票据信息的数量为多个,处理器701还可以执行以下操作:In one implementation, if the amount of ticket information is multiple, the processor 701 may further perform the following operations:

处理器701确定多个票据信息中包含相同第二终端标识的目标票据信息;The processor 701 determines target ticket information including the same second terminal identifier among the multiple ticket information;

处理器701根据各个目标票据信息为第一终端生成票据。The processor 701 generates a ticket for the first terminal according to each target ticket information.

在一种实现方式中,票据信息的数量为多个,处理器701还可以执行以下操作:In one implementation, if the amount of ticket information is multiple, the processor 701 may further perform the following operations:

处理器701确定各个票据信息中包含的第二终端标识对应的多个第二终端;The processor 701 determines a plurality of second terminals corresponding to the second terminal identifiers included in each ticket information;

处理器701确定各个第二终端的信用等级;The processor 701 determines the credit rating of each second terminal;

处理器701确定各个信用等级中最高信用等级对应的目标第二终端标识;The processor 701 determines the target second terminal identifier corresponding to the highest credit level among the credit levels;

处理器701根据目标第二终端标识对应的票据信息为第一终端生成票据。The processor 701 generates a ticket for the first terminal according to the ticket information corresponding to the target second terminal identifier.

在一种实现方式中,处理器701,还可以执行以下操作:In one implementation, the processor 701 may further perform the following operations:

处理器701获取各个第二终端在第二预设周期内的交易总次数和交易成功次数;The processor 701 obtains the total number of transactions and the number of successful transactions of each second terminal within the second preset period;

处理器701根据各个第二终端的交易总次数和交易成功次数,确定各个第二终端的信用等级。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.

本发明实施例还提供一种计算机可读存储介质,可以用于存储图3-图7所示实施例中业务节点设备所用的计算机软件指令,其包含用于执行上述实施例中为业务节点设备所设计的程序。An embodiment of the present invention also provides a computer-readable storage medium that can be used to store computer software instructions used by the service node device in the embodiments shown in Figures 3 to 7, which includes a program designed for executing the service node device in the above embodiments.

上述计算机可读存储介质包括但不限于快闪存储器、硬盘、固态硬盘。The computer-readable storage medium includes but is not limited to a flash memory, a hard disk, and a solid-state drive.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on 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.
CN201910966717.4A 2019-10-10 2019-10-10 A bill processing method, device and storage medium device Active CN110750808B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910966717.4A CN110750808B (en) 2019-10-10 2019-10-10 A bill processing method, 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 A bill processing method, 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 A bill processing method, device and storage medium device

Country Status (1)

Country Link
CN (1) CN110750808B (en)

Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040088576A1 (en) * 2002-10-31 2004-05-06 Foster Ward Scott Secure resource access

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
区块链技术的研析及其在商业银行领域的应用建议;缪锦春;;邵阳学院学报(社会科学版)(03);全文 *

Also Published As

Publication number Publication date
CN110750808A (en) 2020-02-04

Similar Documents

Publication Publication Date Title
CN108712395B (en) Account management method, device, server and storage medium based on block chain
CN108898389B (en) Content verification method and device based on block chain and electronic equipment
CN108985757B (en) Information processing method, device and system, storage medium and electronic equipment
CN111080295B (en) Electronic contract processing method and device based on blockchain
CN113468602B (en) Data inspection method, device and equipment
CN108734028B (en) Data management method based on block chain, block chain link point and storage medium
WO2022095244A1 (en) Cross-chain transaction method, system and apparatus, device, and storage medium
WO2018076762A1 (en) Block chain-based transaction verification method and system, electronic device, and medium
CN111107066A (en) Sensitive data transmission method and system, electronic equipment and storage medium
CN111476572B (en) Block chain-based data processing method, device, storage medium and equipment
CN110334153B (en) Authorization method, system, device and equipment in block chain type account book
CN115114658B (en) Verifiable data transaction method, device, equipment and medium based on blockchain
CN110932859B (en) User information processing method, apparatus, device and readable storage medium
CN112202779B (en) Block chain based information encryption method, device, equipment and medium
CN110738502B (en) A bill processing method, device and storage medium device
CN111294203B (en) Information transmission method
WO2021204044A1 (en) Correction of blockchain data
CN110084600B (en) Processing and verifying method, device, equipment and medium for resolution transaction request
CN111488372A (en) Data processing method, device and storage medium
CN113841206B (en) Event Management in Distributed Computing Systems
CN111404892B (en) Data supervision method and device and server
CN113868713B (en) Data verification method and device, electronic equipment and storage medium
CN111709047A (en) Information management system and method therefor
CN110750808B (en) A bill processing method, device and storage medium device
CN114418769A (en) Block chain transaction charging method and device and readable storage medium

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
TG01 Patent term adjustment
TG01 Patent term adjustment