Method for storing payment data based on blockchain technology

By connecting with the SDK interface of the blockchain on the application client, combining the decentralized blockchain network and dynamic convolutional reputation points sorting function, the problem of data storage vulnerability in the existing technology is solved, and a high security and immutable payment data storage is achieved.

CN119941247BActive Publication Date: 2025-07-25浙江云野科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510448846.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-25
Estimated Expiration
2045-04-10

AI Technical Summary

Technical Problem

Existing methods of storing payment data based on blockchain technology rely on access control and encryption technologies, but may still be subject to internal or external attacks, with the risk of data tampering.

Method used

By using the SDK interface to connect with the blockchain in the application client, membership verification, endorsement node verification and sorting module processing are carried out, and a decentralized blockchain network is adopted, combining the multi-dimensional sorting function of dynamic convolutional reputation points and a smart contract mechanism to ensure the immutability and security of the data.

Benefits of technology

Decentralized design is realized, reducing the risk of single point of failure, enhancing the security and transparency of data, providing a high degree of traceability and immutability, and ensuring the immutability of data and trust mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941247B_ABST
    Figure CN119941247B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for storing payment data based on blockchain technology, including: in the application program client, the customer input module is connected to the blockchain through the SDK interface, the customer input module verifies the identity information through the SDK interface, the customer input module obtains the endorsement of the blockchain through the SDK interface, the customer input module receives the endorsement information signature and sends it to the sorting module of the blockchain. After the sorting module receives the signed signal of the endorsement, it generates the genesis block according to the block generation strategy, packs one or more endorsement information transactions into the genesis block, generates a new block, and sends it to the submission module. The submission module performs data storage and transaction data update. The present invention achieves a decentralized design, uses encryption technology to ensure that the data cannot be tampered with, and each data block is linked to the previous block through a hash value, enhancing the security of the data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data storage in blockchain technology, in particular to a method for storing payment data based on blockchain technology, which stores payment transaction data through blockchain technology. Background Art

[0002] Currently, the data storage generally adopted is a centralized relational database system. Through standard interfaces such as ODBC (Open Database Connectivity) and JDBC (Java Database Connectivity), the system submits the generated data to the relational database for storage and retrieves the required information therefrom. This storage method has become a widely adopted traditional solution in the industry due to its maturity and stability. However, this centralized data management method has certain limitations, especially in terms of data security. Since the data is highly concentrated in the hands of the platform party, if the platform party fails to abide by the confidentiality principle, there is a possibility of data tampering, which will undoubtedly pose a threat to the interests of users. Blockchain technology provides a decentralized data storage solution. This technology ensures the immutability of data through a distributed ledger, significantly enhancing data security. In a blockchain system, the data is not controlled by a single central entity, but is jointly maintained by multiple nodes in the network, thus effectively preventing the risk of malicious data tampering. This decentralized storage method provides new ideas and solutions for protecting user privacy and data security. Summary of the Invention

[0003] In view of the problems existing in the existing methods for storing payment data based on blockchain technology, the present invention is proposed.

[0004] Therefore, the problem to be solved by the present invention lies in the fact that currently, data storage relies on access control and encryption technologies to protect data, but it may still be subject to internal or external attacks.

[0005] To solve the above technical problems, the present invention provides the following technical solution: A method for storing payment data based on blockchain technology, which includes:

[0006] In the application program client, the customer input module is connected to the blockchain through the SDK interface;

[0007] The customer input module sends a first connection signal to the blockchain through the SDK interface, and the membership verification module of the blockchain verifies the first connection signal. If the verification is successful, the first signal information is stored in the blockchain;

[0008] The customer input module sends a second connection signal to the blockchain through the SDK interface, and the endorsement node module of the blockchain verifies the execution permission of the second connection signal. If the execution permission meets the transaction requirements, the endorsement node signs the second connection signal and forms a third connection signal to return to the customer input module;

[0009] After receiving the third connection signal, the client input module performs content judgment and third connection signal quantity judgment. The client input module packs and signs the third connection signal to form a fourth connection signal and sends it to the sorting module of the blockchain. The sorting module uses the blockchain transaction sorting mechanism to perform signal sorting and transmission;

[0010] After receiving the fourth connection signal, the sorting module generates a genesis block according to the block generation strategy, packs and clusters one or more fourth connection signal transactions into the genesis block, generates a new block, and sends it to the submission module. The submission module performs data storage and transaction data update.

[0011] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, in the client input module, the client input module is connected to the blockchain through an SDK interface, including:

