CN116707821A - Transaction data processing method and device based on blockchain - Google Patents

Transaction data processing method and device based on blockchain Download PDF

Info

Publication number
CN116707821A
CN116707821A CN202310658678.8A CN202310658678A CN116707821A CN 116707821 A CN116707821 A CN 116707821A CN 202310658678 A CN202310658678 A CN 202310658678A CN 116707821 A CN116707821 A CN 116707821A
Authority
CN
China
Prior art keywords
transaction
node
endorsement
client
processing result
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.)
Pending
Application number
CN202310658678.8A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310658678.8A priority Critical patent/CN116707821A/en
Publication of CN116707821A publication Critical patent/CN116707821A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/3263Cryptographic 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 certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • 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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (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)

Abstract

The embodiment of the application provides a transaction data processing method and device based on a blockchain, which relate to the technical field of blockchains and can also be applied to the financial field, wherein the method comprises the following steps: registering and registering through member service to determine a identity certificate; transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result; receiving and verifying the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate; under the condition that verification is successful, the transaction processing result is packaged and signed and sent to a sequencing node of a blockchain network; the application can use the area number as dimension, so that when the clients are used for trading in different areas, only the trading processing results in the local area are required to be returned, and when the clients are used for trading in different areas, the businesses in different areas are positioned in different channels, and the security of the trading process is improved through channel isolation.

Description

