Search

CN-121526618-B - Bill compliance verification system and method based on blockchain

CN121526618BCN 121526618 BCN121526618 BCN 121526618BCN-121526618-B

Abstract

The invention discloses a bill compliance verification system and method based on a blockchain, and relates to the technical field of bill safety.A topological network is constructed according to business data of a ticket issuing party and a ticket receiving party, core elements of the ticket issuing party are extracted, a ticket issuing hash is generated through hash calculation and signature, and a bill reference topological data packet is output; extracting ticket receiving party ticket receiving request data, generating topology data package to be verified after associating standard data package verification format, completing consistency verification by comparing original element hash with element hash to be verified, collecting ticket hash when hash is consistent, screening suspected collision group, distinguishing collision type based on topology network rule, outputting report, positioning falsification field and analyzing bit difference when hash is inconsistent, deriving ticket real element and generating confirmation list by combining topology network when judging real collision, finally integrating output content of whole flow, judging abnormal operation state and executing targeted process.

Inventors

  • YE YOUCAN
  • FENG GUIAN
  • WANG DIE
  • ZHU CE
  • Chen Beiqi
  • Shen Tianjie
  • TONG SHAN

Assignees

  • 上海市大数据中心

Dates

Publication Date
20260505
Application Date
20260115

Claims (9)

  1. 1. A blockchain-based ticket compliance verification method, comprising: Extracting ticket core elements of the ticket issuing party, calculating original element hash, generating ticket issuing hash by combining ticket issuing party signature, outputting a ticket reference topology data packet, specifically splicing according to formats of the original element hash, separator and ticket issuing party digital signature, and calculating by adopting SHA256 hash algorithm to obtain ticket issuing hash; Extracting bill receiving request data of a bill receiving party, recording request node information, associating bill reference topology data packets to verify data format compliance, outputting the topology data packets to be verified, particularly associating the bill reference topology data packets, extracting preset standardized format rules in the topology data packets, verifying whether the data types and formats of elements to be verified are compliant, integrating the bill receiving request data, the request node information and the elements to be verified after the compliance are verified, adding format verification passing identifiers to generate and output the topology data packets to be verified when the verification is failed, returning a format abnormality prompt, and reinitiating the bill receiving request after the bill receiving party is corrected according to the prompt to execute the format verification again; The method comprises the steps of calling an original element hash, calculating element hash to be verified, comparing consistency, outputting an element hash consistency check result, specifically calling the original element hash stored in a bill reference topological data packet, extracting a to-be-verified element after being combined in the to-be-verified topological data packet, processing according to a standardized format rule consistent with that of the original element hash, carrying out hash calculation on the to-be-verified element after being standardized by adopting an SHA256 hash algorithm to obtain the to-be-verified element hash, comparing the to-be-verified element hash with the original element hash in a bit-by-bit mode, judging whether byte sequences of the to-be-verified element hash and the original element hash are completely matched, outputting the element hash consistency check result as consistent, attaching the original element hash and a matching result instruction when any byte is not matched, outputting the specific content and a difference prompt of the original element hash and the to-be-verified element hash, and outputting the element hash consistency check result; When the hashes are consistent, collecting the hash values of all the bills, screening suspected collision groups, particularly, when the element hash consistency verification results are consistent, collecting the original element hashes corresponding to all the historical bills stored in a alliance chain and the element hashes to be verified currently to form a full-quantity bill hash set; when the hashes are inconsistent, positioning the tampered field, calculating a bit difference value and outputting a tampered field analysis report; When the real collision is judged, the real elements of the bill are deduced according to the topological network, a bill real state confirmation list is generated, output contents are integrated, and the abnormal operation state is judged and processed.
  2. 2. The blockchain-based ticket compliance verification method of claim 1, wherein the constructing a topology network from service data of the ticket issuing party and the ticket receiving party comprises: Collecting ticket outlet side business data comprising ticket outlet side inventory data, historical ticket data and stock period data, collecting ticket collecting side business data comprising ticket collecting side inventory data, inventory index data and stock period data, setting core business nodes comprising ticket outlet side current inventory sub-nodes, ticket outlet side historical inventory sub-nodes, ticket collecting side current inventory sub-nodes, ticket collecting side historical inventory sub-nodes, ticket collecting side inventory index nodes, historical ticket collecting sub-nodes and current ticket nodes, setting check association nodes comprising hash check nodes, inventory balance nodes and business rule nodes; Establishing a topology side association rule, wherein the side rule of the ticket outlet side historical stock subnode and the historical ticket collection subnode is that the ticket outlet side inventory reduction amount is equal to the corresponding ticket delivery amount, the side rule of the ticket receiving side historical stock subnode and the historical ticket collection subnode is that the ticket receiving side inventory increase amount is equal to the corresponding ticket delivery amount, the side rule of the current ticket node and the stock balance node is that the ticket outlet side inventory reduction amount is equal to the ticket receiving side inventory increase amount, the side rule of the current ticket node and the business rule node is that the delivery amount is less than or equal to the ticket receiving side inventory index, the unit price is in the ticket outlet side historical delivery unit price interval, and the sum is equal to the product of the delivery amount and the unit price; The method comprises the steps of forming a core closed loop, and constructing a topology network, wherein the ticket outlet side inventory change closed loop is formed by sequentially associating a ticket outlet side historical inventory sub-node, a historical ticket collection sub-node and a ticket outlet side current inventory sub-node, the ticket collecting side inventory change closed loop is formed by sequentially associating a ticket collecting side historical inventory sub-node, a historical ticket collection sub-node and a ticket collecting side current inventory sub-node, the ticket element check closed loop is formed by sequentially associating a historical ticket collection sub-node, a business rule node and a current ticket node, the hash association closed loop is formed by sequentially associating a historical ticket collection sub-node, a hash check node and a current ticket node, and the topology side association rule and the core closed loop form a topology network rule.
  3. 3. The blockchain-based ticket compliance verification method of claim 1, wherein the extracting the ticket core element of the ticket issuer, calculating the original element hash, generating the ticket issuer hash in combination with the ticket issuer signature, and outputting the ticket reference topology data packet comprises: Extracting ticket core elements submitted by a ticket issuing party, wherein the ticket core elements comprise ticket numbers, delivery amounts, unit price, amount of money, delivery date, ticket issuing party names and ticket receiving party names; The method comprises the steps of carrying out hash calculation on a bill core element processed in a standardized format by adopting an SHA256 hash algorithm to obtain an original element hash, carrying out digital signature on the original element hash through a private key on a ticket issuing party chain to generate a ticket issuing party digital signature, and carrying out combined operation on the original element hash and the ticket issuing party digital signature to generate the ticket issuing hash.
  4. 4. The blockchain-based ticket compliance verification method of claim 1, wherein the extracting ticket of the ticket receiver receives the request data, records the request node information, verifies the data format compliance of the associated ticket reference topology data packet, and outputs the topology data packet to be verified, comprising: extracting bill receiving request data initiated by a bill receiving party, wherein the bill receiving request data comprises a bill number, an element to be checked and a digital signature of the bill receiving party, the element to be checked corresponds to a bill core element of a bill discharging party and comprises a bill number, a delivery amount, unit price, amount, delivery date, a name of the bill discharging party and a name of the bill receiving party, and recording request node information comprising a request equipment identifier and a request timestamp.
  5. 5. The blockchain-based bill compliance verification method according to claim 1, wherein when hashes are consistent, aggregating hash values of all bills, screening suspected collision groups, distinguishing collision types based on topological network rules, and outputting a hash collision judgment report, comprising: Invoking a topology side association rule and a core closed loop constructed in a topology network to carry out multidimensional verification on all notes in a suspected collision group, wherein the multidimensional verification comprises verification of inventory variation consistency, verification element logic compliance and verification time sequence rationality, wherein the verification of inventory variation consistency is specifically to check whether the inventory decrease amount of an issuing party and the inventory increase amount of a receiving party corresponding to each group of notes are matched with the delivery amount of the respective notes and whether inventory variation logics of different notes in the group have no conflict; distinguishing the collision type based on the verification result, and judging as a pseudo collision when the element data of all the bills in the suspected collision group are completely consistent and the inventory variation, the element logic and the time sequence are consistent with the topological network rule; and generating a hash collision judgment report, wherein the hash collision judgment report comprises suspected collision group composition, multidimensional checking details, a collision type judgment result and a judgment basis.
  6. 6. The blockchain-based ticket compliance verification method of claim 1, wherein when the hashes are inconsistent, locating the tampered field, calculating a bit difference value, and outputting a tampered field analysis report, comprises: When the element hash consistency verification result is inconsistent, extracting original bill core elements from the bill reference topology data packet, extracting elements to be verified from the topology data packet to be verified, and ensuring that field types and arrangement sequences of the two groups of elements are completely corresponding; Comparing the original element with the element to be checked field by field, wherein the comparison content comprises data content, format specification and arrangement sequence of each field, finding out the field with unmatched content, and determining the field as a tampered field, and the specific comparison field comprises bill number, delivery amount, unit price, amount, delivery date, ticket issuing party name and ticket receiving party name; extracting an original element hash and an element hash to be checked, respectively converting the original element hash and the element hash to be checked into binary bit sequences, carrying out bit-by-bit comparison on the two binary bit sequences, counting bits with different bit values at corresponding positions as bit difference values, and recording specific values of the bit difference values and position distribution of difference bits; and generating a falsified field analysis report, wherein the falsified field analysis report comprises an original element source, an element source to be checked, a field-by-field comparison detail, falsified field specific information, a bit difference value, a calculation process and a difference bit position distribution.
  7. 7. The blockchain-based ticket compliance verification method of claim 1, wherein when the ticket is determined to be a real collision, deriving the ticket real elements from the topology network, generating a ticket real state validation ticket, comprises: when the collision type is judged to be a real collision, a core closed loop and topology side association rule of a topology network are called, and element data, ticket issuing party inventory data, ticket collecting party inventory data, time sequence data and historical ticket checking records corresponding to all tickets in a suspected collision group are extracted; Based on closed loop verification of the inventory change of the ticket issuing party, screening out the shipment data consistent with the inventory change logic based on the matching relation between the historical inventory reduction amount of the ticket issuing party and the shipment of the historical ticket, and determining the shipment data as the real shipment; based on the closed loop verification of ticket receiving party inventory change, combining the historical inventory increment of the ticket receiving party with the warehousing checking record, cross-verifying the accuracy of the real delivery quantity, ensuring the matching of the inventory change of the ticket receiving party with the real delivery quantity; integrating the real shipping quantity, the real unit price, the real amount, the real shipping date, the bill number, the name of the ticket issuing party and the name of the ticket receiving party to form a bill real element; And synchronizing the real elements of the bill to the nodes on the chains of the bill issuing party and the bill receiving party, and generating a bill real state confirmation list after acquiring confirmation feedback of the two parties, wherein the bill real state confirmation list comprises a suspected collision group identifier, bill real element details, a deduction basis and the confirmation state of the two parties.
  8. 8. The blockchain-based ticket compliance verification method of claim 1, wherein the integrating output content, determining and processing the abnormal state of operation, comprises: Integrating the output content of the whole flow, including element hash consistency check result, hash collision judgment report, falsification field analysis report, bill real element, bill real state confirmation list and format check record, to form a whole verification information set; Based on the total verification information set, classifying and judging an operation abnormal state, judging that bill elements are tampered and abnormal when element hash consistency verification results are inconsistent and clear tampered fields exist, judging that bill information conflicts and abnormal when a collision type is judged to be a real collision, judging that repeated request operation is abnormal when the collision type is judged to be a pseudo collision, and judging that data format submission is abnormal when format verification is not passed and a topology data packet to be verified is not generated; For bill element tampering abnormality, synchronizing a tamper field analysis report to a alliance chain supervision node and a ticket issuing party, triggering a chain to store a certificate and reserve tamper trace, pushing tamper early warning and element correction prompt to a ticket receiving party, for bill information conflict abnormality, distributing a bill real state confirmation list to the ticket issuing party and the ticket receiving party, updating the bill information on the chain after confirmation of the bill information conflict abnormality, marking the conflict bill state as verified correction; Generating an exception handling account, and recording exception types, judgment bases, handling measures, execution results and associated node information.
  9. 9. A blockchain-based ticket compliance verification system using a blockchain-based ticket compliance verification method of any of claims 1-8, comprising: The topology network construction module comprises a service data acquisition unit, a node configuration unit, a topology edge rule definition unit and a core closed loop construction unit, wherein the service data acquisition unit acquires service data; The bill reference data generation module comprises a bill element extraction unit, a hash calculation and signature unit and a reference data packet integration unit; the system comprises a bill element extraction unit, a hash calculation and signature unit, a reference data packet integration unit, a standard data packet integration unit, a bill element extraction unit and a bill element extraction unit, wherein the bill element extraction unit extracts a bill core element submitted by a bill party and completes standardized format processing; The request receiving and format checking module comprises a request data extracting unit, a format compliance checking unit and a to-be-checked data packet generating unit, wherein the request data extracting unit extracts ticket receiving party tickets to receive request data and request node information; The Hash collision analysis and real element deduction module comprises a Hash consistency check unit, a collision group collection and judgment unit and a real element deduction and confirmation unit; the system comprises a hash consistency verification unit, a collision group collection and judgment unit, a real element deduction and confirmation unit, a verification unit and a verification unit, wherein the hash consistency verification unit compares the consistency of an original element hash with an element hash to be verified and outputs a verification result and a difference prompt; the whole-flow exception handling module comprises an exception state judging unit, an exception handling executing unit and an exception account management unit, wherein the exception state judging unit integrates the whole-flow output content, classifies and judges exception types, the exception handling executing unit executes handling measures for different exception types, and the exception account management unit records exception types, judging basis, handling measures and executing results to generate and maintain an exception handling account.