[0012] The client input module writes payment data into the blockchain through the SDK interface, and only implements two interfaces for writing and reading. After the user completes the payment, the writing interface is called to save the data into the blockchain, and the first connection signal is input; when querying the user's personal payment record, the reading interface is called to obtain personal data from the blockchain;

[0013] In the first connection signal verification stage, the client input module calls the member service through the SDK, performs registration and registration, and obtains an identity certificate.

[0014] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, the blockchain sorting module adopts the Kafka method and is composed of ZooKeeper, Kafka, and Orderer, plus Org and Peer to implement the blockchain consortium chain network;

[0015] The blockchain consortium is composed of 3 ZooKeeper, 4 Kafka, and 3 Orderer, plus 1 Org and 3 Peer to implement the blockchain consortium chain network.

[0016] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, after receiving the third connection signal, the client input module performs content judgment and third connection signal quantity judgment, including:

[0017] Judge whether the proposal results are consistent and whether to execute according to the specified endorsement policy. If the same number of endorsements as the reserved quantity is not received, the processing is aborted; otherwise, the client input module packs the data into a transaction and signs it.

[0018] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, the running connection relationship between the customer input module and the blockchain module through the SDK is divided into a first running mode and a second running mode. The first running mode is as follows when the environment starts:

[0019] Start blockchain operation, start the sorting node, start the node, create a blockchain channel, add the node to the channel, install the smart contract, and the environment startup process ends;

[0020] The second running mode is as follows when a transaction is submitted:

[0021] The customer input module initiates a transaction and submits it to the SDK interface. The SDK interface submits the transaction information to the endorsing node, the endorsing node forwards it to the sorting node, the sorting node sorts the data and sends it to the transaction block, and the transaction block packs the data and submits it to the ledger for storage.

[0022] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, the characteristics of the blockchain transaction sorting mechanism include a multi-dimensional sorting function based on dynamic convolutional reputation scores:

[0023]

[0024] Where Ψ is the final sorting weight of transaction Tx k , t0 is the system initialization time, t c is the current timestamp, λ is the time decay coefficient (λ ∈ (0, 1]), ρ k is the normalized value of the transaction amount, R n(τ) is the reputation function of node n at time τ, m is the total number of candidate nodes, v j is the verification passing rate of node j, η j is the network latency of node j, σ j is the encryption strength coefficient, ε is a small amount to prevent division by zero, Φ(θ j ) is the resource load vector of node j, P is the standard distribution of transaction features, Q k is the actual distribution of Tx k , α is the KL divergence adjustment factor, s k is the transaction security level, H(x) is the Heaviside step function, V(x) is the verification efficiency function, D KL is the Kullback-Leibler divergence, F(x) is the security enhancement function, Ψ ∈ [0, 1]. When Ψ > 0.7, the transaction enters the priority packing queue. When Ψ ∈ (0.3, 0.7), it enters the regular queue. When Ψ < 0.3, it needs to be re-verified.

[0025] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, the fulfillment process of the smart contract includes:

[0026] The program client transfers the identity information to the identity authentication module in the blockchain;

[0027] The identity authentication module defines the user's identity ID, order ID, payment platform transaction ID, variables of purchased products, transaction amount and transaction time, and outputs them in the form of args bytes;

[0028] Judge the length of the args bytes: if the length is not 6, prompt that there is a problem with the number of parameters and end the contract fulfillment stage; if the length of the args bytes is 6, call the Init function, define the pay structure and call the PutState function, and enter the return err function stage;

[0029] Judge the number of return err functions: if the number of return err functions is not empty, judge it as an error message and end the contract fulfillment stage; if the return err function is empty, call the Success function and end the contract fulfillment stage.

[0030] As a preferred solution of the method for storing payment data based on blockchain technology according to the present invention, after the customer input module receives the third connection signal, it judges whether the proposal results are consistent and whether to execute according to the specified endorsement policy; if it does not receive the same number of endorsements as the reserved quantity, the processing is aborted; otherwise, the customer input module packs the data together to form a transaction, signs it, and sends it to the sorting module;

[0031] After the submission module receives the new block formed by the fourth connection signal group, it will verify each transaction in the block, check whether the input and output on which the transaction depends conform to the current state of the blockchain. After completion, the block is appended to the local blockchain, and the latest values of all keys are modified, and the obtained data is stored.

[0032] The present invention provides the following technical solution: an electronic device, including:

[0033] One or more processors;

[0034] A storage device having one or more programs stored thereon;

