CN110224833B - Bill data processing method and system - Google Patents

Bill data processing method and system Download PDF

Info

Publication number
CN110224833B
CN110224833B CN201910419901.7A CN201910419901A CN110224833B CN 110224833 B CN110224833 B CN 110224833B CN 201910419901 A CN201910419901 A CN 201910419901A CN 110224833 B CN110224833 B CN 110224833B
Authority
CN
China
Prior art keywords
bill
data
version number
block chain
invoicing
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
CN201910419901.7A
Other languages
Chinese (zh)
Other versions
CN110224833A (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.)
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN201910419901.7A priority Critical patent/CN110224833B/en
Publication of CN110224833A publication Critical patent/CN110224833A/en
Application granted granted Critical
Publication of CN110224833B publication Critical patent/CN110224833B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/04Billing or invoicing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Development Economics (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Accounting & Taxation (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The application relates to a process optimization technology and provides a bill data processing method and a bill data processing system. The method comprises the following steps: the method comprises the steps that an invoicing side device obtains initial bill data corresponding to bill identification and a version number corresponding to the initial bill data, and the obtained version number is used as a first version number; the billing party equipment displays the initial bill data to a billing party operator through a user operation interface, and detects a bill data submission instruction triggered by the billing party operator aiming at the initial bill data in real time; when a bill data submission instruction is detected, the invoicing party equipment acquires bill modification data pre-input by an invoicing party operator aiming at initial bill data, and searches a current latest version number corresponding to a bill identifier from block link points to serve as a second version number; when the first version number is identical to the second version number, the invoicer device writes the ticket modification data into the blockchain by means of the blockchain node. By adopting the method, the processing efficiency of the bill data can be improved.

Description

Bill data processing method and system
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a method and a system for processing ticket data.
Background
The ticket is a consumption certificate which is provided by a seller as a invoicing party to a consumer in selling goods, providing services or performing other business activities. Along with the continuous increase of the number of bills and the continuous improvement of the safety, authenticity and reliability requirements of people on bill data, the change from the data base storage bill data to the block chain storage bill data gradually appears, the tampering difficulty of the bill data is improved, and the safety, authenticity and reliability of the bill data are improved.
Currently, when an operator of a billing party writes bill data into a block chain, the bill data and a corresponding data version number are updated and stored in a database. When an operator of a billing party modifies bill data, the operator usually obtains the bill data to be modified from the database, writes the modified bill data into the block chain, and correspondingly updates and stores the modified bill data in the database. In order to avoid the problem of ticket data errors caused by simultaneous modification of the same ticket data by multiple invoicer operators, pessimistic locks are generally used to concurrently control the modification of the ticket data.
However, when a pessimistic lock is adopted, each invoicing side device needs to cyclically preempt the database lock corresponding to the same bill data, only the invoicing side device preempted the database lock can inquire and modify the bill data, and the mode of cyclically preempting the database lock increases the consumption of computer resources and reduces the processing efficiency of the bill data. If the invoicing device which preempts the database lock suddenly goes down and the database lock is not released, deadlock may be caused, and the processing efficiency of the billing data is further reduced.
Disclosure of Invention
In view of the above, it is desirable to provide a method and a system for processing ticket data, which can improve the processing efficiency of the ticket data.
A ticket data processing method, the method comprising:
the method comprises the steps that ticket issuing side equipment obtains initial ticket data corresponding to a ticket identifier and a version number corresponding to the initial ticket data, and the obtained version number is used as a first version number;
the invoicing party equipment displays the initial bill data to an invoicing party operator through a user operation interface, and detects a bill data submission instruction triggered by the invoicing party operator aiming at the initial bill data in real time;
when the bill data submission instruction is detected, the invoicing party equipment acquires bill modification data pre-input by the invoicing party operator aiming at the initial bill data, and searches the current latest version number corresponding to the bill identification from block link points to serve as a second version number;
when the first version number is identical to the second version number, the invoicer device writes the ticket modification data into a blockchain by means of the blockchain node.
In one embodiment, the acquiring, by the invoicing apparatus, initial ticket data corresponding to a ticket identifier and a version number corresponding to the initial ticket data, and taking the acquired version number as a first version number includes:
the invoicing side equipment acquires a bill data modification request carrying a bill identification;
the invoicing side equipment generates a bill data acquisition request carrying the bill identification according to the bill data modification request and sends the bill data acquisition request to a block chain node;
the block chain node searches initial bill data corresponding to the bill identification from a block chain according to the bill data acquisition request, and takes the version number corresponding to the initial bill data as a first version number;
and the invoicing side equipment receives the initial bill data and the first version number which are correspondingly fed back by the block link points.
In one embodiment, the searching, by the blockchain node, for the initial ticket data corresponding to the ticket identifier from the blockchain according to the ticket data obtaining request includes:
the block chain node analyzes the bill data acquisition request to obtain the bill identification and the operator identification of the invoicing party;
the block link point verifies the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the operator identification of the invoicing party and a preset verification mode;
and when the verification is passed, the block chain node searches corresponding initial bill data in the block chain according to the bill identification.
In one embodiment, said when said first version number is identical to said second version number, said invoicer device writing said ticket modification data into a blockchain by means of said blockchain node comprises:
when the first version number is consistent with the second version number, the invoicing party equipment encrypts the bill modification data through a private key of the invoicing party to obtain a bill data ciphertext, and sends the bill data ciphertext to the block chain node;
and the block chain node decrypts the bill data ciphertext through the public key of the invoker corresponding to the private key of the invoker to obtain the bill modification data, and writes the bill modification data into the block chain.
In one embodiment, when the first version number is identical to the second version number, the invoicer device writes the ticket modification data into a blockchain by means of the blockchain node, including:
when the first version number is consistent with the second version number, the invoicing side equipment sends the bill modification data to the block chain node;
the block chain link points carry out consensus on the bill modification data based on a consensus mechanism and generate data blocks corresponding to the bill modification data passing the consensus;
and the block link point acquires the current system time, generates a version number corresponding to the bill modification data according to the current system time, writes the generated version number into the data block, and adds the data block written with the version number into a block chain.
In one embodiment, the invoicer device sends the ticket modification data to the blockchain node, including:
the invoicing side equipment sends the bill modification data and the first version number to the block chain node;
after generating the data block corresponding to the bill modification data passing the consensus, the method further comprises:
the block chain node searches the current latest version number corresponding to the bill identification in the block chain to be used as a third version number;
and when the first version number is consistent with the third version number, the block link point jumps to the step of acquiring the current system time and continues to execute.
In one embodiment, the blockchain node is a data processing node in a blockchain node cluster; when the first version number is consistent with the second version number, the invoicing side device sends the bill modification data to the blockchain node, and the method comprises the following steps:
when the first version number is consistent with the second version number, the invoicing side equipment generates a signature request carrying the bill modification data;
the invoicer device sends the signature request to a plurality of blockchain nodes in the blockchain node cluster; the sent signature requests are used for indicating the plurality of block chain nodes, and signing is respectively carried out on the bill modification data according to a preset signature mode to obtain digital signatures;
the invoicing side equipment receives the digital signatures fed back by the plurality of block chain nodes, obtains a digital signature array according to each digital signature, and sends the digital signature array and the bill modification data to the data processing node;
the block link point acquiring the current system time comprises the following steps:
the data processing node performs signature verification on the bill modification data according to the digital signature number group in a preset signature verification mode;
and when the signature passes the verification, the data processing node acquires the current system time.
A ticket data processing system, the system comprising: biller equipment and block link points;
the invoicing side equipment is used for acquiring initial bill data corresponding to a bill identification and a version number corresponding to the initial bill data, and taking the acquired version number as a first version number; displaying the initial bill data to an operator of a billing party through a user operation interface, and detecting a bill data submission instruction triggered by the operator of the billing party aiming at the initial bill data in real time;
the invoicer equipment is further used for acquiring bill modification data pre-entered by the invoicer operator for the initial bill data when the bill data submission instruction is detected, and searching the current latest version number corresponding to the bill identification from the block chain node as a second version number; when the first version number is consistent with the second version number, the bill modification data is sent to the block chain node;
and the block chain node is used for writing the bill modification data into a block chain.
In one embodiment, the invoicer device is further configured to send the ticket modification data to the blockchain node when the first version number is consistent with the second version number;
the block chain node is further used for carrying out consensus on the bill modification data based on a consensus mechanism and generating a data block corresponding to the bill modification data passing the consensus; acquiring current system time, generating a version number corresponding to the bill modification data according to the current system time, writing the generated version number into the data block, and adding the data block written with the version number into a block chain.
In one embodiment, the system further comprises: clustering block chain nodes; the block chain node is a data processing node in the block chain node cluster;
the invoicing side equipment is also used for generating a signature request carrying the bill modification data when the first version number is consistent with the second version number; sending the signature request to a plurality of blockchain nodes in the blockchain node cluster; the sent signature request is used for indicating the plurality of block chain nodes, and signing the bill modification data respectively according to a preset signature mode to obtain a digital signature;
the invoicing side equipment is also used for receiving the digital signatures fed back by the plurality of block chain nodes, obtaining a digital signature array according to each digital signature, and sending the digital signature array and the bill modification data to the data processing node;
the data processing node is used for carrying out signature verification on the bill modification data according to the digital signature number group in a preset signature verification mode; and when the signature passes the verification, acquiring the current system time.
According to the bill data processing method and system, when the billing party equipment displays the initial bill data acquired corresponding to the bill identification to the billing party operator, the bill data submission instruction triggered by the billing party operator correspondingly is detected in real time, corresponding bill modification data is acquired when the bill data submission instruction is detected, and the version number (first version number) corresponding to the initial bill data is compared with the current latest version number (second version number) corresponding to the bill identification. And when the two are consistent, the initial bill data is not modified by other invoicers, the bill modification data is judged to be valid, and the bill modification data is written into the block chain by means of the block chain link point, so that the modification of the initial bill data is realized. Therefore, multiple invoicing party operators can simultaneously initiate modification on the same initial bill data, and one or more corresponding invoicing party devices judge the validity of each bill modification data according to the mode and modify the initial bill data according to the valid bill modification data. Therefore, the same initial bill data has at most one effective bill modification data at the same time, namely, at most one operator of the invoicing party can successfully modify the initial bill data at the same time, so that concurrent modification control of the bill data is realized, and the processing efficiency of the bill data can be improved.
Drawings
FIG. 1 is a diagram of an application scenario of a ticket data processing method in one embodiment;
FIG. 2 is a schematic flow chart diagram of a ticket data processing method in one embodiment;
FIG. 3 is a schematic flow chart diagram of a ticket data processing method in one embodiment;
FIG. 4 is a schematic diagram of a ticket data processing system in one embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad application.
The bill data processing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the invoicer device 102 communicates with the block link point 104 over the network. The invoicing party device 102 acquires initial bill data corresponding to the bill identification and a corresponding first version number, displays the initial bill data to an invoicing party operator through a user operation interface, detects a bill data submission instruction correspondingly triggered by the invoicing party operator in real time, and acquires corresponding bill modification data according to the detected bill data submission instruction; further, the invoicing apparatus 102 obtains the current latest version number corresponding to the ticket identity from the block link node 104 as the second version number, and writes the ticket modification data into the block chain by means of the block chain node 104 when the first version number coincides with the second version number. The biller device 102 may be a terminal or a server. The blockchain node 104 corresponds to a server, and may specifically be a server. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server can be implemented by an independent server or a server cluster formed by a plurality of servers. The blockchain node 104 corresponds to a blockchain network, which includes a plurality of blockchain nodes, and each blockchain node can perform data transmission with each other. The blockchain node 104 may be a blockchain node corresponding to the invoicer device among the plurality of blockchain nodes, or may be any one or more blockchain nodes among the plurality of blockchain nodes.
In one embodiment, as shown in fig. 2, there is provided a ticket data processing method, including the steps of:
s202, the invoicing side device obtains initial bill data corresponding to the bill identification and a version number corresponding to the initial bill data, and takes the obtained version number as a first version number.
The ticket identifier is used for uniquely identifying the ticket, and may be a character string composed of at least one of characters such as numbers, letters, symbols and the like, and specifically may be a ticket number or a code. The ticket is an electronic ticket, which is a consumption certificate provided by a invoicing party (seller) for a consumer in selling goods, providing services or engaging in other business activities. The invoicing party may be a selling business or individual and the consuming party may be a consuming business or individual. The initial bill data refers to bill data to be modified in a bill data processing flow executed at the present time, and the bill data to be modified is the initial bill data with respect to the modified bill data. The initial bill data is the bill data that was written into the block chain at the latest in the bill data processing flow corresponding to the bill identification executed at the previous time. The initial ticket data may be ticket data that has been audited by the recipient (i.e. the consumer) in the ticket data processing flow executed last time, and the audit opinion data represents that the audit is passed. The version number refers to an identification number of the version, and is used for identifying the version of the bill data corresponding to the bill identification. One ticket id may correspond to one or more version numbers, each version number corresponding to a corresponding version of ticket data, i.e., one ticket id may correspond to one or more versions of ticket data. The version number may be a character string composed of at least one of characters such as numbers, letters and symbols, and may specifically be a combination of at least one of a timestamp, a random number, and a ticket identifier. The version numbers corresponding to the same bill identification can be numerical values with specific rules, such as 1,2, n.
Specifically, the invoicing side device acquires a bill identifier, acquires initial bill data corresponding to the bill identifier and a version number corresponding to the initial bill data from a local or other computer device according to the bill identifier, and takes the version number of the initial bill data as a first version number. When acquiring a bill data modification request or a bill data query request triggered by a bill identifier by an operator of a billing party, the billing party equipment acquires a current latest version number corresponding to the bill identifier from a local or other computer equipment as a first version number, and acquires bill data corresponding to the first version number as initial bill data. Other computer devices such as data storage servers or block link points for storing ticket data.
In one embodiment, the invoicing party device acquires initial bill data corresponding to the bill identification and a corresponding first version number from other computer devices according to a bill data query request triggered by an invoicing party operator, and stores the acquired initial bill data, the first version number and the bill identification in a local manner. When a bill data modification request triggered by an operator of a billing party is acquired, the equipment of the billing party locally inquires initial bill data and a first version number which are correspondingly stored according to a bill identifier.
In one embodiment, the invoicing party device generates a ticket data acquisition request carrying a ticket identifier and sends the generated ticket data acquisition request to the data storage server. The data storage server locally pre-stores the latest version of the bill data corresponding to the bill identification. And the data storage server locally inquires bill data stored corresponding to the bill identification as initial bill data according to the received bill data acquisition request, and a version number corresponding to the initial bill data is used as a first version number. The data storage server locally pre-stores one or more version numbers corresponding to the bill identification and bill data corresponding to each version number. When a bill data acquisition request is received, the data storage server locally inquires the current latest version number corresponding to the corresponding bill identification as a first version number, and bill data corresponding to the first version number is used as initial bill data. Further, the data storage server feeds back the inquired initial bill data and the first version number to the invoicer device.
In one embodiment, step S202 includes: the invoicing side equipment acquires a bill data modification request carrying a bill identification; the billing party equipment generates a bill data acquisition request carrying a bill identification according to the bill data modification request and sends the bill data acquisition request to the block chain node; the block chain node searches initial bill data corresponding to the bill identification from the block chain according to the bill data acquisition request, and takes the version number corresponding to the initial bill data as a first version number; and the invoicing side equipment receives the initial bill data and the first version number which are correspondingly fed back by the block chain link points.
The ticket data modification request is a request for triggering a ticket data modification operation and is used for indicating the invoicer device to trigger the current ticket data processing flow aiming at the ticket identifier. The bill data acquisition request is a request for triggering the bill data acquisition operation, and is used for indicating the blockchain node to inquire and feed back the initial bill data and the first version number corresponding to the bill identification.
Specifically, the invoicing party equipment acquires a bill data modification request which is triggered and generated by an invoicing party operator and carries a bill identifier, generates a bill data acquisition request carrying the bill identifier according to the acquired bill data modification request, and sends the generated bill data acquisition request to the block chain node. When receiving a bill data acquisition request sent by a billing party device, a block chain node analyzes the bill data acquisition request to obtain a bill identifier, and searches bill data which corresponds to the bill identifier and is written into the block chain at the latest from the block chain according to the bill identifier obtained by analysis to obtain initial bill data. And the block chain node acquires the version number corresponding to the initial bill data from the block chain as a first version number, and feeds back the acquired initial bill data and the first version number to the invoicing party equipment.
In one embodiment, when a bill data acquisition request is received, the blockchain link point searches a current latest version number corresponding to the bill identification from the blockchain according to the bill data acquisition request to serve as a first version number, and searches corresponding bill data from the blockchain according to the first version number to serve as initial bill data. In this way, when acquiring a note data modification request triggered by a note identifier by a note operator, the note issuer device acquires the current latest version of note data corresponding to the note identifier from the block chain by means of the block chain nodes, so as to ensure that the note data processing flow executed at the time is triggered and executed for the current latest version of note data. Therefore, the operator of the invoicing party modifies the current latest version of the ticket data, and the consistency of the ticket data can be ensured.
In one embodiment, the block chain node determines a ticket identifier according to the received ticket data acquisition request, searches a plurality of corresponding candidate version numbers in the block chain according to the ticket identifier, and screens a latest generated version number from the candidate version numbers or screens a version number with a latest timestamp from the candidate version numbers as the first version number.
And S204, the invoicing party device displays the initial bill data to an invoicing party operator through a user operation interface, and detects a bill data submission instruction triggered by the invoicing party operator aiming at the initial bill data in real time.
The bill data submission instruction is an instruction for triggering bill data submission operation and is used for instructing the invoicer equipment to write bill modification data into the block chain by means of the block chain link points so as to modify the initial bill data.
In one embodiment, when the invoicing party device is an invoicing party terminal, the invoicing party terminal displays the obtained initial bill data to an invoicing party operator through a user operation interface, detects a preset submission operation triggered by the invoicing party operator for the displayed initial bill data in real time, and generates a bill data submission instruction according to the detected preset submission operation trigger.
In one embodiment, when the invoicer device is the invoicer server, the invoicer server determines the invoicer operator identifier and/or the invoicer operator account according to the ticket data modification request, and sends the obtained initial ticket data to the invoicer terminal logged in with the invoicer operator account, or sends the initial ticket data to the invoicer terminal corresponding to the invoicer operator identifier. And the invoicing party terminal displays the initial bill data to an invoicing party operator through a user operation interface, and detects a bill data submission instruction correspondingly triggered by the invoicing party operator in real time. And after the billing party server sends the initial bill data to the billing party terminal, detecting a bill data submission instruction correspondingly fed back by the billing party terminal in real time.
S206, when a bill data submission instruction is detected, the invoicing side equipment obtains bill modification data pre-recorded by an invoicing side operator for the initial bill data, and searches the current latest version number corresponding to the bill identification from the block link points to serve as a second version number.
The bill modification data refers to modified bill data, and specifically refers to bill data pre-entered or pre-selected by an operator of a billing party on a user operation interface according to displayed initial bill data.
Specifically, when a bill data submission instruction corresponding to the bill identification is detected, the invoicing party device obtains bill modification data pre-entered by an invoicing party operator on a user operation interface according to the detected bill data submission instruction. Furthermore, the invoicing side equipment generates a version number obtaining request carrying the bill identification and sends the generated version number obtaining request to the block chain node. And when receiving a version number acquisition request sent by the invoicing party equipment, the block chain node searches the current latest version number corresponding to the bill identifier from the block chain to serve as a second version number, and feeds the second version number back to the invoicing party equipment.
In one embodiment, when the invoicing party device is an invoicing party terminal and the invoicing party terminal detects a bill data submission instruction triggered by an invoicing party operator, the invoicing party terminal obtains bill modification data pre-recorded by the invoicing party operator for displayed initial bill data according to the bill data submission instruction.
In one embodiment, when the invoicing party device is an invoicing party server and the invoicing party server detects that the invoicing party terminal submits an instruction for bill data fed back by the invoicing party terminal aiming at the bill identification, the invoicing party server acquires bill modification data pre-recorded by an invoicing party operator aiming at initial bill data by means of the invoicing party terminal and searches a current latest version number corresponding to the bill identification in a block chain by means of a block chain node to serve as a second version number.
In one embodiment, when the invoicer device is an invoicer server, the invoicer server sends initial ticket data for the ticket identification to the invoicer terminal. And the invoicer terminal displays the initial bill data to an invoicer operator through a user operation interface, and detects a bill data submission instruction correspondingly triggered by the invoicer operator in real time. When a bill data submission instruction is detected, the invoicing party terminal acquires bill modification data pre-recorded by an invoicing party operator for the displayed initial bill data, and feeds the acquired bill modification data back to the invoicing party server. And when the invoicing side server acquires the bill modification data corresponding to the bill identification, acquiring a second version number corresponding to the bill identification from the block chain by means of the block chain node.
And S208, when the first version number is consistent with the second version number, the invoicer device writes the bill modification data into the block chain by means of the block chain node.
Specifically, when acquiring the ticket modification data corresponding to the ticket identifier and finding the second version number corresponding to the ticket identifier, the invoicing side device compares the second version number with the first version number corresponding to the initial ticket data. When the first version number is consistent with the second version number, the initial bill data modified by the invoicing party operator is the current latest version of bill data, namely the initial bill data is modified successfully by other invoicing party operators in the process that the invoicing party operator initiates modification on the initial bill data, and the invoicing party equipment sends the acquired bill modification data to the block chain node. The block chain link point executes the chain-entering operation on the received bill modification data so as to write the bill modification data into the block chain.
In one embodiment, the first version number is a current latest version number corresponding to the ticket identifier when the ticket issuing party device acquires a ticket data modification request or a ticket data query request triggered by a ticket issuing party operator. And the second version number is the current latest version number corresponding to the bill identification when the invoicing side device detects a bill data submission instruction and obtains bill modification data which is pre-input by an invoicing side operator for the displayed initial bill data. In other words, the first version number refers to the current latest version number corresponding to the bill identification before the invoicing operator performs the modification operation on the initial bill data, namely the version number corresponding to the initial bill data. The second version number refers to the current latest version number corresponding to the bill identification after the operator of the invoicing party performs modification operation on the initial bill data.
It can be understood that if two operators of the billing party initiate modification to the same initial ticket data corresponding to the same ticket identifier at the same time, the operator of the billing party who first triggers the ticket data submission instruction can successfully modify the initial ticket data, and the corresponding ticket modification data can be successfully written into the block chain, and the version number corresponding to the ticket identifier is correspondingly updated as the latest version number; then, the operator of the billing party who triggers the bill data submission instruction cannot successfully modify the initial bill data because the latest version number corresponding to the bill identification is updated when the operator triggers the bill data submission instruction, and the corresponding bill modification data is determined to be invalid bill data. The same time may refer to the same point in time or the same period of time.
In one embodiment, when the first version number is not consistent with the second version number, it indicates that there are other invoicing party operators initiating modification to the initial ticket data and successfully writing the modified ticket modification data into the block chain by means of the block chain node while the invoicing party operator initiating modification to the initial ticket data, and the invoicing party device displays a prompt message indicating that the ticket data modification fails to the invoicing party operator through the user operation interface.
For example, it is assumed that a first invoicing party operator and a second invoicing party operator exist, and the processing flows of the respective corresponding ticket data are triggered for the same initial ticket data corresponding to the same ticket identifier at the same time, where the version number of the initial ticket data is 2. And if the invoicing party equipment acquires a bill data submission instruction triggered by the first invoicing party operator, the latest version number corresponding to the bill identification searched from the block link points is 2. And as the first version number 2 is consistent with the second version number 2, the invoicing side equipment judges that the bill modification data pre-recorded by the first invoicing side operator is valid, writes the valid bill modification data into the block chain by means of the block chain link point, and updates the version number of the bill identification, assuming that the updated version number is 3.
And if the invoicing party equipment acquires a bill data submission instruction triggered by a second invoicing party operator after successfully updating the version number corresponding to the bill identification according to the mode, finding out that the current latest version number corresponding to the bill identification is 3 according to the bill data submission instruction. And because the second version number 3 is inconsistent with the first version number 2, the invoicer device judges that the bill modification data pre-input by the second invoicer operator is invalid, and displays prompt information indicating bill data modification failure to the second invoicer operator through the user operation interface. The first invoicer operator and the second invoicer operator can initiate modification to the same initial ticket data of the same ticket identification based on the same or different invoicer devices.
According to the bill data processing method, when the billing party equipment displays the initial bill data acquired corresponding to the bill identification to the billing party operator, the bill data submission instruction triggered by the billing party operator correspondingly is detected in real time, corresponding bill modification data is acquired when the bill data submission instruction is detected, and the version number (first version number) corresponding to the initial bill data is compared with the current latest version number (second version number) corresponding to the bill identification. And when the two are consistent, the initial bill data is not modified by other invoicers, the bill modification data is judged to be valid, and the bill modification data is written into the block chain by means of the block chain link point, so that the modification of the initial bill data is realized. Therefore, multiple invoicing party operators can simultaneously initiate modification on the same initial bill data, and one or more corresponding invoicing party devices judge the validity of each bill modification data according to the mode and modify the initial bill data according to the valid bill modification data. Therefore, the same initial bill data has at most one effective bill modification data at the same time, namely, the operator of the invoicing party can successfully modify the initial bill data at most at the same time, so that concurrent modification control of the bill data is realized, and the processing efficiency of the bill data can be improved.
In one embodiment, the searching, by the blockchain link point, for initial ticket data corresponding to the ticket identifier from the blockchain according to the ticket data acquisition request includes: analyzing the bill data acquisition request by the block chain node to obtain a bill identifier and an operator identifier of the invoicing party; the block chain node verifies the authority of the invoicing party operator corresponding to the invoicing party operator identifier according to the invoicing party operator identifier and a preset verification mode; and when the verification is passed, searching corresponding initial bill data in the block chain according to the bill identification by the block chain link point.
The operator identifier of the invoicing party is used for uniquely identifying the operator of the invoicing party, and may be a character string composed of at least one of characters such as numbers, letters, symbols and the like, and specifically may be of the operator of the invoicing party. The preset checking mode is a preset mode for checking whether the bill data corresponding to the bill identification has the inquiry authority and/or the modification authority by the operator of the invoicing party. The preset verification mode can also be used for verifying the legality of an operator of the invoicer. And a preset checking mode is used, for example, the identifier of the operator of the invoicer is matched with a preset white list, so that the checking result is determined according to the matching result. The preset white list is an identification set consisting of the identifiers of the operators of the billing parties who have query authority (and/or modification authority) on the bill data corresponding to the bill identifiers. The preset white list may further include a receiver operator identifier or a receiver auditor identifier having query authority (and/or audit authority) for the ticket data corresponding to the ticket identifier.
Specifically, the ticket data acquisition request carries a ticket identifier and an operator identifier of the invoicer. And analyzing the received bill data acquisition request by the block chain link points to obtain corresponding bill identification and the operator identification of the invoicing party, determining a preset white list according to the bill identification, matching the operator identification of the invoicing party with the determined preset white list, and verifying the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the matching result. When the matching of the operator identifier of the invoicing party and the preset white list is successful, the operator identifier of the invoicing party is shown to have query authority and/or modification authority on the bill data corresponding to the bill identifier, the block chain node judges the authority verification result of the operator of the invoicing party as verification passing, and according to the bill identifier, the bill data which corresponds to the bill identifier and is written into the block chain at the latest is searched in the block chain and is used as initial bill data. Correspondingly, when the matching of the operator identifier of the invoicing party and the preset white list fails, the fact that the operator of the invoicing party does not have the inquiry authority and/or the modification authority of the bill data corresponding to the bill identifier is shown, the block chain node judges that the authority verification result of the operator of the invoicing party is verification failure, and prompt information showing that the authority verification fails is fed back to the equipment of the invoicing party.
In one embodiment, the block link point matches the analyzed operator identifier of the invoicing party with each operator identifier of the invoicing party in a preset white list respectively, and when the operator identifier of the invoicing party matched with the analyzed operator of the invoicing party exists in the preset white list, it is determined that the analyzed operator identifier of the invoicing party is successfully matched with the preset white list.
In one embodiment, the ticket data acquisition request further includes an identifier of the biller. And the block chain node determines a corresponding invoicer identifier according to the bill identifier, and verifies the invoicer identifier obtained by analyzing the bill data acquisition request according to the determined invoicer identifier. And when the invoicer identifier determined according to the bill identifier is consistent with the analyzed invoicer identifier, the block chain node judges that the invoicer authority corresponding to the invoicer identifier passes the verification, verifies the operator authority of the invoicer according to the mode, and then executes corresponding operation according to the verification result. The block chain node can search the bill data corresponding to the bill identification in the block chain and analyze the searched bill data to determine the invoicing party identification corresponding to the bill identification.
In the embodiment, the block link point firstly verifies the authority of the operator of the invoicing party, and when the verification is passed, the appointed initial bill data is searched and fed back to the invoicing party equipment, so that the safety and the reliability of the bill data can be improved.
In one embodiment, step S208 includes: when the first version number is consistent with the second version number, the invoicing party equipment encrypts the bill modification data through the invoicing party private key to obtain a bill data ciphertext, and sends the bill data ciphertext to the block chain node; and the block chain node decrypts the bill data ciphertext through the public key of the invoicing party corresponding to the private key of the invoicing party to obtain bill modification data, and writes the bill modification data into the block chain.
The invoicing party device can generate a key pair corresponding to the invoicing party identifier, and the key pair comprises an invoicing party private key and an invoicing party public key. The invoicer device can locally cache the invoicer private key and publish the invoicer public key so that other computer devices (such as blockchain nodes) can cache the invoicer public key. When the bill data is encrypted through the private key of the invoicer, the corresponding public key of the invoicer can be used for decryption; when the ticket data is encrypted by the public key of the invoicer, the decryption can be carried out by the corresponding private key of the invoicer.
Specifically, when the first version number is judged to be consistent with the second version number, the invoicing side equipment encrypts the bill modification data through a local cached private key of the invoicing side to obtain a corresponding bill data ciphertext, and sends the bill data ciphertext to the blockchain node. And the block chain node searches a public key of the invoicer corresponding to the identifier of the invoicer in a local cache, decrypts the received bill data ciphertext through the public key of the invoicer to obtain bill modification data, and executes a chain-entering operation on the bill modification data obtained by decryption to write the bill modification data into the block chain. The block chain link point can receive the invoicing party identifier or the invoicing party public key sent when the invoicing party device sends the bill ciphertext data, and can also determine the corresponding invoicing party identifier according to the invoicing party device identifier.
In one embodiment, the invoicer device sends the ticket data cryptogram and the ticket modification data to the blockchain node. The block chain node compares the decrypted bill modification data with the received bill modification data. When the two are consistent, the block chain link point writes the bill modification data into the block chain.
In one embodiment, when the first version number is judged to be consistent with the second version number, the invoicing party device encrypts the bill modification data, the initial bill data and the first version number through a private key of the invoicing party to obtain a corresponding bill data ciphertext, and sends the bill data ciphertext to the blockchain node. And the block chain node decrypts the bill data ciphertext through the public key of the invoicing party to obtain bill modification data, initial bill data and a first version number, and writes the bill modification data, the initial bill data and the first version number into the block chain.
In the above embodiment, the valid-determined bill modification data is encrypted, and the encrypted bill data ciphertext is sent to the block link node to indicate the block link node to decrypt the bill data ciphertext based on the public key of the invoicing party, if the decryption is successful, the validity of the identity of the invoicing party is successfully verified, and if the bill modification data is determined not to be maliciously tampered by a third party, the bill modification data is written into the block link to ensure the validity, reliability and non-maliciousness of the bill data.
In one embodiment, step S208 includes: when the first version number is consistent with the second version number, the invoicing side equipment sends bill modification data to the block chain node; the block chain link points carry out consensus on the bill modification data based on a consensus mechanism and generate data blocks corresponding to the bill modification data passing the consensus; and the block link point acquires the current system time, generates a version number corresponding to the bill modification data according to the current system time, writes the generated version number into the data block, and adds the data block with the written version number into the block chain.
Specifically, when the first version number is determined to be consistent with the second version number, the invoicer device sends the bill modification data to the blockchain node. The blockchain nodes transmit the bill modification data to other blockchain nodes in the blockchain network so as to carry out consensus on the bill modification data based on a consensus algorithm. When the block link nodes achieve consensus, that is, when the bill modification data passes the consensus, the block link nodes generate data blocks corresponding to the bill modification data. Further, the block link point acquires the current system time, determines the version number of the bill modified data according to the current system time, writes the version number into the data block corresponding to the bill modified data, and then adds the data block into which the version number and the bill modified data are written into the block chain, so as to write the bill modified data and the corresponding version number into the block chain. The blockchain node can perform consensus on the bill modification data based on a consensus mechanism provided by the prior art, which is not described herein again.
In one embodiment, the block link point obtains the current system time, selects a random number, and generates a version number corresponding to the ticket modification data according to the current system time and the random number. The version number comprises the random number, so that the problems that a third party maliciously modifies bill data and forges the version number can be effectively avoided. For example, assuming that the current system time is 10 o' clock 25 min, 21 st/2019 and the random number is 11, the generated version number may be 201901211025, 20190121102511, 11201901211025, or the like.
In one embodiment, the version number generated by the block link point may include the block number of the data block corresponding to the ticket modification data, and may further include the biller identifier or the biller operator identifier corresponding to the ticket modification data.
In one embodiment, common consensus algorithms in blockchain networks are POW (Proof of Work), POS (Proof of merit), DPOS (guaranteed Proof of merit), PBFT (Practical Byzantine Fault Tolerance), and Raft (consistency algorithm), among others.
In one embodiment, the block link node sends the data block with the written version number to other block link nodes in the block link network, so that each block link node in the block link network adds the data block with the written version number to a block link of a local cache.
In the above embodiment, it is ensured that the same data blocks are added to the block chain at each block link point through a consensus mechanism, so as to ensure the consistency of the data blocks in each block link point. Furthermore, the version number is determined according to the current system time, the version number corresponding to the bill identification is updated to serve as the latest version number corresponding to the bill identification, so that the current latest version number can be rapidly positioned when the bill data corresponding to the bill identification is searched, the bill data to be searched is rapidly determined according to the version number, the searching efficiency of the bill data is improved, and the processing efficiency of the bill data can be improved.
In one embodiment, the invoicer device sends ticket modification data to the blockchain node, including: the invoicing side equipment sends the bill modification data and the first version number to the block chain node; after generating the data block corresponding to the bill modification data passing the consensus, the method further comprises: the block chain node searches the current latest version number corresponding to the bill identification in the block chain to be used as a third version number; and when the first version number is consistent with the third version number, the block link point jumps to the step of acquiring the current system time and continues to execute.
Specifically, when the first version number is consistent with the second version number, the invoicer device sends the ticket modification data and the first version number to the blockchain node. After the block chain node generates the data block corresponding to the bill modification data passing through the consensus in the above manner, the current latest version number corresponding to the bill identification is searched in the block chain according to the bill identification to be used as a third version number, and the third version number is compared with the first version number. When the first version number is consistent with the third version number, it indicates that the initial ticket data corresponding to the first version number is the current latest version of ticket data corresponding to the ticket identifier, that is, before the ticket modified data is written into the block chain, there is no other ticket modified data triggered and generated for the initial ticket data and successfully written into the block chain, and the block chain node acquires the current system time, writes the version number determined according to the current system time into the data block corresponding to the ticket modified data, and then adds the data block in which the version number is written into the block chain.
In the above embodiment, since it takes a long time for the block link point to write the received bill modification data into the block chain, especially when the amount of data (or bill modification data) to be written into the block chain is large, the bill modification data may need to wait in a queue before being finally written into the block chain. Therefore, after the block chain link point receives the bill modification data sent by the ticket issuer device and before the bill modification data is successfully written into the block chain, there may be other bill modification data corresponding to the original bill data that are successfully written into the block chain. After the block chain node generates the data block corresponding to the bill modification data and before the version number corresponding to the bill modification data is generated, the current latest version number corresponding to the bill identification is searched from the block chain, whether other bill modification data corresponding to the initial bill data are successfully written into the block chain is judged according to the version number and the version number of the initial bill data, whether other billing party operators successfully modify the initial bill data is judged, and if not, the bill modification data are written into the block chain to finish the modification of the initial bill data. Therefore, under the condition that the database lock does not need to be preempted, the consistency and the reliability of the bill data can be ensured, and the processing efficiency of the bill data can be improved.
In one embodiment, the blockchain node is a data processing node in a cluster of blockchain nodes; when the first version number is consistent with the second version number, the invoicing side equipment sends the bill modification data to the block chain node, and the method comprises the following steps: when the first version number is consistent with the second version number, the invoicing side equipment generates a signature request carrying bill modification data; the invoicing side equipment sends the signature request to a plurality of block chain nodes in the block chain node cluster; the sent signature request is used for indicating a plurality of block chain nodes, and signing is carried out on bill modification data according to a preset signature mode to obtain a digital signature; the invoicing side equipment receives the digital signatures fed back by the plurality of block chain nodes, obtains a digital signature array according to each digital signature, and sends the digital signature array and the bill modification data to the data processing node; the block link point acquiring the current system time comprises the following steps: the data processing node performs signature verification on the bill modification data according to the digital signature array in a preset signature verification mode; and when the signature passes the verification, the data processing node acquires the current system time.
Wherein the signing request is a request for triggering a digital signing operation. The digital signature array includes one or more digital signatures and may further include a decryption key, such as a public signature key, corresponding to each digital signature. The preset signature mode is a mode that a preset block link point digitally signs the bill modification data. The preset signature verification mode is a preset mode for performing signature verification on the bill modification data.
Specifically, the blockchain network includes a plurality of blockchain nodes, the plurality of blockchain nodes form a blockchain node cluster, one or more blockchain nodes in the blockchain node cluster are data processing nodes, and the data processing nodes may be blockchain nodes corresponding to invoicer devices in the blockchain network. And when the first version number is judged to be consistent with the second version number, the invoicing side equipment generates a signature request carrying bill modification data, and sends the generated signature request to a plurality of block chain nodes in the block chain node cluster according to a preset signature condition. And analyzing the signature request by each block link point receiving the signature request to obtain bill modification data to be signed, respectively signing the bill modification data according to a preset signature mode to obtain a digital signature, and feeding back the digital signature obtained by the signature to the invoicing side equipment. And the invoicing side equipment splices the digital signatures fed back by the link points of each block to obtain a digital signature array, and sends the digital signature array and the bill modification data to the data processing node. And after the data processing node performs consensus on the bill modification data based on a consensus mechanism and generates a data block corresponding to the bill modification data which passes the consensus, performing signature verification on the bill modification data according to the digital signature array in a preset signature verification mode matched with the preset signature mode. And when the signature passes the verification, the data processing node acquires the current system time to generate a version number according to the current system time, and then adds the data block written with the version number into the block chain.
In one embodiment, the invoicing party device determines the number of block chain nodes for digitally signing the ticket modification data according to a preset signature condition, selects the number of block chain nodes from the block chain node cluster, and sends signature requests to the selected block chain nodes respectively. The selected block chain nodes may include data processing nodes.
In one embodiment, the block chain node receiving the signature request encrypts the bill modification data based on the signature private key of the block chain node to obtain a digital signature. And the invoicing side equipment splices the digital signatures to obtain corresponding digital signature arrays, and sends the digital signature arrays and the bill modification data to the data processing node. And the data processing node obtains a plurality of digital signatures according to the received numerical signature array, determines a signature public key corresponding to each digital signature, and decrypts the corresponding digital signature according to each signature public key to obtain a decrypted digital signature. And the data processing node compares each decrypted digital signature with the bill modification data respectively so as to verify the corresponding digital signature according to the comparison result. And when the bill modification data is consistent with the decrypted digital signature, judging that the verification result of the corresponding digital signature is verification pass. And the data processing node counts the number of the digital signatures of which the verification results are passed through the verification in the plurality of digital signatures, and when the counted number is greater than or equal to a preset number threshold, the signature verification result of the bill modification data is judged to be passed through the verification.
In one embodiment, the block nodes perform hash operation on the bill modification data through a hash algorithm to obtain a hash value, and encrypt the hash value by using a signature private key of the block nodes to obtain a digital signature. Correspondingly, the data processing node decrypts the corresponding digital signature by using each signature public key, performs hash operation on the bill modification data through a hash algorithm to obtain a hash value, and compares each decrypted digital signature with the hash value obtained through calculation respectively so as to determine a signature verification result according to the comparison result.
In one embodiment, the invoicer device receives the digital signature and the signature public key fed back by each block link point, and obtains a corresponding digital signature array according to each digital signature and signature public key. The invoicer device may take the initial ticket data, the first version number and the ticket modification data as transaction data, and trigger the above-mentioned digital signature operation and the chaining operation for the transaction data to write the transaction data into the blockchain.
In one embodiment, when receiving a signature request corresponding to a bill identifier, a block link point executes an intelligent contract corresponding to the bill identifier according to the signature request, and encrypts bill modification data by using a signature private key of the block link point to obtain a digital signature when the intelligent contract is successfully executed.
In the above embodiment, the digital signature is performed on the ticket modification data through the plurality of block link points, and the signature verification is performed on the ticket modification data according to the plurality of digital signatures when the link entry operation is performed, so as to ensure the validity and validity of the ticket modification data, thereby ensuring the reliability and non-tamper-ability of the ticket data recorded in the block link.
As shown in fig. 3, in one embodiment, there is provided a ticket data processing method, including the steps of:
s302, the invoicing side equipment obtains a bill data modification request carrying a bill identification.
S304, the invoicing side device generates a bill data acquisition request carrying a bill identification according to the bill data modification request, and sends the bill data acquisition request to the data processing nodes in the block chain node cluster.
S306, the data processing node analyzes the bill data acquisition request to obtain a bill identifier and an operator identifier of the invoicing party.
And S308, the data processing node verifies the authority of the operator of the invoicer corresponding to the operator identifier of the invoicer according to the operator identifier of the invoicer and a preset verification mode.
And S310, when the verification is passed, the data processing node searches corresponding initial bill data in the block chain according to the bill identification, and takes the version number corresponding to the initial bill data as a first version number.
And S312, the invoicing side equipment receives the initial bill data and the first version number which are fed back by the data processing node.
And S314, the invoicing party device displays the initial bill data to an invoicing party operator through a user operation interface, and detects a bill data submission instruction triggered by the invoicing party operator according to the initial bill data in real time.
And S316, when a bill data submitting instruction is detected, the invoicing party equipment acquires bill modification data pre-entered by an invoicing party operator for the initial bill data, and searches the current latest version number corresponding to the bill identification from the data processing node as a second version number.
And S318, when the first version number is consistent with the second version number, the invoicing side equipment generates a signature request carrying bill modification data.
S320, the invoicing side equipment sends the signature request to a plurality of block chain nodes in the block chain node cluster; and the sent signature request is used for indicating a plurality of block chain nodes, and signing the bill modification data respectively according to a preset signature mode to obtain a digital signature.
And S322, the invoicing side equipment receives the digital signatures fed back by the plurality of block chain nodes, obtains a digital signature array according to each digital signature, and sends the digital signature array and the bill modification data to the data processing node.
S324, the data processing node identifies the bill modification data based on an identification mechanism and generates a data block corresponding to the bill modification data passing the identification.
And S326, the data processing node performs signature verification on the bill modification data according to the digital signature array according to a preset signature verification mode.
And S328, when the signature passes the verification, the data processing node acquires the current system time, generates a version number corresponding to the bill modification data according to the current system time, writes the generated version number into the data block, and adds the data block with the written version number into the block chain.
In an embodiment, the method for processing ticket data provided in the above embodiment further includes: and after obtaining the digital signature array corresponding to the bill modification data, the invoicing side equipment sends the digital signature array, the bill modification data and the first version number to the data processing node. And after the data processing node generates the data block passing the consensus, searching the current latest version number corresponding to the bill identifier in the block chain to be used as a third version number, and comparing the first version number with the third version number. And when the two are consistent, the data processing node jumps to the step of carrying out signature verification on the bill modification data according to the digital signature array according to a preset signature verification mode and continues to execute.
In one embodiment, the invoicing party device encrypts the ticket modification data based on the invoicing party private key to obtain a ticket data ciphertext and sends the ticket data ciphertext and the digital signature array to the data processing node. Correspondingly, the data processing node decrypts the bill data ciphertext based on the public key of the billing party to obtain bill modification data, and the step of identifying the bill modification data based on the consensus mechanism is skipped to continue to be executed.
It should be understood that although the various steps in the flow diagrams of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in FIG. 1, there is provided a ticket data processing system comprising: biller equipment 102 and block link points 104;
the invoicing side device 102 is configured to obtain initial ticket data corresponding to the ticket identifier and a version number corresponding to the initial ticket data, and use the obtained version number as a first version number; displaying the initial bill data to an operator of the invoicing party through a user operation interface, and detecting a bill data submission instruction triggered by the operator of the invoicing party aiming at the initial bill data in real time;
the invoicing party equipment 102 is further configured to, when a bill data submission instruction is detected, obtain bill modification data that is pre-entered by an invoicing party operator for the initial bill data, and search a current latest version number corresponding to the bill identification from the block link point 104 as a second version number; when the first version number is consistent with the second version number, transmitting the bill modification data to the block chain node;
blockchain node 104 for writing the ticket modification data into the blockchain.
In one embodiment, the invoicing party device 102 is further configured to obtain a ticket data modification request carrying a ticket identifier; generating a bill data acquisition request carrying a bill identification according to the bill data modification request, and sending the bill data acquisition request to the block link node 104; the block chain node 104 is further configured to search, according to the ticket data acquisition request, initial ticket data corresponding to the ticket identifier from the block chain, and use a version number corresponding to the initial ticket data as a first version number; the invoicing side device 102 is further configured to receive initial ticket data and the first version number, which are correspondingly fed back by the blockchain node 104.
In one embodiment, the block link point 104 is further configured to parse the ticket data acquisition request to obtain a ticket identifier and a biller operator identifier; verifying the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the operator identification of the invoicing party and a preset verification mode; and when the verification is passed, searching corresponding initial bill data in the block chain according to the bill identification.
In one embodiment, the invoicing party device 102 is further configured to encrypt the ticket modification data through the invoicing party private key to obtain a ticket data ciphertext and send the ticket data ciphertext to the block chain node 104 when the first version number is consistent with the second version number; and the block chain node 104 is further configured to decrypt the bill data ciphertext through the public key of the invoker corresponding to the private key of the invoker to obtain bill modification data, and write the bill modification data into the block chain.
In one embodiment, the invoicer device 102 is further configured to send the ticket modification data to the blockchain node 104 when the first version number is consistent with the second version number; the block chain node 104 is further configured to perform consensus on the ticket modification data based on a consensus mechanism, and generate a data block corresponding to the ticket modification data that passes the consensus; and acquiring the current system time, generating a version number corresponding to the bill modification data according to the current system time, writing the generated version number into the data block, and adding the data block with the written version number into the block chain.
In one embodiment, the invoicer device 102 is further configured to send the ticket modification data and the first version number to the blockchain node; the block chain node 104 is further configured to search a current latest version number corresponding to the ticket identifier in the block chain, and use the current latest version number as a third version number; and when the first version number is consistent with the third version number, skipping to the step of acquiring the current system time and continuing to execute.
As shown in fig. 4, in an embodiment, the ticket data processing system further includes: a cluster of block chain nodes 110; one or more embodiments described above provide that the block link points 104 in the ticket data processing system are data processing nodes 104 in a block link node cluster 110;
the invoicing side device 102 is further configured to generate a signature request carrying bill modification data when the first version number is consistent with the second version number; sending the signature request to a plurality of block chain nodes (such as block chain node 112, block chain link point 114, block chain link point 116, etc. which may communicate with each other through a network connection) in the block chain node cluster 110; the sent signature request is used for indicating a plurality of block chain nodes, and signing the bill modification data respectively according to a preset signature mode to obtain a digital signature;
the invoicing side device 102 is further configured to receive digital signatures fed back by the plurality of block chain nodes, obtain a digital signature array according to each digital signature, and send the digital signature array and the bill modification data to the data processing node;
the data processing node 104 is used for performing signature verification on the bill modification data according to the digital signature array in a preset signature verification mode; and when the signature passes the verification, acquiring the current system time.
For specific limitations of the ticket data processing system, reference may be made to the above limitations of the ticket data processing method, which are not described herein again.
In one embodiment, a computer device is provided, which may be a biller device or a block link point, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The database of the computer device may be used to store initial ticket data, a first version number and ticket modification data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a ticket data processing method.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), rambus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
All possible combinations of the technical features in the above embodiments may not be described for the sake of brevity, but should be considered as being within the scope of the present disclosure as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is specific and detailed, but not to be understood as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A ticket data processing method, the method comprising:
the invoicing side equipment acquires a bill data modification request carrying a bill identification;
the invoicing side equipment generates a bill data acquisition request carrying the bill identification according to the bill data modification request and sends the bill data acquisition request to a block chain node;
the block chain node analyzes the bill data acquisition request to obtain the bill identification and the operator identification of the invoicing party;
the block chain link point verifies the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the operator identification of the invoicing party and a preset verification mode;
when the verification is passed, the block chain node searches corresponding initial bill data in the block chain according to the bill identification, and takes the version number corresponding to the initial bill data as a first version number;
the invoicing side equipment receives the initial bill data and the first version number correspondingly fed back by the block link point;
the invoicing party equipment displays the initial bill data to an invoicing party operator through a user operation interface, and detects a bill data submission instruction triggered by the invoicing party operator aiming at the initial bill data in real time;
when the bill data submission instruction is detected, the invoicing party equipment acquires bill modification data pre-entered by the invoicing party operator for the initial bill data, and searches the current latest version number corresponding to the bill identification from the block link points to serve as a second version number;
when the first version number is identical to the second version number, the invoicer device writes the ticket modification data into a blockchain by means of the blockchain node.
2. The method of claim 1, wherein the invoicer device writing the ticket modification data into a blockchain by way of the blockchain node when the first version number is consistent with the second version number comprises:
when the first version number is consistent with the second version number, the invoicing party equipment encrypts the bill modification data through a private key of the invoicing party to obtain a bill data ciphertext, and sends the bill data ciphertext to the block chain node;
and the block chain node decrypts the bill data ciphertext through the public key of the invoker corresponding to the private key of the invoker to obtain the bill modification data, and writes the bill modification data into the block chain.
3. The method of claim 1, wherein when the first version number is consistent with the second version number, the biller device writes the ticket modification data into a blockchain by way of the blockchain node, including:
when the first version number is consistent with the second version number, the invoicing side equipment sends the bill modification data to the block chain node;
the block link points carry out consensus on the bill modification data based on a consensus mechanism, and generate data blocks corresponding to the bill modification data passing the consensus;
and the block link point acquires the current system time, generates a version number corresponding to the bill modification data according to the current system time, writes the generated version number into the data block, and adds the data block written with the version number into a block chain.
4. The method of claim 3, wherein the invoicer device sending the ticket modification data to the blockchain node comprises:
the invoicing side equipment sends the bill modification data and the first version number to the block chain node;
after generating the data block corresponding to the bill modification data passing the consensus, the method further comprises:
the block chain node searches the current latest version number corresponding to the bill identification in the block chain to be used as a third version number;
and when the first version number is consistent with the third version number, the block link point skips to the step of acquiring the current system time and continues to execute.
5. The method of claim 3, wherein the blockchain node is a data processing node in a cluster of blockchain nodes; when the first version number is consistent with the second version number, the invoicer device sends the bill modification data to the blockchain node, including:
when the first version number is consistent with the second version number, the invoicing side equipment generates a signature request carrying the bill modification data;
the invoicer device sends the signature request to a plurality of blockchain nodes in the blockchain node cluster; the sent signature request is used for indicating the plurality of block chain nodes, and signing the bill modification data respectively according to a preset signature mode to obtain a digital signature;
the invoicing side equipment receives the digital signatures fed back by the plurality of block chain nodes, obtains a digital signature array according to each digital signature, and sends the digital signature array and the bill modification data to the data processing node;
the block link point acquiring the current system time comprises the following steps:
the data processing node performs signature verification on the bill modification data according to the digital signature number group in a preset signature verification mode;
and when the signature passes the verification, the data processing node acquires the current system time.
6. A ticket data processing system, the system comprising: invoicing party equipment and block link points;
the invoicing side equipment is used for acquiring a bill data modification request carrying a bill identification; the invoicing side equipment generates a bill data acquisition request carrying the bill identification according to the bill data modification request and sends the bill data acquisition request to a block chain node;
the block chain node is used for analyzing the bill data acquisition request to obtain the bill identification and the operator identification of the invoicing party; the block link point verifies the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the operator identification of the invoicing party and a preset verification mode; when the verification is passed, the block chain node searches corresponding initial bill data in the block chain according to the bill identification, and takes the version number corresponding to the initial bill data as a first version number;
the invoicing side equipment is used for receiving the initial bill data and the first version number which are correspondingly fed back by the block chain link points; displaying the initial bill data to an operator of a billing party through a user operation interface, and detecting a bill data submission instruction triggered by the operator of the billing party aiming at the initial bill data in real time;
the invoicer equipment is further used for acquiring bill modification data pre-entered by the invoicer operator for the initial bill data when the bill data submission instruction is detected, and searching the current latest version number corresponding to the bill identification from the block chain node as a second version number; when the first version number is consistent with the second version number, the bill modification data is sent to the block chain node;
and the block chain node is used for writing the bill modification data into a block chain.
7. The system of claim 6, wherein the invoicer device is further configured to send the ticket modification data to the blockchain node when the first version number is consistent with the second version number;
the block chain node is further used for carrying out consensus on the bill modification data based on a consensus mechanism and generating a data block corresponding to the bill modification data passing the consensus; acquiring current system time, generating a version number corresponding to the bill modification data according to the current system time, writing the generated version number into the data block, and adding the data block written with the version number into a block chain.
8. The system of claim 7, further comprising: a cluster of block chain nodes; the block chain node is a data processing node in the block chain node cluster;
the invoicing side equipment is also used for generating a signature request carrying the bill modification data when the first version number is consistent with the second version number; sending the signature request to a plurality of blockchain nodes in the blockchain node cluster; the sent signature request is used for indicating the plurality of block chain nodes, and signing the bill modification data respectively according to a preset signature mode to obtain a digital signature;
the invoicing side equipment is also used for receiving the digital signatures fed back by the plurality of block chain nodes, obtaining a digital signature array according to each digital signature, and sending the digital signature array and the bill modification data to the data processing node;
the data processing node is used for performing signature verification on the bill modification data according to a preset signature verification mode and the digital signature number group; and when the signature passes the verification, acquiring the current system time.
9. The system of claim 6, wherein the invoicer device is further configured to obtain a ticket data modification request carrying a ticket identification; generating a bill data acquisition request carrying a bill identification according to the bill data modification request, and sending the bill data acquisition request to the block chain node;
the block chain node is also used for searching initial bill data corresponding to the bill identification from the block chain according to the bill data acquisition request, and taking the version number corresponding to the initial bill data as a first version number;
the invoicing side equipment is also used for receiving initial bill data and a first version number which are correspondingly fed back by the block link points.
10. The system of claim 6, wherein the blockchain node is further configured to parse the ticket data acquisition request to obtain a ticket identifier and a biller operator identifier; verifying the authority of the operator of the invoicing party corresponding to the operator identification of the invoicing party according to the operator identification of the invoicing party and a preset verification mode; and when the verification is passed, searching corresponding initial bill data in the block chain according to the bill identification.
CN201910419901.7A 2019-05-20 2019-05-20 Bill data processing method and system Active CN110224833B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910419901.7A CN110224833B (en) 2019-05-20 2019-05-20 Bill data processing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910419901.7A CN110224833B (en) 2019-05-20 2019-05-20 Bill data processing method and system

Publications (2)

Publication Number Publication Date
CN110224833A CN110224833A (en) 2019-09-10
CN110224833B true CN110224833B (en) 2023-03-10

Family

ID=67821400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910419901.7A Active CN110224833B (en) 2019-05-20 2019-05-20 Bill data processing method and system

Country Status (1)

Country Link
CN (1) CN110224833B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110599270B (en) * 2019-09-16 2024-05-10 腾讯科技(深圳)有限公司 Electronic bill generation method and device and computer equipment
CN110853216B (en) * 2019-10-18 2022-06-17 深圳壹账通智能科技有限公司 Information storage method, information storage device, information storage medium and computer equipment
CN111563040B (en) * 2020-05-08 2023-08-15 中国工商银行股份有限公司 Block chain intelligent contract code testing method and device
CN112149077B (en) * 2020-10-12 2022-03-25 杭州云链趣链数字科技有限公司 Supply chain billing method, system and computer equipment based on block chain technology
CN112560112B (en) * 2020-12-15 2022-09-02 杭州趣链科技有限公司 Block chain based information shielding method, device, equipment and readable storage medium
CN113094754B (en) * 2021-05-08 2022-11-01 重庆银行股份有限公司 Big data platform data modification system and modification, response, cache and verification method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693597A (en) * 2011-03-25 2012-09-26 航天信息股份有限公司 Local printing method based on remote bill information and apparatus thereof
CN108648026A (en) * 2018-04-04 2018-10-12 苏宁易购集团股份有限公司 A kind of method and device of modification invoice information
CN109118214A (en) * 2017-06-26 2019-01-01 华为技术有限公司 The method and apparatus for running intelligent contract
CN109325812A (en) * 2018-08-24 2019-02-12 深圳市智税链科技有限公司 About the data processing method of electronic bill, device, storage medium and equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11202002308RA (en) * 2017-11-01 2020-04-29 Swirlds Inc Methods and apparatus for efficiently implementing a fast-copyable database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693597A (en) * 2011-03-25 2012-09-26 航天信息股份有限公司 Local printing method based on remote bill information and apparatus thereof
CN109118214A (en) * 2017-06-26 2019-01-01 华为技术有限公司 The method and apparatus for running intelligent contract
CN108648026A (en) * 2018-04-04 2018-10-12 苏宁易购集团股份有限公司 A kind of method and device of modification invoice information
CN109325812A (en) * 2018-08-24 2019-02-12 深圳市智税链科技有限公司 About the data processing method of electronic bill, device, storage medium and equipment

Also Published As

Publication number Publication date
CN110224833A (en) 2019-09-10

Similar Documents

Publication Publication Date Title
CN110224833B (en) Bill data processing method and system
CN110377239B (en) Data signature method, device, server, system and storage medium
WO2021203586A1 (en) Method and device for processing customs declaration data, computer device, and storage medium
CN110597837B (en) Service data processing method, device, storage medium and computer equipment
CN110633963B (en) Electronic bill processing method, electronic bill processing device, computer readable storage medium and computer readable storage device
CN110912712B (en) Service operation risk authentication method and system based on block chain
CN109191272B (en) Data processing method, device, storage medium and equipment for electronic bill
CN110781509B (en) Data verification method and device, storage medium and computer equipment
CN111523890B (en) Block chain-based data processing method, device, storage medium and equipment
CN113285954B (en) Verifiable statement verification method, system, electronic device and storage medium
CN110602116B (en) Block chain based data verification method, device and computer readable storage medium
US9230135B2 (en) Secure access for sensitive digital information
CN111127150B (en) Intelligent contract demand matching method and device based on block chain and computer equipment
CN110502889B (en) Login method, login device, computer readable storage medium and computer equipment
CN111597567B (en) Data processing method, data processing device, node equipment and storage medium
CN110011796B (en) Certificate updating method and device, computer equipment and storage medium
CN111131234A (en) Intelligent contract data processing method and device in supply chain and computer equipment
CN111340483A (en) Data management method based on block chain and related equipment
CN110599270A (en) Electronic bill generation method and device and computer equipment
CN108540447B (en) Block chain-based certificate verification method and system
CN111476652A (en) Data processing method and device based on block chain, terminal and storage medium
US11310052B1 (en) Identity authentication blockchain
CN110599332A (en) Block chain-based user intention determination method, device, equipment and storage medium
CN116962021A (en) Method, device, equipment and medium for user real name authentication in financial cooperative institution
CN113364763B (en) Verifiable statement generation method and device, electronic equipment and storage medium

Legal Events

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