Description

Bill compliance verification system and method based on blockchain Technical Field The invention relates to the technical field of bill safety, in particular to a bill compliance verification system and method based on a blockchain. Background The bill is used as a core certificate for financial transaction and supply chain settlement, and the compliance of the bill directly relates to transaction safety, supervision traceability and multiparty rights guarantee, but the conventional bill compliance verification method still has partial shortages. The conventional method generally does not consider the condition of hash collision, can only carry out consistent or inconsistent binary judgment on hash calculation and a hash value of a signature unit, does not pre-judge the hash collision scene, also lacks targeted classification treatment logic, and can not distinguish real collision caused by virtual collision caused by repeated submission and substantial collision of bill information when the hash is consistent, is easy to generate real information collision misjudgment and normal repeated submission misjudgment, and can only initially judge that tampering exists due to unassociated collision risk design tracing system when the hash is inconsistent, and further lacks quantitative analysis means for converting original element hash and element hash to be verified into binary bit sequences, calculating difference values and distribution, thereby bringing hindrance to supervision tracing and responsibility identification. Disclosure of Invention The invention aims to provide a bill compliance verification system and method based on a blockchain, which are used for solving the problems in the prior art. In order to achieve the above purpose, the present invention provides the following technical solutions: In a first aspect, the present invention provides a blockchain-based ticket compliance verification method, comprising: Extracting ticket core elements of the ticket issuing party, calculating original element hash, generating ticket issuing hash by combining the signature of the ticket issuing party, and outputting a ticket reference topology data packet; Extracting bill receiving request data of a bill receiving party, recording request node information, associating bill reference topology data packets to verify data format compliance, and outputting topology data packets to be verified; when the hashes are consistent, collecting hash values of all bills, screening suspected collision groups, distinguishing collision types based on topological network rules, and outputting a hash collision judgment report; when the hashes are inconsistent, locating the tampered field, calculating a bit difference value, and outputting a tampered field analysis report; When the real collision is judged, the real elements of the bill are deduced according to the topological network, a bill real state confirmation list is generated, output contents are integrated, and the abnormal operation state is judged and processed. With reference to the first aspect, in a first implementation manner of the first aspect of the present application, the constructing a topology network according to service data of the ticket issuing party and the ticket collecting party includes: Collecting ticket outlet side business data comprising ticket outlet side inventory data, historical ticket data and stock period data, collecting ticket collecting side business data comprising ticket collecting side inventory data, inventory index data and stock period data, setting core business nodes comprising ticket outlet side current inventory sub-nodes, ticket outlet side historical inventory sub-nodes, ticket collecting side current inventory sub-nodes, ticket collecting side historical inventory sub-nodes, ticket collecting side inventory index nodes, historical ticket collecting sub-nodes and current ticket nodes, setting check association nodes comprising hash check nodes, inventory balance nodes and business rule nodes; Establishing a topology side association rule, wherein the side rule of the ticket outlet side historical stock subnode and the historical ticket collection subnode is that the ticket outlet side inventory reduction amount is equal to the corresponding ticket delivery amount, the side rule of the ticket receiving side historical stock subnode and the historical ticket collection subnode is that the ticket receiving side inventory increase amount is equal to the corresponding ticket delivery amount, the side rule of the current ticket node and the stock balance node is that the ticket outlet side inventory reduction amount is equal to the ticket receiving side inventory increase amount, the side rule of the current ticket node and the business rule node is that the delivery amount is less than or equal to the ticket receiving side inventory index, the unit price is in the ticket outlet side historical delivery unit price interval, and the