[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying data violation operation behaviors of the AI-based business system.

[0036] The present invention provides the following technical solution: an electronic device, including:

[0037] A computer-readable storage medium stores executable instructions thereon, and when the instructions are executed by a processor, the processor implements a method for identifying data violation operation behaviors in an AI-based business system.

[0038] The beneficial effects of the present invention are as follows:

[0039] 1. Decentralized design: With a decentralized design, data is distributed across multiple nodes in the network, reducing the risk of single-point failures.

[0040] 2. Data security: Encryption technology is used to ensure that data cannot be tampered with, and each data block is linked to the previous block through a hash value, enhancing data security.

[0041] 3. Transparency and traceability: All transactions are transparent and can be verified by all participants in the network, providing a high degree of traceability.

[0042] 4. Immutability: Once data is written, it is almost impossible to modify or delete, ensuring the immutability of the data.

[0043] 5. Trust mechanism: Trust is established through a consensus mechanism, eliminating the need to trust a single entity. Description of the Drawings

[0044] Figure 1 It is a method flow logic diagram of the method for storing payment data based on blockchain technology in Embodiment 1;

[0045] Figure 2 It is a flow chart of the execution smart contract of the method for storing payment data based on blockchain technology in Embodiment 1;

[0046] Figure 3 It is a query smart contract diagram of the method for storing payment data based on blockchain technology in Embodiment 1;

[0047] Figure 4 It is a system architecture diagram of the block storage module of the method for storing payment data based on blockchain technology in Embodiment 1. Detailed Embodiments

[0048] To make the above objects, features, and advantages of the present invention more apparent and understandable, the following detailed description of the specific embodiments of the present invention will be made in conjunction with the accompanying drawings of the specification.

[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.

[0050] Second, the "one embodiment" or "embodiment" referred to herein means a specific feature, structure, or characteristic that may be included in at least one implementation manner of the present invention. The appearances of "in one embodiment" in different places in this specification do not all refer to the same embodiment, nor are they separate or selectively exclusive embodiments from other embodiments.

[0051] Embodiment 1

[0052] Referring to Figures 1 to 4 , which is the first embodiment of this application. This embodiment provides a method for storing payment data based on blockchain technology, which includes:

[0053] As Figure 1 shown, in the application client, the customer input module is connected to the blockchain through the SDK interface;

[0054] The customer input module sends a first connection signal to the blockchain through the SDK interface. The membership verification module of the blockchain verifies the first connection signal. If the verification is successful, the first signal information is stored in the blockchain;

[0055] The customer input module sends a second connection signal to the blockchain through the SDK interface. The endorsement node module of the blockchain verifies the execution permission of the second connection signal. If the execution permission meets the transaction requirements, the endorsement node signs the second connection signal and forms a third connection signal and returns it to the customer input module;

[0056] After receiving the third connection signal, the customer input module performs content judgment and third connection signal quantity judgment. The customer input module packs and signs the third connection signal to form a fourth connection signal and sends it to the sorting module of the blockchain;

[0057] After receiving the fourth connection signal, the sorting module generates a genesis block according to the block generation strategy, puts one or more fourth connection signal transactions into the genesis block, generates a new block, and sends it to the submission module. The submission module performs data storage and transaction data update.

[0058] The customer input module writes payment data into the blockchain through the SDK interface, and only implements two interfaces for writing and reading. When the user completes the payment, the write interface is called to save the data to the blockchain; when querying the user's personal payment record, the read interface is called to obtain personal data from the blockchain.

[0059] According to the characteristics of the blockchain transaction sorting mechanism, a multi-dimensional sorting function based on dynamic convolution reputation points is designed:

[0060]

[0061] The explanations of each character are as follows: Ψ is the transaction Tx kThe final sorting weight, where \(t_0\) is the system initialization time, \(t\) c is the current timestamp, \(\lambda\) is the time decay coefficient (\(\lambda\in(0,1]\)), \(\rho\) k is the normalized value of the transaction amount, \(R\) n(τ) is the credit function of node \(n\) at time \(\tau\), \(m\) is the total number of candidate nodes, \(v\) j is the verification passing rate of node \(j\), \(\eta\) j is the network latency of node \(j\), \(\sigma\) j is the encryption strength coefficient, \(\varepsilon\) is a small quantity to prevent division by zero (\(\varepsilon = 1e - 8\)), \(\varPhi(\theta\) j ) is the resource load vector of node \(j\), \(P\) is the standard distribution of transaction features, \(Q\) k is the actual distribution of \(Tx\) k , \(\alpha\) is the KL divergence adjustment factor (\(\alpha\geq1\)), \(s\) k is the transaction security level, \(H(x)\) is the Heaviside step function, \(V(x)\) is the verification efficiency function, \(D\) KL is the Kullback - Leibler divergence, \(F(x)\) is the security enhancement function, \(\varPsi\in[0,1]\). When \(\varPsi>0.7\), the transaction enters the priority packaging queue; when \(\varPsi\in(0.3,0.7)\), it enters the regular queue; when \(\varPsi<0.3\), it needs to be re - verified.

[0062] Function definitions:

[0063] Credit function:

[0064]

[0065] where , is the credit weight coefficient, \(N\) valid is the number of historical valid verifications, \(N\) invalid is the invalid record;

[0066] Verification efficiency function:

[0067]

[0068] where \(\Gamma\) is the gamma function, \(\psi\) is the digamma function, and \(k\) is the order of differentiation for the security enhancement function;

[0069]

[0070] where \(\zeta\) is the Riemann zeta function and \(p\) is the encryption protocol level;

[0071] Ψ ∈ [0, 1]. When Ψ > 0.7, the transaction enters the priority packaging queue. When Ψ ∈ (0.3, 0.7), it enters the regular queue. When Ψ < 0.3, it needs to be re-verified. The numerator integral term controls the transaction time value, the denominator differential term evaluates the node verification ability, and the KL divergence term ensures the compliance of transaction characteristics.

[0072] Innovative features:

[0073] Couple the time decay integral with the amount logarithmic function to construct a transaction time value model;

[0074] Introduce the second-order partial derivative to describe the marginal effect change of the node verification ability;

[0075] Adopt the gamma function series expansion to quantify the impact of network delay on the verification efficiency;

[0076] Design a security enhancement function containing the Zeta function to achieve non-linear amplification of the encryption strength;

[0077] Control abnormal transactions through the composite structure of KL divergence and the exponential decay function.

[0078] Example: When ρ_k = 0.8 for a certain transaction Tx_k, the integral of R_n(t) is 1.2, the KL divergence = 0.05, the security level s_k = 3, the node η_j = 80ms, and σ_j = 2, substituting gives Ψ = 0.83 > 0.7, and it is preferentially packaged.

[0079] The above formula realizes the quantitative decision-making of transaction sorting through 17 dynamic parameters, 5 special functions, and 3-layer operation structures.

[0080] Range description: Ψ ∈ [0, 1]. When Ψ > 0.7, the transaction enters the priority packaging queue. When Ψ ∈ (0.3, 0.7), it enters the regular queue. When Ψ < 0.3, it needs to be re-verified. The numerator integral term controls the transaction time value, the denominator differential term evaluates the node verification ability, and the KL divergence term ensures the compliance of transaction characteristics.

[0081] This application uses 4 kafkas and 3 Zookeepers for configuration, mainly for the following core reasons:

[0082] Zookeeper node number design (3 nodes)

[0083] Fault tolerance and consensus mechanism: Zookeeper adopts the ZAB protocol (a distributed consensus algorithm similar to Paxos). It is necessary to ensure that the majority of nodes in the cluster are alive to conduct normal elections and services. A 3-node cluster allows a maximum of 1 node to fail, while a 2-node cluster cannot tolerate any single-point failure. This design ensures the stability of metadata management, such as the partition leader election of Kafka and the health status monitoring of Brokers.

[0084] Avoiding the split-brain problem: Odd-numbered nodes can avoid the "dual-master" conflict during network partitioning; when there are 3 nodes and a network split occurs, the valid cluster can be quickly determined through a voting mechanism, while even-numbered nodes may cause service stagnation due to the inability to reach a majority.

[0085] Kafka Node Count Design (4 Nodes)

[0086] Crash Fault Tolerance and Partition Replication: Kafka ensures data reliability through the replication mechanism. Assuming the partition replication factor for each Topic is set to 3 (default value), a 4-node cluster allows 1 node to fail simultaneously without affecting the service. For example, each partition has 1 Leader (processing reads and writes) and 2 Followers (syncing data); when the Leader fails, Zookeeper will elect a new Leader from the Followers.

[0087] Supporting High Throughput and Load Balancing: The Ordering service depends on Kafka to achieve transaction ordering; a 4-node cluster can disperse the transaction processing pressure. Combining with a multi-partition design (such as each Channel corresponding to a partition) can improve the overall throughput.

[0088] Scalability and Production Environment Recommendations: In actual deployment, the Kafka cluster needs to reserve redundant nodes to handle sudden traffic or hardware failures. A 4-node cluster provides higher scalability than a 3-node cluster and meets the requirements for stability in the production environment.

[0089] The Core Logic of Their Collaboration: Zookeeper manages Kafka metadata: Zookeeper records Kafka Broker registration, partition leader information, consumer offsets, etc. Kafka relies on Zookeeper to achieve dynamic load balancing and fault recovery.

[0090] Ordering Service Architecture: Each Kafka node corresponds to an Ordering Service Node (OSN). Through Zookeeper, the transaction batches and block generation status are synchronized to ensure the consistency of the transaction order across the network.

[0091] In the first connection signal verification stage, the client input module calls the membership service through the SDK for registration and enrollment and obtains the identity certificate.

[0092] The blockchain uses Kafka for ordering, consisting of ZooKeeper, Kafka, and Orderer, plus Org and Peer to implement the blockchain consortium chain network.

[0093] After the client input module receives the information returned by the endorsement node, it determines whether the proposal results are consistent and whether to execute according to the specified endorsement policy. If it does not receive the same number of endorsements as the reserved quantity, the processing is aborted; otherwise, the client input module packs the data into a transaction and signs it.

[0094] The creation process of the genesis block is as follows:

[0095] Set the maximum capacity of the block;

[0096] Write Kafka-related information into the genesis block of the network;

[0097] The method for setting the maximum block capacity is to set the value of the Orderer.AbsoluteMaxBytes item in the configtx.yaml file. In bytes, the maximum block capacity does not include the size of the block header information;

[0098] The generation of the genesis block requires configuring Kafka-related information in the configtx.yaml file. Set Orderer.OrdererType to kafka, set Orderer.Kafka.Brokers to the IP addresses and ports of the nodes in the Kafka cluster, and configure the Kafka cluster.

[0099] The way to configure the Kafka cluster is as follows:

[0100] Set unclean.leader.election.enable to false;

[0101] Set min.insync.replicas to M. When data is committed, at least M replicas will be written. The range of the custom value is 1 < M < N;

[0102] Set default.replication.factor to N, indicating that each channel on the Kafka node saves data of N replicas. The range of the value is 1 < K;

[0103] Set the message.max.bytes value, and the message.max.bytes value is less than the socket.request.max.bytes value;

[0104] Set the replica.fetch.max.bytes value, which is the maximum number of bytes to fetch messages for each channel;

[0105] Set log.retention.ms to -1 to turn off the time-based log retention method;

[0106] M, N, and K are all numbers. K is the total number of Kafka clusters, and the custom value is the number of Kafka clusters mobilized during this run.

[0107] The running connection relationship between the customer input module and the blockchain module through the SDK is divided into a first running mode and a second running mode. In the first running mode, when the environment starts, the process is as follows:

[0108] Start the blockchain operation, start the sorting node, start the node, create a blockchain channel, add the node to the channel, install the smart contract, and the environment startup process ends;

[0109] The second running mode is when a transaction is submitted. The process is as follows:

[0110] The customer input module initiates a transaction and submits it to the SDK interface. The SDK interface submits the transaction information to the endorsing node, the endorsing node forwards it to the sorting node, the sorting node sorts the data and sends it to the transaction block, and the transaction block packs the data and submits it to the ledger for storage.

[0111] After the customer input module receives the third connection signal, it determines whether the proposal results are consistent and whether to execute according to the specified endorsement policy. If it does not receive the same number of endorsements as the reserved quantity, the processing is aborted; otherwise, the customer input module packs the data together to form a transaction, signs it, and sends it to the sorting module.

[0112] After the submission module receives the new block formed by the fourth connection signal group, it will verify each transaction in the block, check whether the input and output on which the transaction depends conform to the current state of the blockchain. After completion, it appends the block to the local blockchain, modifies the latest value of all keys, and stores the obtained data.

[0113] One fulfillment process of the smart contract is the recording method. Among them, the process of executing the smart contract Figure 2 is as follows:

[0114] The customer input module passes the identity information to the identity authentication module in the blockchain; the identity authentication module defines the user's identity ID, order ID, payment platform transaction ID, variables of the purchased product, transaction amount, and transaction time, and outputs them in the form of args bytes;

[0115] Judge the length of the args bytes: if the length is not 6, it will prompt that there is a problem with the number of parameters and end the contract fulfillment stage; if the length of the args bytes is 6, it will call the Init function, define the pay structure, and call the PutState function to enter the return err function stage;

[0116] Determine the number of returned err functions: If the number of returned err functions is not empty, it is judged as an error message and the contract execution phase ends; if the returned err function is empty, the Success function is called to end the contract execution phase.

[0117] Among them, the smart contract query process is as follows Figure 3 As shown:

[0118] The client input module passes the contract query information to the identity authentication module in the blockchain;

[0119] The identity authentication module defines the user ID;

[0120] Determine the length of args under the ID: If the length of args is not 1, it will prompt that the number of parameters is wrong and end the contract query process; if the length of args is 1, define the queryString function, call the getQueryResultQueryString function, and enter the return err function stage;

[0121] Determine the number of returned err functions: If the number of returned err functions is not empty, it is judged as an error message and the contract execution phase ends; if the returned err function is empty, the Success function is called to end the contract execution phase.

[0122] Among them, a Kafka processing process is as follows:

[0123] 1) Transaction 1 (TX1) already exists in sorting service (OSN) 1 and is sent to the Kafka cluster;

[0124] 2) The client submits transaction 2 (TX2) to the sorting service (OSN) 1 through the Brocadcast (gRPC broadcast) interface, and then sends it to the Kafka cluster;