Transaction data processing method and device based on blockchain
Technical Field
The application relates to the technical field of blockchains and also can be applied to the financial field, in particular to a transaction data processing method and device based on blockchains.
Background
Currently, in a scene where a cluster point list is required to be used, the existing scheme can directly acquire the merchant number and the merchant name from the tens of millions of point lists, and for enterprises with the number of point merchants about ten thousands, when the merchant selection is checked through POS point consumption details, the merchant number and the merchant name can be directly acquired from the point list, which can cause serious delay. In addition, the existing scheme lacks a function of supporting data tamper resistance, and the accuracy of data cannot be ensured by the returned merchant number and the merchant name when the merchant is clicked to select the related function. Finally, the existing scheme uses a cross-cluster calling scheme, and from the MAMP cluster, the CC cluster is called again through the ATS cluster to access the integral detail table. Such cross-cluster calling schemes may increase service query time, resulting in increased time consumption.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a transaction data processing method and device based on a blockchain, which can return only the transaction processing results of the local area when using clients to conduct transactions in different areas by taking area numbers as dimensions, and the transactions in different areas are located in different channels when using the clients to conduct transactions, so that the security of the transaction process is improved through channel isolation.
In order to solve at least one of the problems, the application provides the following technical scheme:
according to a first aspect of an embodiment of the present application, the present application provides a transaction data processing method based on a blockchain, applied to a client, the method including:
registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate;
receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the receiving the transaction processing result and the endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and the transaction proposal, comprising:
receiving a transaction processing result and an endorsement certificate returned by the endorsement node;
verifying whether an endorsement policy of the transaction processing result is consistent with contract identification, contract method and regional parameters in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
the verifying whether the endorsement policy and the regional parameter of the transaction processing result are consistent with the contract identification, the contract method and the regional parameter in the transaction proposal comprises the following steps:
Determining the endorsement policy according to the transaction processing result;
and verifying whether the area code, the merchant name, the total number of merchants involved in regional points and the specific implementation logic in the endorsement strategy are consistent with the contract identification, the contract method and the content corresponding to the regional parameters of the transaction proposal.
According to any embodiment of the application, the method further comprises:
responding to the end of a preset period, generating an integral statistical file according to a preset file rule by data in an integral detail table, wherein the statistical file comprises a plurality of integral statistical categories;
and merging and compressing the score statistical file according to the score statistical category to obtain the transaction database.
According to any embodiment of the application, the method further comprises:
and in response to the end of the preset period, migrating the transaction data in the transaction database obtained in the previous preset period to the historical database.
According to a second aspect of an embodiment of the present application, the present application provides a transaction data processing method based on a blockchain, applied to an endorsement node of a blockchain network, the method including:
receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
And sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the method for receiving the transaction proposal and the client signature sent by the client and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result comprises the following steps:
under the condition that the client side is determined to have the identity certificate, generating a corresponding endorsement policy according to a contract identifier, a contract method and region parameters required by the transaction in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal;
And processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result, including:
extracting regional transaction data corresponding to the region number in the contract identification from the transaction database;
and determining the merchant names meeting the requirements and the total number of the merchants related to the regional points in the regional transaction data as transaction processing results based on specific implementation logic in the contract method.
According to a third aspect of an embodiment of the present application, the present application provides a transaction data processing method based on a blockchain, applied to a sorting node of a blockchain network, the method including:
periodically determining a leader node from the plurality of follower nodes;
Sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through a current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas;
for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
According to any embodiment of the present application, an election timeout timer is provided in each of the following nodes, and the periodically determining a leader node from a plurality of following nodes includes:
responsive to expiration of the election timeout timer, determining the expired following node as a candidate node and sending request voting information to other following nodes;
And determining the candidate node with the highest received vote as the leader node in the current candidate nodes, and sending heartbeat information to other nodes so that the other candidate nodes restore to the following node after receiving the heartbeat information.
According to any embodiment of the present application, the determining, as the leader node, the candidate node that receives the most votes among the candidate nodes currently includes:
according to the transaction processing activity degree of the current day, obtaining the region in front of the transaction processing activity degree of the current day;
and determining the candidate node with the most votes among the candidate nodes in the region of the first three liveness as the leader node.
According to a fourth aspect of embodiments of the present application, there is provided a blockchain-based transaction data processing device, the device comprising:
a certificate acquisition module for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module for: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate;
The processing result checking module is used for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
a processing result sending module, configured to: and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the processing result checking module is specifically configured to, when receiving a transaction processing result and an endorsement credential returned by the endorsement node and verifying consistency of the transaction processing result and a transaction proposal:
verifying whether an endorsement policy of the transaction processing result is consistent with contract identification, contract method and regional parameters in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
the processing result checking module is specifically configured to, when verifying whether an endorsement policy and a regional parameter of the transaction processing result are consistent with a contract identifier, a contract method and a regional parameter in the transaction proposal, perform:
determining the endorsement policy according to the transaction processing result;
and verifying whether the area code, the merchant name, the total number of merchants involved in regional points and the specific implementation logic in the endorsement strategy are consistent with the contract identification, the contract method and the content corresponding to the regional parameters of the transaction proposal.
According to any embodiment of the application, the method further comprises a data compression module for:
responding to the end of a preset period, generating an integral statistical file according to a preset file rule by data in an integral detail table, wherein the statistical file comprises a plurality of integral statistical categories;
And merging and compressing the score statistical file according to the score statistical category to obtain the transaction database.
According to any embodiment of the present application, the method further comprises a data update module for:
and in response to the end of the preset period, migrating the transaction data in the transaction database obtained in the previous preset period to the historical database.
According to a fifth aspect of embodiments of the present application, there is provided a blockchain-based transaction data processing device, the device comprising:
a transaction proposal processing module for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
a transaction proposal return module for: and sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the transaction proposal processing module is used for receiving a transaction proposal and a client signature sent by a client and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, and is specifically used for:
under the condition that the client side is determined to have the identity certificate, generating a corresponding endorsement policy according to a contract identifier, a contract method and region parameters required by the transaction in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal;
and processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
The transaction proposal processing module processes the transaction database according to the endorsement policy, and is specifically used for when a corresponding transaction processing result is obtained:
extracting regional transaction data corresponding to the region number in the contract identification from the transaction database;
and determining the merchant names meeting the requirements and the total number of the merchants related to the regional points in the regional transaction data as transaction processing results based on specific implementation logic in the contract method.
According to a sixth aspect of embodiments of the present application, there is provided a blockchain-based transaction data processing device, the device comprising:
the leader node selection module: periodically determining a leader node from the plurality of follower nodes;
a sequencing receiving module, configured to: sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through a current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas;
A sequencing-uplink module for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
According to any embodiment of the present application, an election timeout timer is provided in each following node, and the leader node selection module is specifically configured to, when periodically determining a leader node from a plurality of following nodes:
responsive to expiration of the election timeout timer, determining the expired following node as a candidate node and sending request voting information to other following nodes;
and determining the candidate node with the highest received vote as the leader node in the current candidate nodes, and sending heartbeat information to other nodes so that the other candidate nodes restore to the following node after receiving the heartbeat information.
According to any embodiment of the present application, the leader node selection module is specifically configured to, when determining, as the leader node, a candidate node having the highest received vote among the candidate nodes currently:
according to the transaction processing activity degree of the current day, obtaining the region in front of the transaction processing activity degree of the current day;
And determining the candidate node with the most votes among the candidate nodes in the region of the first three liveness as the leader node.
According to a seventh aspect of embodiments of the present application, there is provided a blockchain-based transaction data processing system including a client, an endorsement node, and a ranking node disposed in a blockchain network;
the client comprises:
a certificate acquisition module for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module for: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, the client signature comprising the identity certificate;
the processing result checking module is used for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
a processing result sending module, configured to: under the condition that verification is successful, the transaction processing result is packaged and signed and sent to a sequencing node of a blockchain network;
The endorsement node includes:
a transaction proposal processing module for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
a transaction proposal return module for: transmitting the transaction processing result and an endorsement credential to the client;
the ordering node comprises:
the leader node selection module: periodically determining a leader node from the plurality of follower nodes;
a sequencing receiving module, configured to: sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through a current leader node;
a sequencing-uplink module for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
According to an eighth aspect of an embodiment of the present application, there is provided an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the blockchain-based transaction data processing method when executing the program.
According to a ninth aspect of embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the blockchain-based transaction data processing method.
According to a tenth aspect of embodiments of the present application, there is provided a computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the blockchain-based transaction data processing method.
According to the technical scheme, the application provides a transaction data processing method and device based on a blockchain, which are used for registering and registering through member services to determine a identity certificate; transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result; receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate; and under the condition that the verification is successful, the transaction processing result is packaged and signed, and is sent to a sequencing node of the blockchain network. The application can use the area number as dimension, so that when the clients are used for trading in different areas, only the trading processing results in the local area are required to be returned, and when the clients are used for trading in different areas, the businesses in different areas are positioned in different channels, and the security of the trading process is improved through channel isolation.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 2 is a second flowchart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 3 is a third flow chart of a block chain based transaction data processing method according to an embodiment of the application;
FIG. 4 is a flowchart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a blockchain-based transaction data processing method in accordance with an embodiment of the present application;
FIG. 6 is a second diagram of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 7 is a flowchart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 8 is a flowchart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 9 is a flow chart of a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 10 is a flowchart illustrating a block chain based transaction data processing method according to an embodiment of the present application;
FIG. 11 is a third exemplary illustration of a blockchain-based transaction data processing method in accordance with the present application;
FIG. 12 is a flowchart illustrating a blockchain-based transaction data processing method in accordance with an embodiment of the present application;
FIG. 13 is a block diagram of one of the block chain based transaction data processing devices in accordance with an embodiment of the present application;
FIG. 14 is a second block diagram of a blockchain-based transaction data processing device in accordance with an embodiment of the present application;
FIG. 15 is a third block diagram of a blockchain-based transaction data processing device in accordance with the embodiments of the present application;
FIG. 16 is a block chain based transaction data processing system in accordance with an embodiment of the present application;
fig. 17 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
Considering the problems that the existing scheme is seriously delayed, the function of preventing data from being tampered is not supported, and the service inquiry time is increased by a cross-cluster calling scheme, the application provides a transaction data processing method and device based on a blockchain.
In order to take a region number as a dimension, only a transaction processing result of a local region needs to be returned when a client is used for transaction in different regions, and the business in different regions is located in different channels when the client is used for transaction, and the security of the transaction process is improved through channel isolation, the application provides an embodiment of a block chain-based transaction data processing method applied to the client, and referring to fig. 1, the block chain-based transaction data processing method specifically comprises the following contents:
step S101: and registering through member service to determine an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area.
Wherein the member service is used for managing and verifying the identity of the application program client, and the provided member service functions comprise registration, certificate application and the like, and the client can only join in the blockchain network after obtaining the certificate.
When an application client needs to participate in a data processing service in a specified region, registration and registration by a member service are first required. During the registration process, the client provides relevant identity information and verification material, and is granted an identity certificate after verification.
The identity certificate characterizes the identity certificate of the client in the data processing service of the appointed area. Through the identity certificate, the system can verify the identity of the client and ensure that the client has the authority to perform related services. The identity certificate may be used to identify and identify the client in the system and to authenticate and interact data between the client and other participants.
Illustratively, first, the merchant's application client may use a corresponding Software Development Kit (SDK) to invoke the member services. The SDK provides an interface for interaction with the member service, which is convenient for the merchant to register and register.
After verification and approval of member services, the merchant will obtain an identity certificate as an identity credential. The identity certificate will be generated by the member service and contains the identity information of the merchant and the corresponding key pair. The merchant can perform identity verification and authorization in subsequent point inquiring and blending operations.
Step S102: and sending a transaction proposal and a client signature to an endorsement node of the blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate.
Wherein the application client prepares a transaction proposal prior to conducting the transaction operation. The transaction proposal includes specific operations to be performed and related parameters, such as specific details of performing a point query or blending. In addition, the client also signs the transaction proposal with its identity certificate to prove its identity and authorization.
The application client then sends the prepared transaction proposal and client signature to the endorsement node of the blockchain network and requests it to verify and process the transaction.
Once the endorsement node receives the transaction proposal and the client signature, it will be processed. Illustratively, the endorsement node will verify the validity of the client signature to ensure that the transaction is sent by the authorized client and thereafter process the transaction proposal, performing a corresponding operation, such as querying the points or performing a point blend.
After the endorsement node processes the transaction, a corresponding transaction processing result is generated. This result may include the status of the performed operation, related data updates, or other related information. The endorsement node will return the transaction processing result to the application client so that the client obtains the final result of the transaction.
Step S103: and receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate.
The application program client compares the received transaction processing result with the transaction proposal sent before so as to verify the consistency of the transaction processing result. The client checks whether the execution status, returned data, etc. in the transaction processing result are consistent with the expected transaction proposal to ensure the correct execution of the transaction.
In addition, the application client needs to verify the validity of the received endorsement credential. The endorsement credential is generated by an endorsement node and used for proving the validity and credibility of a transaction processing result, and the client can use a pre-agreed verification method to verify the validity of the endorsement credential, including verifying the digital signature, identity information and the like of the endorsement credential so as to ensure that the endorsement credential is generated by a legal and untampered endorsement node.
In an embodiment of the blockchain-based transaction data processing method of the present application, the transaction proposal includes a contract identifier, a contract method and a regional parameter required for the present transaction, and the receiving the transaction processing result and the endorsement credential returned by the endorsement node, and verifying the consistency of the transaction processing result and the transaction proposal, see fig. 2, may further specifically include the following:
Step S103A: and receiving a transaction processing result and an endorsement certificate returned by the endorsement node.
Step S103B: verifying whether an endorsement policy of the transaction processing result is consistent with contract identification, contract method and regional parameters in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
The transaction proposal comprises a contract identifier, a contract method and regional parameters required by the transaction. The contract identification is used to determine the specific contract to invoke, the contract method specifies the operation to be performed, and the zone parameters provide information about the region involved in the transaction. Together, these information constitute a transaction proposal for sending and executing the corresponding transaction to the endorsing node.
And in the transaction processing result and the endorsement certificate returned by the endorsement node received by the application program client, the transaction processing result represents the result obtained after the endorsement node executes the transaction proposal, wherein the transaction processing result comprises relevant information such as execution state, data update and the like.
Specifically, the client verifies whether the endorsement policy of the transaction processing result is consistent with the contract identification, contract method and regional parameters in the transaction proposal. The endorsement policy indicates a processing policy generated by the endorsement node according to the transaction proposal, and the client verifies whether the policy is consistent with the relevant information of the transaction proposal.
In one embodiment of the blockchain-based transaction data processing method of the present application, the contract identification includes querying for an obtained area code, returning a merchant name, and returning a total number of merchants related to the area points;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
the step of verifying whether the endorsement policy and the regional parameter of the transaction processing result are consistent with the contract identifier, the contract method and the regional parameter in the transaction proposal, referring to fig. 3, may further specifically include the following contents:
step S103B1: and determining the endorsement policy according to the transaction processing result.
Step S103B2: and verifying whether the area code, the merchant name, the total number of merchants involved in regional points and the specific implementation logic in the endorsement strategy are consistent with the contract identification, the contract method and the content corresponding to the regional parameters of the transaction proposal.
Illustratively, the contract identification includes querying the obtained area code, de-duplication of the merchant name, and return of the total number of points to the area, which are used to determine the specific function and operation of the contract, such as obtaining the area code by querying, de-duplication of the merchant name, and return of the total number of points to the area, etc.
The contract method refers to the specific implementation logic required by the transaction proposal. In contracts, different methods implement different functions and operations for processing the points transactions. Based on different types of points transactions, such as point consumption and point redemption, the contract method executes corresponding logic to perform corresponding business operations.
The region parameters include a region number and a point consumption type of a specified region. The region number is used to designate a specific region to which the operation relates in order to perform related data processing. The credit consumption type is used to specify a specific type of credit transaction so that the contract method can perform corresponding processing and calculation according to different types.
Firstly, the client can determine a corresponding endorsement policy according to a transaction processing result, wherein the endorsement policy comprises information such as a district number, a merchant name, total number of merchants related to district points, specific implementation logic and the like.
And then, verifying whether the land area number, the merchant name, the total number of the merchants related to the regional points in the endorsement strategy and the specific implementation logic are consistent with the content corresponding to the contract identification, the contract method and the regional parameters in the transaction proposal or not, thereby ensuring the reliability and the correctness of the transaction processing result.
Step S104: and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
Wherein, in the case that the client verifies that the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate are successful, the client performs the following steps:
first, the client packages the validated transaction processing results and signs the packaged results to ensure the integrity and non-tamper resistance of the transaction results, and can verify that the results were generated by the client.
And then, the client sends the transaction processing result after the package signature to a sequencing node in the blockchain network. The ordering nodes are the nodes responsible for processing and ordering transactions that will ensure that transactions enter the blockchain in a certain order. Illustratively, after receiving the transaction processing result sent by the client, the ordering node may perform consensus ordering on the transaction processing result to ensure that all nodes reach consensus on the blockchain.
Finally, the ordering node generates a block containing transactions according to the result of the consensus ordering and sends the block to a commit node in the blockchain network.
After receiving the blocks sent by the ordering node, the submitting node will check each transaction in the blocks. The verification process includes checking the validity of the transaction,
In particular, the commit node will check whether the input and output that each transaction depends on matches the state of the current blockchain. After the verification of the transaction is completed, the submitting node appends the verified block to the local blockchain to form an updated blockchain. Finally, the commit node updates the world state, i.e., updates the latest values of all keys. Such that various status data (e.g., account balance, contract status, etc.) involved in the transaction will be updated based on the new transaction results.
The method of the application allows the participant client to create a separate ledger in the channel, which only participants in the same channel can own. The participants not in the channel cannot see the content of the account book, so that higher security and privacy are realized.
In addition, the channel isolation ensures that transaction data and ledger information within the channel are only visible and accessible to participants within the channel, so that sensitive transaction and business information is only propagated within the channel and is not revealed to unauthorized participants, preventing unauthorized access and potential security breaches. And because the participants in different areas are distributed in different channels, only the information of the point merchants in the local areas needs to be returned, and the independence and the safety of the business in each area are maintained.
In an exemplary application scenario of the present application, under the scenario of developing the point offer in branches, multiple transaction channels are involved, including the present line card point deduction consumption, the POS end point deduction consumption, and the like. Daily generated credit transaction data is imported into the credit statement. However, since existing stock order credit service data has accumulated to tens of millions, the conventional method of acquiring the merchant number and the merchant name from the credit statement becomes impossible.
The existing merchant operation platform needs to acquire the merchant numbers and the merchant names according to regions, but acquiring only 10-200 merchant numbers and merchant names from a tens of millions of level point detail tables is an inefficient operation. In order to solve the problem, the scheme proposes to compress the integral detail data by adopting a distributed batch technology so as to meet the requirement of acquiring the merchant number and the merchant name according to the specified condition.
In an embodiment of the blockchain-based transaction data processing method of the present application, referring to fig. 4, the following may be further specifically included:
step S105: and responding to the end of the preset period, generating an integral statistical file according to a preset file rule by data in an integral detail table, wherein the statistical file comprises a plurality of integral statistical categories.
Step S106: and merging and compressing the score statistical file according to the score statistical category to obtain the transaction database.
For example, the data in the integration schedule may be read at the end of a preset period (e.g., the end of day of the day). And checking the successful data, and generating an integral statistical file according to the specified file rule. The credit statistics file may contain the following fields: statistics frequency, statistics date, area code, network point number, jurisdictional network point number, merchant number, external merchant name, external agreement number, consumption return identity, point clearing mode, record status, point exchange quantity, point exchange amount and point clearing amount.
Since the integral detail table is stored in 8 SETs of the SAESCC cluster in the existing production environment, it is required to read the integral detail table of each SET and generate a corresponding integral statistics file. And combining the credit exchange quantity, the credit exchange amount and the credit merchant clearing amount fields on the basis of taking statistics frequency, region number, network point number, jurisdictional network point number, merchant number, external protocol number, consumption return identification, the credit clearing mode and the record state as conditions by using the SHELL script in the distributed batch technology.
After the SHELL script is executed to merge the integration statistics files, the generated merged file is placed under the path "/app root1/saes/data/work 3/system date". The path is a specific directory in which the system date is named according to the actual date.
Next, a distributed batch send job is run, and the merged file is sent under the path "/app 1/saes/data/P2 PSEND/SAESMAMP". This path is a directory for storing the transmitted file.
The file is sent to the MAMP file server via GTP (General Transfer Protocol, universal transport protocol) send task. The integration statistics file detail data sent to the MAMP file server is stored on a distributed database on a real-time daily basis. The daily data is stored in time and is managed and processed with other related data.
Preferably, in response to the end of the preset period, the transaction data in the transaction database obtained in the previous preset period may be migrated to the history database.
The method of the application adopts a distributed batch technology to divide the data into smaller batches, and each batch only contains the data meeting specific conditions. And the batch data is distributed to different nodes for parallel processing through distributed processing, so that the efficiency of inquiring and processing the data is improved, and the load pressure of a single node is reduced. In the scenario shown in the present application, tens of millions of levels of integration details can be compressed and partitioned according to specified conditions using a distributed batch technique, and then the batches are processed in parallel in a distributed environment. By the method, the merchant numbers and the merchant names meeting the specific regional conditions can be effectively extracted, and the data query and processing efficiency is improved.
In an alternative embodiment, the above steps may be implemented by Hyperledger Fabric (enterprise-level distributed ledger).
The solution adopts Hyperledger Fabric as the underlying network environment and utilizes the modular distributed ledger solution provided by the same. The Hyperledger Fabric framework has the characteristics of confidentiality, scalability, flexibility, expandability and the like, and is suitable for solving the technical problem that the merchant operation platform returns the merchant number and the merchant name slowly in an exemplary scene of the scheme.
Hyperledger Fabric is logically broken down into different roles, such as endorsement node, ordering node, and commit node, each role assuming a different function. Specifically, the overall architecture of Hyperledger Fabric is divided into a network layer, a core layer and an interface layer. The core layer includes member services, blockchain services, and smart contract services. The interface layer calls information such as identity, account book, transaction, intelligent contract and the like through interfaces and events. The network layer is responsible for realizing a P2P network and ensuring consistency of the distributed storage of the blockchain.
FIG. 5 shows an overall architecture diagram for implementing point consumption detail verification based on Hyperledger Fabric and returning to merchants, provided by the application.
In the application, a Hyperledger Fabric platform is used as an underlying network environment, and the call to the intelligent contract is realized through the related API provided by Fabric-SDK-Go. Meanwhile, a Web application program realized by an LAMJ framework (Linux+Apache+MySQL+Java) is adopted as a service layer. The front end uses vue.js as an interface framework.
In addition, in order to improve the expandability and maintainability of the application program, the project is hierarchically designed by adopting an architecture mode based on MVC (Model-View-Controller). The interface layer realizes the visual interface and interaction of the user through the Web browser. The control layer receives the request of the user, accesses the business layer, and further invokes the user intelligent contract to realize the functions of inquiring and acquiring the area code, returning the merchant number, the merchant name, returning the total number of the merchant related to regional points, and the like.
Fig. 6 shows a network structure diagram of Hyperledger Fabric when running.
For the integral statistics file of the SAESCC cluster received in a preset period (for example, on the same day), the scheme imports data into a state database of the SAESMAMP cluster, and transfers historical stock integral statistics data into a historical database.
Since data needs to be saved into the ledger, it is necessary to design a related structure declaration data structure in order to process the data in the user.
By adopting the scheme, the characteristics and the framework provided by Hyperledger Fabric can be utilized to realize the call of the chain code (intelligent contract), and the user interface and interaction can be realized through the Web application program. Meanwhile, through hierarchical design and MVC architecture mode, the expandability and maintainability of the application program are improved. The control layer is responsible for receiving a user request and calling a chain code to realize an intelligent contract function, so that the requirements of inquiring a district number, a merchant name, the total number of the regional point merchants and the like are met.
By adopting the channel isolation technology of Hyperledger Fabric, the scheme realizes the isolation and protection of merchant data in different channels. The participant can only access the account book belonging to the own channel, thereby ensuring the privacy and confidentiality of merchant data and preventing unauthorized access and tampering. Meanwhile, by dividing different channels according to regions, the isolation of the business in different regions is realized, the data in each region are ensured not to interfere with each other, and the safety and stability of the whole system are improved.
In an alternative embodiment, the member service may be implemented by the MSP (Membership Service Providers member service module) in Hyperledger Fabric.
The MSP is responsible for identity management and verifying the modular components of the network members, ensuring the legitimacy of the identity and behavior of the participants in the network. The following are specific roles of MSP in the present application:
first, the MSP is responsible for managing the user IDs that allow access to point queries and redemption related functions. Including maintaining user identity information, rights, access control lists, etc., to ensure that only authorized users can perform the relevant operations. Through the MSP, it is possible to manage and control which clients can use the functionality of the device and authenticate it.
Second, the MSP functions as a validation when a new node wishes to join the network. The nodes are required to provide valid and legitimate MSP information to confirm the identity and compliance of the nodes. Only through MSP verification, the network can be joined and participate in related transaction and consensus process, so as to prevent unauthorized nodes from joining the network and ensure the security and credibility of the network.
Finally, when the transaction is carried out in the network, data transmission is needed among all nodes. The MSP is used for verifying the identity and signature of each node and ensuring the legitimacy and the integrity of the transaction. Providing credentials to the customer initiating the transaction, verifying their identity and rights, and ensuring the security of the transaction. Through MSP verification, unauthorized nodes can be prevented from forging transaction or falsifying data, and the safety and reliability of the network are protected.
Further, the present application provides an embodiment of a blockchain-based transaction data processing method applied to an endorsement node of a blockchain network, referring to fig. 7, the blockchain-based transaction data processing method specifically includes the following contents:
step S201: and receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area.
In an embodiment of the blockchain-based transaction data processing method of the present application, the transaction proposal includes a contract identifier, a contract method and a regional parameter required by the transaction; the receiving client sends the transaction proposal and the client signature, and processes the transaction proposal through the transaction database to obtain a corresponding transaction processing result, see fig. 8, and may further specifically include the following:
step S201A: and under the condition that the client side is determined to have the identity certificate, generating a corresponding endorsement policy according to a contract identifier, a contract method and a regional parameter required by the transaction in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
Step S201B: and processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result.
Wherein, first, the endorsement node will verify the identity certificate of the client after receiving the transaction proposal and the signature to ensure the validity. After the validity is confirmed, the endorsement node generates a corresponding endorsement policy according to the contract identification, the contract method and the regional parameters in the transaction proposal. The endorsement policy determines the specific way the endorsement node processes the transaction, and may include verifying data, executing business logic, etc.
And the endorsement node can process the transaction database according to the generated endorsement policy, namely simulate and execute the intelligent contract, generate a corresponding execution result after simulating and executing the intelligent contract, and sign the result by using respective CA certificates so as to ensure the integrity and the credibility of the result.
Preferably, the contract identification comprises inquiring the acquired area code, returning the name of the merchant, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
Processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result, including:
extracting regional transaction data corresponding to the region number in the contract identification from the transaction database;
and determining the merchant names meeting the requirements and the total number of the merchants related to the regional points in the regional transaction data as transaction processing results based on specific implementation logic in the contract method.
In an application scenario shown in the present application, the process that the endorsement node will execute the smart contract may be divided into the following three flows:
a first process: the endorsement node firstly inquires account information of a client login teller, acquires branch information of the teller, and extracts a region number of the teller according to the branch information as an inquiry condition. The follow-up process can provide query conditions for querying the merchant number and the detail of the merchant name from the distributed database.
The second procedure: and the endorsement node inquires integral statistical table data in the distributed database according to the region number acquired by the first flow as a condition. The query condition includes statistics of the type unchecked dimension statistics and region numbers. Specifically, the query result may be deduplicated by using the method of distict, a non-duplicate merchant number and merchant name list is returned, and the merchant numbers and merchant names returned by the daily queries in different regions are returned to the client to record the information in the blockchain network of the corresponding region in the subsequent process.
And a third flow path: and the endorsement node returns the de-duplicated merchant number and merchant name list to the client. Specifically, the client may further determine how many pages should be finally divided for presentation at the client according to the paging situation of the service selection (e.g., by 5 pages/page, 20 pages/page, or 50 pages/page).
For example, if the 200 th territory inquires that the data of different point merchant numbers and merchant names is 35 in total and the pagination is selected as 20 pieces/page, the client divides the point information into two pages. The first page displays 20 pieces of merchant number and merchant name information, and the second page displays 15 pieces of merchant number and merchant name information.
Through the steps, the endorsement node can inquire and acquire the detailed information of the merchant number and the merchant name according to the area code, and return the detailed information as a transaction processing result to the client, so that the inquiry and the display of the merchant information are realized. The merchant operation platform can select corresponding merchants according to the regional numbers and display merchant information in a paginated mode, so that a more flexible and efficient query function is provided.
Step S202: and sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
The method of the application allows the participant client to create a separate ledger in the channel, which only participants in the same channel can own. The participants not in the channel cannot see the content of the account book, so that higher security and privacy are realized.
In addition, the channel isolation ensures that transaction data and ledger information within the channel are only visible and accessible to participants within the channel, so that sensitive transaction and business information is only propagated within the channel and is not revealed to unauthorized participants, preventing unauthorized access and potential security breaches. And because the participants in different areas are distributed in different channels, only the information of the point merchants in the local areas needs to be returned, and the independence and the safety of the business in each area are maintained.
Further, the present application provides an embodiment of a blockchain-based transaction data processing method applied to a sorting node of a blockchain network, referring to fig. 9, the blockchain-based transaction data processing method specifically includes the following contents:
step S301: a leader node is periodically determined from the plurality of follower nodes.
In the application, the blockchain network adopts a consensus algorithm to ensure the consistency and reliability of the transaction, the consensus algorithm is a method for realizing data consistency in a distributed system, the order of writing the transaction into an account book by different participants is ensured to be consistent, and the consensus problem in the distributed computing and multi-agent system is solved.
The application adopts the leader node selected regularly to add the transaction to the sending node according to the arrival sequence of the transaction so as to ensure that the sequence of the transaction is consistent.
In an embodiment of the blockchain-based transaction data processing method of the present application, an election timeout timer is set in each following node, and the determining a leader node from a plurality of following nodes periodically, see fig. 10, may further specifically include the following:
step S301A: responsive to expiration of the election timeout timer, determining the expired following node as a candidate node and sending request voting information to other following nodes;
step S301B: and determining the candidate node with the highest received vote as the leader node in the current candidate nodes, and sending heartbeat information to other nodes so that the other candidate nodes restore to the following node after receiving the heartbeat information.
Wherein each following node maintains an election timeout timer with a value randomly selected between 150-300 milliseconds. Such that each node has an independent election timeout.
A specific election scheme is shown in fig. 11, where the election process is initiated when the following node detects that there is no leader in the current tenure. The following nodes start to start respective election timeout timers, start to count down, become candidate nodes when the election timeout timers of the nodes count down, and broadcast information of the request vote to other following nodes.
And after receiving the voting information requested by the candidate, the other following nodes can make a voting decision according to a certain rule. The following node may be assigned to a particular node as a candidate, or may be assigned to other candidates.
Candidate nodes need to obtain votes for most nodes to become the leader. If a candidate node receives votes from most nodes (e.g., three-quarters nodes), it becomes the leader node and broadcasts its own election results to other nodes.
After receiving the election result of the leader, the other nodes acknowledge that the node is the leader and update the state of the node and the state of the blockchain ledger. If the candidate node does not acquire enough votes in the election process, but receives heartbeat information of other leaders, the candidate node abandons the election and returns to the state of the follower node.
And once no node has successfully won the election, all nodes will wait long enough to determine if any nodes can win enough votes to be the leader. The waiting time is typically determined based on factors such as network delay and the number of nodes.
During the waiting time, the number of votes received by the candidate may be counted, and if no candidate wins enough votes for a long enough time, the current period of ownership will be terminated directly because there is no leader. Characterizing the failure of the current election process requires starting a new tenure to continue the election process.
Once the current tenure expires, each node resets the election timeout timer and again becomes a candidate node broadcasting information requesting a vote to compete for a new leader node.
In an embodiment of the blockchain-based transaction data processing method of the present application, the determining, as the leader node, the candidate node having the highest received vote among the candidate nodes, see fig. 12, may further specifically include:
301B1: according to the transaction processing activity degree of the current day, obtaining the region in front of the transaction processing activity degree of the current day;
301B2: and determining the candidate node with the most votes among the candidate nodes in the region of the first three liveness as the leader node.
For example, the leader candidate node where the three regions with the highest liveness are located may be selected from the leader candidate nodes. The method for screening out the three regions with the highest activity degree can comprehensively consider and select according to the frequency of using the system in a region of the service of the current day, the number of the commercial tenant after the duplication removal of the selected region and the number of the commercial tenant name. So that the number of filtered leader candidate nodes is significantly reduced.
Step S302: and sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through the current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas.
Step S303: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
Illustratively, the leader node may first write the client's request and the current tenure number into its own log array. The log array is used to record all operations and events to ensure consistency between nodes.
Thereafter, the leader node will call AppendEntries RPC of the follower node (remote procedure call to append the log entry) in parallel, forwarding its own log entry to the follower node. The call parameters of the RPC may include any period number of the leader node, index and any period number of the previous log entry, log entry list, and the like.
The leader node then waits for the response of the follower node to AppendEntries RPC. If the follower node correctly receives the log entry and performs a copy operation, an acknowledge response is returned.
If the leader node does not receive the acknowledgement response from all follower nodes, the AppendEntries RPC of the follower nodes will be invoked continuously until all follower nodes have correctly received the log entry to ensure log consistency among all nodes, i.e., each node has the same log content.
Once the leader node confirms that all follower nodes have properly received the log entry, execution of the client request may begin. For example, the request is sent in turn to a commit node of the blockchain network to ensure that the request is broadcast throughout the blockchain network and the results of the operation are returned to the client.
In summary, the present application ensures that only users with rights can check the point consumption details and return to the merchant selection service by placing devices in different regions in different channels and controlling access rights by using related private keys. The security mechanism of the channel isolation improves the security of user data and prevents unauthorized access and tampering.
In addition, the application realizes related business functions by writing user intelligent contracts. The intelligent contract comprises the functions of inquiring the acquired area code, returning the merchant number and the merchant name, and the like. The functions enable a user to conveniently conduct merchant selection and check return operation, and convenience and efficiency of operation are improved.
Further, the application adopts an improved consensus mechanism to ensure that the data is correctly recorded in the blockchain according to the sequence of the transaction time. By selecting the concepts of timeout parameters, votes and tenns, only one leader node is selected as the leader of the current tenns, so that the sequence and consistency of data are ensured, the conflict and confusion caused by simultaneous writing of a plurality of nodes are avoided, and the reliability and consistency of the system are improved.
Finally, the application improves the performance of the device and the operation efficiency of the system through a reasonable design consensus mechanism and intelligent contracts on the premise of ensuring the safety and consistency of the data. By writing related business functions into the intelligent contracts and utilizing the distributed characteristics of the blockchain, efficient data processing and query functions are realized. At the same time, a Hyperledger Fabric framework is used that has high performance and scalability, enabling large-scale merchant selection and verification return operations.
In order to take a local area code as a dimension, so that only a transaction processing result of a local area needs to be returned when a client is used for transaction in different areas, and different channels are positioned when the client is used for transaction in different areas, and the security of a transaction process is improved through channel isolation, the application provides an embodiment of a blockchain-based transaction data processing device for realizing all or part of the content of the blockchain-based transaction data processing method, and referring to fig. 13, the blockchain-based transaction data processing device specifically comprises the following contents:
a certificate acquisition module 1101 for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module 1102, configured to: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate;
a processing result checking module 1103 for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
A processing result transmitting module 1104, configured to: and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the processing result checking module is specifically configured to, when receiving a transaction processing result and an endorsement credential returned by the endorsement node and verifying consistency of the transaction processing result and a transaction proposal:
verifying whether an endorsement policy of the transaction processing result is consistent with contract identification, contract method and regional parameters in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
The contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
the processing result checking module is specifically configured to, when verifying whether an endorsement policy and a regional parameter of the transaction processing result are consistent with a contract identifier, a contract method and a regional parameter in the transaction proposal, perform:
determining the endorsement policy according to the transaction processing result;
and verifying whether the area code, the merchant name, the total number of merchants involved in regional points and the specific implementation logic in the endorsement strategy are consistent with the contract identification, the contract method and the content corresponding to the regional parameters of the transaction proposal.
According to any embodiment of the application, the method further comprises a data compression module for:
responding to the end of a preset period, generating an integral statistical file according to a preset file rule by data in an integral detail table, wherein the statistical file comprises a plurality of integral statistical categories;
and merging and compressing the score statistical file according to the score statistical category to obtain the transaction database.
According to any embodiment of the present application, the method further comprises a data update module for:
And in response to the end of the preset period, migrating the transaction data in the transaction database obtained in the previous preset period to the historical database.
In order to take the area code as a dimension, only the transaction processing result of the local area needs to be returned when the client is used for transaction in different areas, and the business in different areas is located in different channels when the client is used for transaction, and the security of the transaction process is improved through channel isolation, the application provides an embodiment of a blockchain-based transaction data processing device for realizing all or part of the content of the blockchain-based transaction data processing method, referring to fig. 14, wherein the blockchain-based transaction data processing device specifically comprises the following contents:
a transaction proposal processing module 2201 for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
a transaction proposal return module 2202 for: and sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
According to any embodiment of the application, the transaction proposal comprises contract identification, contract method and regional parameters required by the transaction;
the transaction proposal processing module is used for receiving a transaction proposal and a client signature sent by a client and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, and is specifically used for:
under the condition that the client side is determined to have the identity certificate, generating a corresponding endorsement policy according to a contract identifier, a contract method and region parameters required by the transaction in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal;
and processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result.
According to any embodiment of the application, the contract identification comprises inquiring the obtained area code, returning the merchant name, and returning the total number of the merchant related to the area point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
The transaction proposal processing module processes the transaction database according to the endorsement policy, and is specifically used for when a corresponding transaction processing result is obtained:
extracting regional transaction data corresponding to the region number in the contract identification from the transaction database;
and determining the merchant names meeting the requirements and the total number of the merchants related to the regional points in the regional transaction data as transaction processing results based on specific implementation logic in the contract method.
In order to take a local area code as a dimension, so that only a transaction processing result of a local area needs to be returned when different areas use clients to conduct transactions, and different areas use different channels when the clients to conduct transactions, and the security of the transaction process is improved through channel isolation, the application provides an embodiment of a blockchain-based transaction data processing device for realizing all or part of the content of the blockchain-based transaction data processing method, referring to fig. 15, wherein the blockchain-based transaction data processing device specifically comprises the following contents:
leader node selection module 3301: periodically determining a leader node from the plurality of follower nodes;
A rank receiving module 3302 for: sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through a current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas;
an ordering uplink module 3303 for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
According to any embodiment of the present application, an election timeout timer is provided in each following node, and the leader node selection module is specifically configured to, when periodically determining a leader node from a plurality of following nodes:
responsive to expiration of the election timeout timer, determining the expired following node as a candidate node and sending request voting information to other following nodes;
And determining the candidate node with the highest received vote as the leader node in the current candidate nodes, and sending heartbeat information to other nodes so that the other candidate nodes restore to the following node after receiving the heartbeat information.
According to any embodiment of the present application, the leader node selection module is specifically configured to, when determining, as the leader node, a candidate node having the highest received vote among the candidate nodes currently:
according to the transaction processing activity degree of the current day, obtaining the region in front of the transaction processing activity degree of the current day;
and determining the candidate node with the most votes among the candidate nodes in the region of the first three liveness as the leader node.
As can be seen from the above description, the transaction data processing device based on blockchain provided by the embodiment of the application can use the region number as a dimension, so that only the transaction processing result of the local region needs to be returned when the client is used for transaction in different regions, and the transaction processing result is located in different channels when the client is used for transaction in different regions, and the security of the transaction process is improved through channel isolation.
In order to take the area code as the dimension, only the transaction processing result of the local area needs to be returned when the client is used for transaction in different areas, and the business in different areas is located in different channels when the client is used for transaction, and the security of the transaction process is improved through channel isolation, the application provides an embodiment of a block chain-based transaction data processing system for realizing all or part of the content of the block chain-based transaction data processing method, which is shown in fig. 16, and comprises the client, an endorsement node and a sequencing node which are arranged in a block chain network;
The client comprises:
a certificate acquisition module 1101 for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module 1102, configured to: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, the client signature comprising the identity certificate;
a processing result checking module 1103 for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
a processing result transmitting module 1104, configured to: under the condition that verification is successful, the transaction processing result is packaged and signed and sent to a sequencing node of a blockchain network;
the endorsement node includes:
a transaction proposal processing module 2201 for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
A transaction proposal return module 2202 for: transmitting the transaction processing result and an endorsement credential to the client;
the ordering node comprises:
leader node selection module 3301: periodically determining a leader node from the plurality of follower nodes;
a rank receiving module 3302 for: sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through a current leader node;
an ordering uplink module 3303 for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
In order to take a region number as a dimension in terms of hardware, so that when different regions use clients to conduct transactions, only transaction processing results of the local region need to be returned, and when different regions use the clients to conduct transactions, the different region services are located in different channels, and security of transaction processes is improved through channel isolation, the application provides an embodiment of an electronic device for realizing all or part of contents in the block chain-based transaction data processing method, wherein the electronic device specifically comprises the following contents:
A processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the transaction data processing device based on the blockchain and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may refer to an embodiment of the blockchain-based transaction data processing method and an embodiment of the blockchain-based transaction data processing device, and the contents thereof are incorporated herein and are not repeated here.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the blockchain-based transaction data processing method may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 17 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 17, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 17 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the blockchain-based transaction data processing method functions may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
Step S101: and registering through member service to determine an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area.
Step S102: and sending a transaction proposal and a client signature to an endorsement node of the blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate.
Step S103: and receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate.
Step S104: and under the condition that the verification is successful, the transaction processing result is packaged and signed, and is sent to a sequencing node of the blockchain network.
Step S201: and receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result.
Step S202: and sending the transaction processing result and an endorsement certificate to the client.
Step S301: a leader node is periodically determined from the plurality of follower nodes.
Step S302: and sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through the current leader node.
Step S303: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
As can be seen from the above description, the electronic device provided in the embodiment of the present application uses the area code as a dimension, so that only the transaction processing results of the local area need to be returned when the client is used for the transaction in different areas, and the business in different areas is located in different channels when the client is used for the transaction, and the security of the transaction process is improved through channel isolation.
In another embodiment, the blockchain-based transaction data processing device may be configured separately from the central processor 9100, for example, the blockchain-based transaction data processing device may be configured as a chip connected to the central processor 9100, and the blockchain-based transaction data processing method functions are implemented by control of the central processor.
As shown in fig. 17, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 17; in addition, the electronic device 9600 may further include components not shown in fig. 17, and reference may be made to the related art.
As shown in fig. 17, the central processor 9100, sometimes also referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or data used by any other electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps in the blockchain-based transaction data processing method in which the execution subject is a server or a client in the above embodiments, the computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements all steps in the blockchain-based transaction data processing method in which the execution subject is a server or a client in the above embodiments, for example, the processor implements the following steps when executing the computer program:
step S101: and registering through member service to determine an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area.
Step S102: and sending a transaction proposal and a client signature to an endorsement node of the blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate.
Step S103: and receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate.
Step S104: and under the condition that the verification is successful, the transaction processing result is packaged and signed, and is sent to a sequencing node of the blockchain network.
Step S201: and receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result.
Step S202: and sending the transaction processing result and an endorsement certificate to the client.
Step S301: a leader node is periodically determined from the plurality of follower nodes.
Step S302: and sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through the current leader node.
Step S303: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
As can be seen from the above description, the computer readable storage medium provided in the embodiments of the present application uses the area code as a dimension, so that only the transaction processing result of the local area needs to be returned when the client is used for the transaction in different areas, and the transaction in different areas is located in different channels when the client is used for the transaction, and the security of the transaction process is improved through channel isolation.
Embodiments of the present application also provide a computer program product capable of implementing all the steps in the blockchain-based transaction data processing method in which the execution subject in the above embodiments is a server or a client, where the computer program/instructions implement the steps of the blockchain-based transaction data processing method when executed by a processor, for example, the computer program/instructions implement the steps of:
step S101: and registering through member service to determine an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area.
Step S102: and sending a transaction proposal and a client signature to an endorsement node of the blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate.
Step S103: and receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate.
Step S104: and under the condition that the verification is successful, the transaction processing result is packaged and signed, and is sent to a sequencing node of the blockchain network.
Step S201: and receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result.
Step S202: and sending the transaction processing result and an endorsement certificate to the client.
Step S301: a leader node is periodically determined from the plurality of follower nodes.
Step S302: and sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through the current leader node.
Step S303: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
As can be seen from the above description, the computer program product provided by the embodiment of the present application uses the area code as a dimension, so that only the transaction processing result of the local area needs to be returned when the client is used for the transaction in different areas, and the transaction in different areas is located in different channels when the client is used for the transaction, and the security of the transaction process is improved through channel isolation.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (18)

