CN113822675A - Block chain based message processing method, device, equipment and storage medium - Google Patents

Block chain based message processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN113822675A
CN113822675A CN202111150210.5A CN202111150210A CN113822675A CN 113822675 A CN113822675 A CN 113822675A CN 202111150210 A CN202111150210 A CN 202111150210A CN 113822675 A CN113822675 A CN 113822675A
Authority
CN
China
Prior art keywords
transaction
transaction data
data
verification
hash value
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
CN202111150210.5A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202111150210.5A priority Critical patent/CN113822675A/en
Publication of CN113822675A publication Critical patent/CN113822675A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification
    • G06Q20/4014Identity check for transactions
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/22Payment schemes or models
    • G06Q20/223Payment schemes or models based on the use of peer-to-peer networks
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Finance (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention relates to a block chain technology, and discloses a block chain-based message processing method, which comprises the following steps: acquiring transaction data of the cross-border transaction request from a pre-constructed blockchain network, and calculating a transaction hash value of the transaction data; examining the compliance of the transaction data, calculating a verification hash value of the transaction data meeting the compliance, and obtaining a consistency verification passing rate of the transaction data based on the transaction hash value and the verification hash value; when the consistency verification passing rate is larger than or equal to a preset threshold value, executing the cross-border transaction request and packaging the transaction data into a message data block; broadcasting the message data blocks to the block chain network, and recording the message data blocks. The invention also provides a block chain-based message processing device, electronic equipment and a storage medium. The invention can improve the safety and efficiency of the current SWIFT message processing.

Description

Block chain based message processing method, device, equipment and storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for processing a packet based on a block chain, an electronic device, and a computer-readable storage medium.
Background
The current cross-border transaction is mainly cross-border payment processing through an SWIFT (Society for world Wide Bank Financial Telecommunication Association) system, message processing is realized by means of SWIFT system transmission, the SWIFT system is a centralized transmission system, the transmission mode has serious information leakage crisis, data privacy cannot be guaranteed, and the control right of the SWIFT system is easily controlled by individual countries. In addition, the SWIFT system structure is rigid, a plurality of levels of agent banks are needed for agent, repeated account checking is not trusted among all organizations, the transaction speed is low, and a large amount of time and labor cost are increased in the whole business process. In summary, the security and efficiency of the current SWIFT message processing are low.
Disclosure of Invention
The invention provides a block chain-based message processing method and device and a computer-readable storage medium, and mainly aims to solve the problems of low safety and low efficiency of SWIFT message processing.
In order to achieve the above object, a packet processing method based on a block chain provided by the present invention includes:
acquiring transaction data of a cross-border transaction request from a pre-constructed blockchain network, and calculating a transaction hash value of the transaction data;
checking the compliance of the transaction data, and screening out the transaction data meeting the compliance checking requirement;
calculating a verification hash value of the transaction data meeting the compliance examination requirement, and performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data;
judging the size of the consistency verification passing rate and a preset threshold value;
when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified;
when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
broadcasting the message data blocks to the block chain network, and recording the message data blocks.
Optionally, before obtaining the transaction data of the cross-border transaction request in the pre-constructed blockchain network, the method further includes:
the block chain network is constructed by a primary network and a secondary network, wherein the primary network adopts a P2P mode to construct a alliance chain, and the secondary network adopts a star topology structure to construct a private chain.
Optionally, the broadcasting the packet data block to the block chain network and recording the packet data block includes:
connecting the message data block with a previous block of the message data block by using a contract node in the primary network, and broadcasting the message data block to the block chain network;
and recording the message data blocks into accounting nodes of the block chain network and synchronizing the message data blocks to nodes corresponding to the private chain.
Optionally, the calculating the transaction hash value of the transaction data includes:
converting the transaction data into transaction data in a binary coding format;
complementing the transaction data in the binary coding format to obtain transaction data in the binary coding format with a preset length;
blocking the transaction data in the binary coding format with the preset length into transaction data blocks;
and performing cyclic abstract calculation on the transaction data block to obtain a transaction hash value of the transaction data.
Optionally, after the calculating the transaction hash value of the transaction data, the method further includes:
and carrying out encryption operation on the transaction data and the transaction hash value to obtain encrypted data and a decryption private key corresponding to the encrypted data, and sending the encrypted data to a verification node set in the primary network.
Optionally, said reviewing compliance of said transaction data comprises:
acquiring the encrypted data from the verification node set, and decrypting the encrypted data by using the decryption private key to obtain transaction data;
identifying one or more transaction attributes from the transaction data;
and judging whether the compliance examination of the transaction data passes or not based on the preset compliance document matched with the transaction attribute.
Optionally, the performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data includes:
acquiring a decrypted transaction hash value from the verification node;
comparing the transaction hash value with the verification hash value, and when the transaction hash value is the same as the verification hash value, the consistency verification of the verification node is passed;
traversing each verification node in the verification node set to obtain the consistency verification passing condition of each verification node;
and summarizing the consistency verification passing condition of each verification node to obtain the consistency verification passing rate of the transaction data.
In order to solve the above problem, the present invention further provides a packet processing apparatus based on a block chain, where the apparatus includes:
the data acquisition module is used for acquiring transaction data of the cross-border transaction request from a pre-constructed blockchain network and calculating a transaction hash value of the transaction data;
the verification module is used for checking the compliance of the transaction data and screening out the transaction data meeting the compliance checking requirement;
calculating a verification hash value of the transaction data meeting the compliance audit requirement, and performing consistency verification on the cross-border transaction request based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data; judging the size of the consistency verification passing rate and a preset threshold value; when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified; when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block; (ii) a
And the storage module is used for broadcasting the message data blocks to the block chain network and recording the message data blocks.
In order to solve the above problem, the present invention also provides an electronic device, including:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the above-described blockchain based message processing method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the above packet processing method based on a block chain.
According to the embodiment of the invention, through the pre-constructed block chain network, the first-level alliance chain in the block chain network can ensure information safety; a secondary private chain in the block chain network is beneficial to the state to supervise the transaction data; and performing consistency verification on the transaction based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data, and judging whether the cross-border transaction passes the verification according to the consistency verification passing rate, so that the message processing safety is improved. Therefore, the block chain-based message processing method, the block chain-based message processing device, the electronic device and the computer-readable storage medium provided by the invention can solve the problems of low safety and low efficiency of message processing.
Drawings
Fig. 1 is a schematic flowchart of a packet processing method based on a block chain according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating a detailed implementation flow of one step in the packet processing method based on the block chain shown in fig. 1;
fig. 3 is a schematic diagram illustrating a detailed implementation flow of one step in the packet processing method based on the block chain shown in fig. 1;
fig. 4 is a functional block diagram of a packet processing apparatus based on a block chain according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device for implementing the packet processing method based on the block chain according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a block chain-based message processing method. The execution subject of the packet processing method based on the block chain includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiment of the present application. In other words, the packet processing method based on the blockchain may be performed by software or hardware installed in the terminal device or the server device, where the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flow chart of a packet processing method based on a block chain according to an embodiment of the present invention. In the embodiment of the present invention, the SWIFT (Society for world wide Interbank Financial telecommunications Society of the same industry as banking, international banking and telecommunications) is one of the most important international Financial communication network systems, the format of the SWIFT has standardization, and the format of the current transmission message mainly uses the format of the SWIFT message.
In this embodiment, the method for processing a packet based on a block chain includes:
s1, acquiring transaction data of the cross-border transaction request from the pre-constructed blockchain network, and calculating a transaction hash value of the transaction data;
in the embodiment of the invention, the block chain network is constructed by a primary network and a secondary network. Specifically, the blockchain network is jointly established by a financial institution, a local bank and an agency with independent SWIFT system authority. The financial institution with the independent SWIFT system authority is established as a primary network of the preset block chain network, and the local bank and the agency are established as a secondary network of the preset block chain network. The primary network adopts a P2P mode to construct a alliance chain, and the secondary network adopts a star topology structure to construct a private chain.
The nodes in the primary network are divided into an accounting node set, a verification node set and a contract node set, wherein the accounting node set is mainly used as an accounting book record; the verification node set is used for verifying the authenticity of the transaction data; the contract node set is an agency of a committee which is formed by the financial institutions with independent SWIFT system authority, does not participate in verification, and is responsible for maintaining the order of the system.
In the embodiment of the invention, the primary network in the block chain network can ensure information safety and can avoid the intervention of a certain country; the secondary network is beneficial to the state to supervise the transaction data and lock illegal transactions in China.
The verification node set is K × N nodes randomly selected from the primary network nodes by the contract node, wherein K is a parameter for balancing verification efficiency and credibility, and when the number of nodes in the alliance is large, K can set a small parameter to improve verification efficiency.
The secondary network is used for sending SWIFT access authority, transaction requests, receiving cross-border message information and the like. In an embodiment of the present invention, the transaction data may be transaction data of one or more transactions.
In detail, referring to fig. 2, the calculating a transaction hash value of the transaction data in S1 includes:
s11, converting the transaction data into transaction data in a binary coding format;
s12, complementing the transaction data in the binary coding format to obtain transaction data in the binary coding format with preset length;
s13, dividing the transaction data in the binary coding format with the preset length into transaction data blocks;
and S14, performing circular summary calculation on the transaction data block to obtain a transaction hash value of the transaction data.
Specifically, the embodiment of the present invention complements the transaction data in the binary code format to obtain the transaction data in the binary code format with the preset length. The preset length may be a multiple of 512 bits, and the transaction data block may be a block of transaction data in 512 bits.
The hash function in the embodiment of the invention can convert an input with any length into an output with a fixed length, wherein the output is a hash value, and the hash value can be a digital fingerprint and is a method for creating a small digital fingerprint from any kind of data. The hash function compresses the transaction data into digests, reducing the amount of data, fixing the format of the data, and scrambling and mixing the digests to recreate a fingerprint called a hash value. The hash value is typically represented by a short string of random letters and numbers. The hash value of the transaction data is unchanged for the preset hash function, but the hash value can be changed greatly only by modifying one bit of the transaction data, so that the SWIFT message can be ensured not to be tampered in the processing process by judging the hash value, and the safety of SWIFT message processing is ensured.
In an embodiment of the present invention, after the calculating the transaction hash value of the transaction data, the method may further include: and encrypting the transaction data and the transaction hash value to obtain encrypted data and a decryption private key corresponding to the encrypted data, and sending the encrypted data to a verification node set in the primary network.
In detail, the encrypting the transaction data and the transaction hash value to obtain encrypted data and a decryption private key corresponding to the encrypted data includes:
randomly obtaining two different prime numbers, and respectively carrying out asymmetric calculation processing on the prime numbers to obtain an encryption key and a decryption private key;
and encrypting the transaction data and the transaction hash value by using the encryption key to obtain encrypted data, and determining the decryption private key as a decryption private key corresponding to the encrypted information.
Further, the randomly obtaining two different prime numbers, and respectively performing asymmetric computation on the prime numbers to obtain an encryption key and a decryption private key includes:
for two different prime numbers p and q obtained at random, the product n ═ pq is calculated,
Figure BDA0003286972810000071
Figure BDA0003286972810000072
from
Figure BDA0003286972810000073
To select one of
Figure BDA0003286972810000074
The number e of the reciprocity element is used as a public encryption index;
using formulas
Figure BDA0003286972810000075
Calculating a decryption index d;
and calculating the encryption key and the decryption private key, wherein the calculation method comprises the following steps:
encryption key: PK ═ e, n }
Decrypting the private key: SK ═ d, n }
In the embodiment of the invention, the encryption key and the decryption private key are key pairs obtained through an algorithm, the encryption key is a part which is open to the outside, the decryption private key is a non-public part, and the key pairs obtained through the algorithm can be guaranteed to be unique worldwide. When using this key pair, if one of the keys is used to encrypt a piece of data, the other key must be used to decrypt the piece of data. For example, encrypting data with an encryption key would necessitate decryption with a decryption private key or decryption would not be successful.
S2, checking the compliance of the transaction data, and screening out the transaction data meeting the compliance checking requirement;
in an embodiment of the present invention, the compliance includes: whether the transaction attributes such as transaction amount and geographic position meet preset compliance rules or not. For example: and the verification node directly determines whether the transaction amount exceeds the balance according to the account balance of the transaction initiator on the account book of the verification node, if so, the compliance examination is not passed, and if not, the compliance examination is passed.
For example, the compliance verification of the geographic location refers to that a verification node queries whether effective addresses of the transaction initiator and the transaction receiver are correct, if the effective addresses are wrong, the compliance verification of the geographic location does not pass, and if the effective addresses are correct, the compliance verification of the geographic location passes.
In detail, referring to fig. 3, the S2 includes:
s21, obtaining the encrypted data from the verification node set, and decrypting the encrypted data by using the decryption private key to obtain transaction data;
s22, identifying one or more transaction attributes from the transaction data;
s23, based on the preset compliance document matching the transaction attribute, judging whether the compliance examination of the transaction data passes;
when the compliance of the transaction data is not checked, ignoring the transaction data, and executing S24 and sending prompt information that the transaction data is not in compliance;
and when the compliance check of the transaction data is passed, executing S25 and keeping the transaction data.
In the embodiment of the invention, the identity authentication is carried out by utilizing the encryption key and the decryption private key, and the transaction data and the transaction hash value are encrypted by an asymmetric encryption algorithm, so that the problem of identity impersonation can be effectively prevented, and the safety of SWIFT message processing is improved.
S3, calculating a verification hash value of the transaction data meeting the compliance examination requirement, and performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data;
in the embodiment of the present invention, the verification node set is used to calculate the verification hash value of the transaction data meeting the compliance audit requirement, and the verification hash value is calculated by using the same preset hash function in S1.
In detail, in S3, the performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the verification node set includes:
acquiring the decrypted transaction hash value from the verification node;
comparing the transaction hash value with the verification hash value, and when the transaction hash value is the same as the verification hash value, the consistency verification of the verification node is passed;
traversing each verification node in the verification node set to obtain the consistency verification passing condition of each verification node;
and summarizing the consistency verification passing condition of each verification node to obtain the consistency verification passing rate of the transaction data.
In the embodiment of the present invention, since the transaction hash values are obviously different even when there is a slight change in the transaction data, the verification hash value of the transaction data obtained from the encrypted data is calculated by using the hash function preset in S1, and when the transaction hash value is the same as the verification hash value, it indicates that the transaction data obtained from the encrypted data has not been tampered.
According to the embodiment of the invention, if consistency verification is carried out only by one verification node, the possibility of verification error or false exists, so that each verification node in the verification node set is traversed to obtain the consistency verification passing condition of each verification node, and the consistency verification passing rate of the transaction data is obtained by summarizing the consistency verification passing condition of each verification node.
S4, judging the size of the consistency verification passing rate and a preset threshold value;
in the embodiment of the present invention, the preset threshold τ is compared with the consistency verification pass rate x, for example: setting station
The preset threshold is 50%, and when the consistency verification passing rate received by the contract node is 60%, the sizes of 50% and 60% are compared.
When the consistency verification passing rate is smaller than a preset threshold value, S5, judging that the cross-border transaction request is not verified;
in the embodiment of the invention, when the consistency verification passing rate x is less than or equal to the preset threshold tau, the transaction information is not credible, and the cross-border transaction cannot be executed by sending the message that the cross-border transaction is not verified.
When the consistency verification passing rate is greater than or equal to the preset threshold value, S6, determining that the cross-border transaction request passes verification, executing the cross-border transaction request, and packaging the transaction data into a message data block;
in the embodiment of the present invention, when the consistency verification passing rate x is greater than the preset threshold τ, it indicates that the transaction information is trusted, the cross-border transaction passes verification, the cross-border transaction request is executed, the contract node establishes a message data block, and encapsulates the transaction data and the transaction hash value into the message data block.
S7, broadcasting the message data block to the block chain network, and recording the message data block.
In detail, the S7 includes:
connecting the message data block with a previous block of the message data block by using a contract node in the primary network, and broadcasting the message data block to the block chain network;
and recording the message data blocks into accounting nodes of the block chain network and synchronizing the message data blocks to nodes corresponding to the private chain.
According to the embodiment of the invention, through the pre-constructed block chain network, the first-level alliance chain in the block chain network can ensure information safety; a secondary private chain in the block chain network is beneficial to the state to supervise the transaction data; and performing consistency verification on the transaction based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data, and judging whether the cross-border transaction passes the verification according to the consistency verification passing rate, so that the message processing safety is improved. Therefore, the block chain-based message processing method, the block chain-based message processing device, the electronic device and the computer-readable storage medium provided by the invention can solve the problems of low safety and low efficiency of message processing.
Fig. 4 is a functional block diagram of a packet processing apparatus based on a block chain according to an embodiment of the present invention.
The block chain based message processing apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the packet processing device 100 based on the block chain may include a data obtaining module 101, a verifying module 102, and a storing module 103. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the data acquisition module 101 is configured to acquire transaction data of a cross-border transaction request from a pre-constructed blockchain network, and calculate a transaction hash value of the transaction data;
the verification module 102 is configured to review compliance of the transaction data and screen out transaction data meeting compliance review requirements; calculating a verification hash value of the transaction data meeting the compliance audit requirement, and performing consistency verification on the cross-border transaction request based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data; judging the size of the consistency verification passing rate and a preset threshold value; when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified; when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
the storage module 103 is configured to broadcast the packet data block to the block chain network, and record the packet data block.
In detail, when the modules in the packet processing device 100 based on the block chain in the embodiment of the present invention are used, the same technical means as the packet processing method based on the block chain described in fig. 1 to fig. 3 is adopted, and the same technical effect can be produced, which is not described herein again.
Fig. 5 is a schematic structural diagram of an electronic device implementing a packet processing method based on a block chain according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a blockchain based message processing program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., executing a packet processing program based on a block chain, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a packet processing program based on a block chain, but also to temporarily store data that has been output or is to be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 5 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 5 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The memory 11 in the electronic device 1 stores a block chain-based message processing program which is a combination of a plurality of instructions, and when running in the processor 10, can realize:
acquiring transaction data of a cross-border transaction request from a pre-constructed blockchain network, and calculating a transaction hash value of the transaction data;
checking the compliance of the transaction data, and screening out the transaction data meeting the compliance checking requirement;
calculating a verification hash value of the transaction data meeting the compliance examination requirement, and performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data;
judging the size of the consistency verification passing rate and a preset threshold value;
when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified;
when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
broadcasting the message data blocks to the block chain network, and recording the message data blocks.
Specifically, the specific implementation method of the instruction by the processor 10 may refer to the description of the relevant steps in the embodiment corresponding to the drawings, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring transaction data of a cross-border transaction request from a pre-constructed blockchain network, and calculating a transaction hash value of the transaction data;
checking the compliance of the transaction data, and screening out the transaction data meeting the compliance checking requirement;
calculating a verification hash value of the transaction data meeting the compliance examination requirement, and performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data;
judging the size of the consistency verification passing rate and a preset threshold value;
when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified;
when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
broadcasting the message data blocks to the block chain network, and recording the message data blocks.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a verification mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A packet processing method based on a block chain is characterized in that the method comprises the following steps:
acquiring transaction data of a cross-border transaction request from a pre-constructed blockchain network, and calculating a transaction hash value of the transaction data;
checking the compliance of the transaction data, and screening out the transaction data meeting the compliance checking requirement;
calculating a verification hash value of the transaction data meeting the compliance examination requirement, and performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data;
judging the size of the consistency verification passing rate and a preset threshold value;
when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified;
when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
broadcasting the message data blocks to the block chain network, and recording the message data blocks.
2. The blockchain-based message processing method according to claim 1, wherein before the obtaining the transaction data of the cross-border transaction request in the pre-constructed blockchain network, the method further comprises:
the block chain network is constructed by a primary network and a secondary network, wherein the primary network adopts a P2P mode to construct a alliance chain, and the secondary network adopts a star topology structure to construct a private chain.
3. The method of blockchain-based message processing as claimed in claim 2 wherein the broadcasting the message data blocks to the blockchain network and recording the message data blocks comprises:
connecting the message data block with a previous block of the message data block by using a contract node in the primary network, and broadcasting the message data block to the block chain network;
and recording the message data blocks into accounting nodes of the block chain network and synchronizing the message data blocks to nodes corresponding to the private chain.
4. The blockchain-based message process of claim 2, wherein after the calculating the transaction hash value for the transaction data, further comprising:
and carrying out encryption operation on the transaction data and the transaction hash value to obtain encrypted data and a decryption private key corresponding to the encrypted data, and sending the encrypted data to a verification node set in the primary network.
5. The blockchain-based message processing method according to claim 1, wherein the calculating the transaction hash value of the transaction data includes:
converting the transaction data into transaction data in a binary coding format;
complementing the transaction data in the binary coding format to obtain transaction data in the binary coding format with a preset length;
blocking the transaction data in the binary coding format with the preset length into transaction data blocks;
and performing cyclic abstract calculation on the transaction data block to obtain a transaction hash value of the transaction data.
6. The blockchain-based message process of claim 4 wherein the reviewing the compliance of the transaction data includes:
acquiring the encrypted data from the verification node set, and decrypting the encrypted data by using the decryption private key to obtain transaction data;
identifying one or more transaction attributes from the transaction data;
and judging whether the compliance examination of the transaction data passes or not based on the preset compliance document matched with the transaction attribute.
7. The blockchain-based message processing method according to claim 4, wherein the performing consistency verification on the transaction data based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data includes:
acquiring a decrypted transaction hash value from the verification node;
comparing the transaction hash value with the verification hash value, and when the transaction hash value is the same as the verification hash value, the consistency verification of the verification node is passed;
traversing each verification node in the verification node set to obtain the consistency verification passing condition of each verification node;
and summarizing the consistency verification passing condition of each verification node to obtain the consistency verification passing rate of the transaction data.
8. A packet processing apparatus based on a block chain, the apparatus comprising:
the data acquisition module is used for acquiring transaction data of the cross-border transaction request from a pre-constructed blockchain network and calculating a transaction hash value of the transaction data;
the verification module is used for checking the compliance of the transaction data and screening out the transaction data meeting the compliance checking requirement; calculating a verification hash value of the transaction data meeting the compliance audit requirement, and performing consistency verification on the cross-border transaction request based on the transaction hash value and the verification hash value to obtain a consistency verification passing rate of the transaction data; judging the size of the consistency verification passing rate and a preset threshold value; when the consistency verification passing rate is smaller than a preset threshold value, the cross-border transaction request is not verified; when the consistency verification passing rate is larger than or equal to the preset threshold value, the cross-border transaction request passes the verification, the cross-border transaction request is executed, and the transaction data are packaged into a message data block;
and the storage module is used for broadcasting the message data blocks to the block chain network and recording the message data blocks.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of blockchain based messaging according to any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the method for packet processing based on blockchain according to any one of claims 1 to 7.
CN202111150210.5A 2021-09-29 2021-09-29 Block chain based message processing method, device, equipment and storage medium Pending CN113822675A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111150210.5A CN113822675A (en) 2021-09-29 2021-09-29 Block chain based message processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111150210.5A CN113822675A (en) 2021-09-29 2021-09-29 Block chain based message processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113822675A true CN113822675A (en) 2021-12-21