[0125] 3) The client submits transaction 3 (TX3) to the sorting service (OSN) 0 through the Brocadcast interface, and then sends it to the Kafka cluster;

[0126] 4) The Kafka cluster saves the three transactions in sequence from No. 3 to No. 5 according to the transaction submission time;

[0127] 5) The client sends a distribution request through the (gRPC distribution) Deliver interface and obtains block 4 (Block 4) that stores transactions 1, 2, and 3 from the sorting service (OSN) 2. This completes the example process.

[0128] This method uses three ZooKeepers, as follows:

[0129] A blockchain operation mode, which includes two modules: a REST SDK and a blockchain consortium chain network. Among them, the following is shown Figure 4 As a system architecture diagram of a block storage module, it uses the FabricClientRest project of the spring boot framework to provide external access through the JDK 1.8 environment. Spring boot itself embeds Tomcat, and it can provide Web access services without installing Tomcat again.

[0130] Among them, the sorting of the blockchain consortium chain network adopts the Kafka method, which consists of 3 ZooKeepers, 4 Kafkas and 3 Orderers. Together with 1 Org and 3 Peers, the blockchain consortium chain network can be realized. It can be deployed with 7 servers to provide a blockchain network with high availability, security and anti-tampering.

[0131] Example 2

[0132] The second embodiment of the present invention is different from the first embodiment in that:

[0133] I. Test preparation and implementation process

[0134] 1. Test preparation

[0135] The test scenario is set as the blockchain transaction system of a cross-border payment platform, which is used to process cross-border transfer requests initiated by users; the client input module integrates the SDK interface and is connected to the private blockchain network. The network includes 10 verification nodes, 5 endorsement nodes and 3 sorting nodes; the test data includes 2,000 real transaction records, covering three categories: normal transfer, large-amount transaction (single transaction > $100,000) and cross-chain transaction; the blockchain network adopts the PBFT consensus algorithm, the transaction verification threshold is 3 endorsement signatures, and the block generation interval is set to 2 seconds.

[0136] 2. Implementation process

[0137] (1) Membership verification:

[0138] The client sends a first connection signal containing a digital certificate through the SDK, and the blockchain membership verification module performs the following operations:

[0139] Verify the legitimacy of the certificate authority (CA);

[0140] Check the certificate validity period and permission scope;

[0141] Write the verified signal into the blockchain evidence deposit.

[0142] (2) Endorsement permission verification:

[0143] The client sends a second connection signal (including transaction details), and the endorsement node module performs the following operations:

[0144] Verify the account balance and permissions of the transaction initiator;

[0145] Simulate the execution of transaction logic (such as exchange rate conversion);