1. A blockchain-based transaction data processing method, applied to a client, the method comprising:
registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
Transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate;
receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
2. The method of claim 1, wherein the transaction proposal includes contract identification, contract methods, and regional parameters required for the transaction;
the receiving the transaction processing result and the endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and the transaction proposal, comprising:
Receiving a transaction processing result and an endorsement certificate returned by the endorsement node;
verifying whether an endorsement policy of the transaction processing result is consistent with contract identification, contract method and regional parameters in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal.
3. The method of claim 2, wherein the contract identification includes querying an acquisition location number, de-duplication returning a merchant name, and returning a total number of merchants involved in the geographic points;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
the verifying whether the endorsement policy and the regional parameter of the transaction processing result are consistent with the contract identification, the contract method and the regional parameter in the transaction proposal comprises the following steps:
determining the endorsement policy according to the transaction processing result;
and verifying whether the area code, the merchant name, the total number of merchants involved in regional points and the specific implementation logic in the endorsement strategy are consistent with the contract identification, the contract method and the content corresponding to the regional parameters of the transaction proposal.
4. A method according to claim 3, characterized in that the method further comprises:
responding to the end of a preset period, generating an integral statistical file according to a preset file rule by data in an integral detail table, wherein the statistical file comprises a plurality of integral statistical categories;
and merging and compressing the score statistical file according to the score statistical category to obtain the transaction database.
5. The method according to claim 4, wherein the method further comprises:
and in response to the end of the preset period, migrating the transaction data in the transaction database obtained in the previous preset period to the historical database.
6. A blockchain-based transaction data processing method, applied to endorsement nodes of a blockchain network, the method comprising:
receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
and sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
7. The method of claim 6, wherein the transaction proposal includes a contract identification, a contract method, and a regional parameter required for the transaction;
the method for receiving the transaction proposal and the client signature sent by the client and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result comprises the following steps:
under the condition that the client side is determined to have the identity certificate, generating a corresponding endorsement policy according to a contract identifier, a contract method and region parameters required by the transaction in the transaction proposal, wherein the endorsement policy characterizes a processing policy generated by the endorsement node according to the transaction proposal;
and processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result.
8. The method of claim 7, wherein the contract identification includes querying an acquisition location number, de-duplication returning a merchant name, and returning a total number of merchants involved in the geographic point;
the contract method includes the specific implementation logic required by the transaction proposal;
the regional parameters comprise a region number of the designated region and an integral consumption type;
Processing the transaction database according to the endorsement policy to obtain a corresponding transaction processing result, including:
extracting regional transaction data corresponding to the region number in the contract identification from the transaction database;
and determining the merchant names meeting the requirements and the total number of the merchants related to the regional points in the regional transaction data as transaction processing results based on specific implementation logic in the contract method.
9. A blockchain-based transaction data processing method applied to ordering nodes of a blockchain network, the method comprising:
periodically determining a leader node from the plurality of follower nodes;
sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through a current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas;
For each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
10. The method of claim 9, wherein an election timeout timer is provided in each of the follower nodes, and wherein periodically determining a leader node from the plurality of follower nodes comprises:
responsive to expiration of the election timeout timer, determining the expired following node as a candidate node and sending request voting information to other following nodes;
and determining the candidate node with the highest received vote as the leader node in the current candidate nodes, and sending heartbeat information to other nodes so that the other candidate nodes restore to the following node after receiving the heartbeat information.
11. The method of claim 10, wherein the determining the candidate node that received the most vote among the current candidate nodes as the leader node comprises:
according to the transaction processing activity degree of the current day, obtaining the region in front of the transaction processing activity degree of the current day;
And determining the candidate node with the most votes among the candidate nodes in the region of the first three liveness as the leader node.
12. A blockchain-based transaction data processing device, the device comprising:
a certificate acquisition module for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module for: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, so that the endorsement node processes a transaction database through the transaction proposal to obtain a corresponding transaction processing result, and the client signature comprises the identity certificate;
the processing result checking module is used for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
a processing result sending module, configured to: and under the condition that verification is successful, packaging and signing the transaction processing result, and sending the package signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sending a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
13. A blockchain-based transaction data processing device, the device comprising:
a transaction proposal processing module for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
a transaction proposal return module for: and sending the transaction processing result and the endorsement certificate to the client so that the client verifies the consistency of the transaction processing result and the transaction proposal and the validity of the endorsement certificate, packages the transaction processing result into a signature under the condition that the verification is successful, and sends the signature to a sequencing node of a blockchain network so that the sequencing node performs consensus sequencing on the transaction processing result, and sends a block generated by the consensus sequencing result to a submitting node of the blockchain network so that the submitting node can append the block to a blockchain of the appointed area.
14. A blockchain-based transaction data processing device, the device comprising:
The leader node selection module: periodically determining a leader node from the plurality of follower nodes;
a sequencing receiving module, configured to: sequentially receiving transaction processing results and endorsement certificates returned by a plurality of current clients after receiving endorsement nodes through a current leader node, and verifying the consistency of the transaction processing results and the transaction proposal and the validity of the endorsement certificates, and then sending the transaction processing results and client signatures, wherein the transaction processing results are generated by the endorsement nodes of the blockchain according to the transaction proposal and the client signatures sent by the clients, and the client signatures comprise identity certificates which characterize that the clients have identity certificates for carrying out data processing services in appointed areas;
a sequencing-uplink module for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
15. A transaction data processing system based on a blockchain is characterized by comprising a client, an endorsement node and a sorting node which are arranged in a blockchain network;
The client comprises:
a certificate acquisition module for: registering and registering through member service, determining an identity certificate, wherein the identity certificate characterizes the client to have an identity certificate for carrying out data processing service in a designated area;
a transaction proposal sending module for: transmitting a transaction proposal and a client signature to an endorsement node of a blockchain network, the client signature comprising the identity certificate;
the processing result checking module is used for: receiving a transaction processing result and an endorsement certificate returned by the endorsement node, and verifying the consistency of the transaction processing result and a transaction proposal and the validity of the endorsement certificate;
a processing result sending module, configured to: under the condition that verification is successful, the transaction processing result is packaged and signed and sent to a sequencing node of a blockchain network;
the endorsement node includes:
a transaction proposal processing module for: receiving a transaction proposal and a client signature sent by a client, and processing the transaction proposal through a transaction database to obtain a corresponding transaction processing result, wherein the client signature comprises an identity certificate, and the identity certificate characterizes the client as having an identity certificate for carrying out data processing business in a designated area;
A transaction proposal return module for: transmitting the transaction processing result and an endorsement credential to the client;
the ordering node comprises:
the leader node selection module: periodically determining a leader node from the plurality of follower nodes;
a sequencing receiving module, configured to: sequentially receiving transaction processing results and client signatures sent by a plurality of current clients through a current leader node;
a sequencing-uplink module for: for each leader node, generating a block according to the transaction processing result, and sequentially sending the block to a submitting node of a blockchain network, so that the submitting node adds the block to a blockchain of the appointed area.
16. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor performs the steps of the blockchain-based transaction data processing method of any of claims 1 to 11 when the program is executed.
17. A computer readable storage medium having stored thereon a computer program, which when executed by a processor, implements the steps of the blockchain-based transaction data processing method of any of claims 1 to 11.
18. A computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the blockchain-based transaction data processing method of any of claims 1 to 11.
CN202310658678.8A 2023-06-05 2023-06-05 Transaction data processing method and device based on blockchain Pending CN116707821A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310658678.8A CN116707821A (en) 2023-06-05 2023-06-05 Transaction data processing method and device based on blockchain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310658678.8A CN116707821A (en) 2023-06-05 2023-06-05 Transaction data processing method and device based on blockchain