Family

ID=78921696

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111150210.5A Pending CN113822675A (en) 2021-09-29 2021-09-29 Block chain based message processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113822675A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114499859A (en) * 2022-03-22 2022-05-13 深圳壹账通智能科技有限公司 Password verification method, device, equipment and storage medium
CN114785525A (en) * 2022-05-12 2022-07-22 深圳壹账通科技服务有限公司 Blacklist library generation method, apparatus, device and storage medium
WO2023207871A1 (en) * 2022-04-29 2023-11-02 华为技术有限公司 Node cluster and data backup method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114499859A (en) * 2022-03-22 2022-05-13 深圳壹账通智能科技有限公司 Password verification method, device, equipment and storage medium
WO2023207871A1 (en) * 2022-04-29 2023-11-02 华为技术有限公司 Node cluster and data backup method
CN114785525A (en) * 2022-05-12 2022-07-22 深圳壹账通科技服务有限公司 Blacklist library generation method, apparatus, device and storage medium

Similar Documents

Publication Publication Date Title
Zhang et al. Research on a covert communication model realized by using smart contracts in blockchain environment
CN113822675A (en) Block chain based message processing method, device, equipment and storage medium
CN114884697B (en) Data encryption and decryption method and related equipment based on cryptographic algorithm
CN103999402A (en) Method and system for securely computing a base point in direct anonymous attestation
CN113055380B (en) Message processing method and device, electronic equipment and medium
CN111695097A (en) Login checking method and device and computer readable storage medium
CN115840787B (en) Block chain-based supply chain data sharing method, device, equipment and medium
CN115048664A (en) Data security storage method, device, equipment and medium based on solid state disk
CN111612458A (en) Method and device for processing block chain data and readable storage medium
CN113158207A (en) Block chain based report generation method and device, electronic equipment and storage medium
CN113420049A (en) Data circulation method and device, electronic equipment and storage medium
CN114499859A (en) Password verification method, device, equipment and storage medium
CN114553532A (en) Data secure transmission method and device, electronic equipment and storage medium
CN112217639B (en) Data encryption sharing method and device, electronic equipment and computer storage medium
CN110890979B (en) Automatic deployment method, device, equipment and medium for fort machine
CN114697132B (en) Method, device, equipment and storage medium for intercepting repeated access request attack
CN114629663B (en) Block chain-based digital commodity transaction method and device
CN114125158B (en) Anti-harassment method, device, equipment and storage medium based on trusted telephone
CN115643090A (en) Longitudinal federal analysis method, device, equipment and medium based on privacy retrieval
CN111814204B (en) Block chain-based data consensus method, related equipment and storage medium
CN115001768A (en) Data interaction method, device and equipment based on block chain and storage medium
CN115941352B (en) Information security interaction method and device based on big data, electronic equipment and storage medium
CN114826613B (en) Identity information query method, device, equipment and storage medium based on blockchain
CN116340984B (en) User information management method and system based on intelligent community
CN115086024A (en) Data transmission method, device, equipment and medium based on data signature

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