[0146] Generate a third connection signal with node signatures (including transaction hash and timestamp).

[0147] (3)Transaction packaging and sorting:

[0148] After the client collects at least 3 third connection signals, it performs the following operations:

[0149] Verify the signature consistency and transaction hash integrity;

[0150] Package multiple transactions into a fourth connection signal (≤50 transactions per package);

[0151] Submit it to the sorting module for timestamp sorting.

[0152] (4)Block generation and submission:

[0153] The sorting module generates a block every 2 seconds;

[0154] Generate a block body in the order of transaction reception;

[0155] Calculate the Merkle tree root hash and generate a block header;

[0156] Broadcast the block to all network nodes through the submission module.

[0157] (5)Dynamic load processing:

[0158] When the transaction concurrency exceeds the threshold (1000 transactions per second), the system automatically activates the following mechanisms:

[0159] Add temporary sorting nodes to share the load;

[0160] Enable transaction sharding processing (≤200 transactions per shard);

[0161] Optimize the task assignment strategy of endorsement nodes.

[0162] II. Experimental data recording

[0163] The following are six experimental data record tables, showing the performance of the system under different scenarios:

[0164] Table 1: Performance data in normal transaction scenarios

[0165]

[0166] Table 2: Performance Data in High-Concurrency Scenarios