Publications (1)

Publication Number Publication Date
CN116707821A true CN116707821A (en) 2023-09-05

Family

ID=87844496

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310658678.8A Pending CN116707821A (en) 2023-06-05 2023-06-05 Transaction data processing method and device based on blockchain

Country Status (1)

Country Link
CN (1) CN116707821A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117057921A (en) * 2023-10-10 2023-11-14 苏州元脑智能科技有限公司 Method, device and system for transaction of calculation force, electronic equipment and storage medium
CN117689384A (en) * 2023-12-14 2024-03-12 厦门中卡科技股份有限公司 Distributed database management method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117057921A (en) * 2023-10-10 2023-11-14 苏州元脑智能科技有限公司 Method, device and system for transaction of calculation force, electronic equipment and storage medium
CN117057921B (en) * 2023-10-10 2024-02-20 苏州元脑智能科技有限公司 Method, device and system for transaction of calculation force, electronic equipment and storage medium
CN117689384A (en) * 2023-12-14 2024-03-12 厦门中卡科技股份有限公司 Distributed database management method and system

Similar Documents

Publication Publication Date Title
CN107993149B (en) Account information management method, system and readable storage medium
CN116707821A (en) Transaction data processing method and device based on blockchain
TW201943235A (en) Cross-block chain authentication method and device, and electronic device
CN110944008B (en) Block chain-based task reward processing method, device, equipment and storage medium
CN110557403B (en) Resource allocation method and device based on block chain, storage medium and node equipment
CN109669955B (en) Digital asset query system and method based on block chain
US20140089156A1 (en) Addresses in financial systems
CN112163954B (en) Transaction method and device based on block chain
US20210092111A1 (en) Network traffic distribution using certificate scanning in agent-based architecture
CN111507851A (en) Block chain-based medical insurance claim settlement processing method, device and system and storage medium
CN111416709A (en) Voting method, device, equipment and storage medium based on block chain system
CN111260304A (en) Trial account management and issuing method and device
TW201837871A (en) Online voting and ballot counting system based on blockchain and method thereof
CN113037505A (en) Method and system for realizing trusted Web application
CN111666590A (en) Distributed file secure transmission method, device and system
CN115879889A (en) Service processing method and device based on block chain and computer equipment
CN114511321B (en) Point-to-point based data processing method, system, computing device and storage medium
CN115526629A (en) Receipt transaction method and device based on block chain network and identity authentication device
KR102107454B1 (en) System for multiplication of financial payment networks, method for financial services using the same and computer program for the same
CN116057920A (en) Connecting to a blockchain network
CN113094433A (en) Block chain-based consumption coupon processing method and device
CN113158259A (en) Block chain integrity verification method and device
CN111212037A (en) Advertisement data processing method and device
CN111464823B (en) Virtual gift exchange method and device, electronic equipment and storage medium
CN113300853B (en) Financial credit information management method, 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