[0167]

[0168] Table 3: Performance Data in Cross-Chain Transaction Scenarios

[0169]

[0170] Table 4: Malicious Attack Test Data

[0171]

[0172] Table 5: Dynamic Node Expansion Test Data

[0173]

[0174] Table 6: Comparative Data of Traditional Blockchain Systems

[0175]

[0176] III. Analysis of Table Data

[0177] 1. Performance Comparative Analysis

[0178] Throughput: In normal transaction scenarios, the average throughput of the system of the present invention is 480 TPS (Table 1), while that of the traditional system is only 180 TPS (Table 6), a 166% increase. In high-concurrency scenarios, the throughput of the present invention reaches 3200 TPS (Table 2), a 237% increase compared to the 950 TPS of the traditional system (Table 6).

[0179] Security: In the malicious attack test, the double-spending attack interception rate is 100% (Table 4), significantly higher than the typical defense level of traditional systems (usually <90%). The cross-chain transaction consistency reaches 99.5% (Table 3), superior to the 97% benchmark value of mainstream cross-chain solutions.

[0180] Dynamic scalability: After adding 3 nodes, the throughput increases by 48% (Table 5), and the load balance degree reaches 95%, indicating outstanding elastic expansion ability of the system.

[0181] 2. Technical Advantage Analysis

[0182] Hierarchical verification mechanism: The separation of membership verification and endorsement permissions (verification time-consuming 120ms in Table 1 vs 300ms in traditional systems) reduces single-point bottlenecks.

[0183] Dynamic load sharding: The transaction failure rate in high-concurrency scenarios is only 1.5% (Table 2), an 82% reduction compared to 8.7% of traditional systems (Table 6), reflecting the effectiveness of the sharding strategy.

[0184] Real-time attack defense: The time taken to identify abnormal transactions is 80 ms (Table 4), which is 6 times faster than the traditional batch detection-based solution (usually > 500 ms).

[0185] 3. Summary of advantages

[0186] Efficiency breakthrough: By optimizing the sorting module and parallel endorsement mechanism, the block confirmation time is shortened to 2.1 seconds (Table 1), which is 285 times faster than the traditional PoW chain.

[0187] Security enhancement: By adopting multi-signature endorsement and real-time tampering detection (Table 4), the security score of critical transactions reaches 9.8 / 10 (Table 1), meeting the financial-level security requirements.

[0188] Flexible architecture: Dynamic node expansion enables the system to maintain 99.5% stability under a sudden increase in load (Table 5), avoiding the avalanche-like performance degradation of traditional blockchains.

[0189] Conclusion: The hierarchical verification mechanism and dynamic expansion strategy of the present invention have achieved significant breakthroughs in throughput, security, and flexibility, providing a practical technical solution for high-value blockchain applications.

[0190] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered by the scope of the claims of the present invention.

Claims

1. A method for storing payment data based on blockchain technology, characterized in that, include: The customer input module in the application client is connected to the blockchain through the SDK interface; The client input module sends a first connection signal to the blockchain through the SDK interface, and the membership verification module of the blockchain verifies the first connection signal. If the verification is successful, the first connection signal information is stored in the blockchain; The client input module sends the second connection signal to the blockchain through the SDK interface. The endorsement node module of the blockchain verifies the execution authority of the second connection signal. If the execution authority meets the transaction requirements, the endorsement node module signs the second connection signal to form a third connection signal and returns it to the client input module. After receiving the third connection signal, the customer input module performs content judgment and the number judgment of the third connection signal. The customer input module packages and signs the third connection signal to form a fourth connection signal and sends it to the sorting module of the blockchain. The sorting module uses the blockchain transaction sorting mechanism to sort and transmit the signal; After receiving the fourth connection signal, the sorting module sorts the transactions based on the multi-dimensional sorting function of the dynamic convolution reputation score, generates a genesis block according to the block generation strategy, puts one or more fourth connection signal transaction packaging clusters into the genesis block, generates a new block, and sends it to the submission module, which performs data storage and transaction data update; The multi-dimensional ranking function based on dynamic convolution reputation score includes: where Ψ is the final sorting weight of transaction Tx k , t0 is the system initialization time, t c is the current timestamp, λ is the time decay coefficient, λ ∈ (0, 1], ρ k is the normalized value of the transaction amount, R n (τ) is the reputation function of node n at time τ, m is the total number of candidate nodes, v j is the verification passing rate of node j, η j is the network delay of node j, σ j is the encryption strength coefficient, ε is a small quantity to prevent division by zero, Φ(θ j ) is the resource load vector of node j, P is the standard distribution of transaction features, Q k is the actual distribution of Tx k , α is the KL divergence adjustment factor, s k is the transaction security level, H(x) is the Heaviside step function, V(x) is the verification efficiency function, D KL is the Kullback-Leibler divergence, F(x) is the security enhancement function, Ψ ∈ [0, 1]. When Ψ > 0.7, the transaction enters the priority packaging queue; when Ψ ∈ (0.3, 0.7), it enters the regular queue; when Ψ < 0.3, it needs to be re-verified.

2. The method for storing payment data based on blockchain technology according to claim 1, wherein, The client input module in the application client is connected to the blockchain through the SDK interface, including: The customer input module writes payment data into the blockchain through the SDK interface, and only implements two interfaces: writing and reading. When the user completes the payment, the writing interface is called to save the data into the blockchain and the first connection signal is input. When querying the user's personal payment record, the reading interface is called to obtain personal data from the blockchain. In the first connection signal verification phase, the client input module calls the member service through the SDK to register and obtain an identity certificate.

3. The method for storing payment data based on blockchain technology according to claim 1 or 2, characterized in that The sorting module adopts Kafka mode, which is composed of ZooKeeper, Kafka and Orderer, plus Org and Peer to realize the blockchain alliance chain network; The blockchain alliance consists of 3 ZooKeepers, 4 Kafkas and 3 Orderers, plus 1 Org and 3 Peers to realize the blockchain alliance chain network.

4. The method for storing payment data based on blockchain technology according to claim 3, wherein, After receiving the third connection signal, the client input module performs content determination and third connection signal quantity determination, including: After receiving the third connection signal, the client input module performs content judgment and the third connection signal quantity judgment to determine whether the proposal result is consistent and whether it is executed in accordance with the specified endorsement policy. If no endorsement equal to the predetermined quantity is received, the processing is terminated; otherwise, the client input module packages the data into a transaction and signs it.

5. The method for storing payment data based on blockchain technology according to any one of claims 1, 2, and 4, characterized in that The client input module is divided into a first operation mode and a second operation mode through the operation connection relationship between the SDK and the blockchain module, wherein the first operation mode is when the environment is started, and the process includes: Start blockchain operation, start sorting nodes, start nodes, create channels on blockchain, add nodes to channels, install smart contracts, and the environment startup process ends; The second operation mode is when the transaction is submitted, including: The customer input module initiates a transaction and submits it to the SDK interface. The SDK interface submits the transaction information to the endorsement node, which forwards it to the sorting node. The sorting node sorts the data and sends it to the transaction block. The transaction block packages the data and submits it to the ledger for storage.

6. The method for storing payment data based on blockchain technology according to claim 5, wherein The execution process of the smart contract includes: The application client passes the identity information to the identity authentication module in the blockchain; The identity authentication module defines the user's identity ID, order ID, payment platform transaction ID, purchased product, transaction amount and transaction time variables, and outputs them in args byte format; Determine the args byte length: If the length is not 6, it will prompt that there is a problem with the number of parameters and end the contract execution phase; if the args byte length is 6, call the Init function, define the pay structure and call the PutState function, and enter the return err function phase; Determine the number of returned err functions: If the number of returned err functions is not empty, it is judged as an error message and the contract execution phase ends; if the returned err function is empty, the Success function is called to end the contract execution phase.

7. The method for storing payment data based on blockchain technology according to claim 5, wherein After receiving the third connection signal, the client input module determines whether the proposal results are consistent and whether they are executed with reference to the specified endorsement policy; if no endorsements equal to the predetermined number are received, the processing is terminated; Otherwise, the client input module packages the data together into a transaction, signs it, and sends it to the sorting module; After receiving the new block formed by the fourth connection signal group, the submission module will verify each transaction in the block to check whether the input and output on which the transaction depends are consistent with the current state of the blockchain. After completion, the block will be appended to the local blockchain, the latest values of all keys will be modified, and the obtained data will be stored.

8. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Energy data distributed sharing system and method based on block chain technology

    CN119691057A