An object chain-based transaction processing method, system, device and storage medium

By using object chain technology, data is divided into object data and transaction data. Using PoS consensus and IPFS storage, the problems of large block storage and NFT security in blockchain are solved, realizing a blockchain solution with high TPS and low gas fees, and providing infrastructure for Web3 applications.

CN114707172BActive Publication Date: 2026-01-02SHENZHEN PANDORA INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210144853.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-16
Publication Date
2026-01-02
Estimated Expiration
2042-02-16

AI Technical Summary

Technical Problem

Existing blockchain technologies suffer from limitations such as block size, low TPS, and high gas fees, making it impractical to write large data blocks/files to the blockchain. NFT data is also insecure on the blockchain and cannot be effectively stored and transmitted.

Method used

Using object chain technology, data is divided into two categories: object data and transaction data. The PoS consensus algorithm and IPFS storage are used. Transaction objects are linked by hash values ​​to solve the on-chain storage problem of large object data, and the PoH algorithm solves the timing problem of transaction objects in multiple nodes.

Benefits of technology

It enables massive object data storage on the blockchain, high TPS and low gas costs, and provides the underlying infrastructure for Web3 applications and data asset valuation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114707172B_ABST
    Figure CN114707172B_ABST
Patent Text Reader

Abstract

The application discloses a transaction processing method, system and device based on an object chain and a storage medium, and is used for solving the on-chain storage problem of large object data, improving the scalability of data types, realizing the rapid packaging of data objects, and reducing resource waste caused by computing power competition. The method comprises the following steps: receiving a user-sent data creation request, and writing corresponding target data into a data object according to the data creation request; reading a first hash value of all field concatenations in the data object; generating a first transaction object according to transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchain, and particularly relates to a transaction processing method, system and device based on object chain and a storage medium. BACKGROUND

[0002] The storage of a blockchain is a distributed ledger of the entire network, and all full nodes (i.e., nodes that synchronize all blockchain data) of the entire network need to store the distributed ledger and maintain data consistency. In order to ensure the security of the blockchain, including coping with the threat of transaction spam blocking the network and potential distributed denial of service (DDoS) attacks, the current blockchain has a block size limit, such as the maximum size of the block of Bitcoin and its fork chain being fixed at 2M-32MB; Ethereum limits the average size of the block to about 20KB through a block gas limit (about 3 million gas).

[0003] At present, a blockchain with high consensus usually uses a proof of work (PoW) consensus algorithm. In order to ensure the fairness of computing power, in addition to limiting the block size, the block difficulty is dynamically adjusted to uniformize the block time interval, so as to compete for computing power under fair conditions, and the node that first solves the Hash algorithm problem is selected as the block node, which leads to low TPS (Transaction Per Second) and high block delay of the PoW blockchain, for example, the TPS of Bitcoin is approximately 1, and the delay is approximately 10 minutes; the TPS of Ethereum is approximately 15, and the delay is approximately 15 seconds; and moreover, due to the computing power paid by PoW and the TPS provided by the system far from meeting the required TPS, the user transaction has a high gas fee.

[0004] Due to the above-mentioned problems of block size limit, low TPS, and high gas fee that cannot be afforded, it is generally not feasible to write large data blocks / files (such as blocks or files greater than 100MB) into the blockchain.

[0005] The Internet has developed to the Web3.0 era, and NFT (Non-Fungible Tokens, also known as "tokens") as a high-consensus form of user data assets has begun to gradually enter the lives of the public. NFT has the attributes of uniqueness, scarcity and indivisibility. Data such as games, art, domain names, collectibles, virtual assets, real assets and identity can be cast into NFT, become assets bound to the user's identity, and traded between users to generate circulation value. However, the data of NFT cannot be written into the block under the current blockchain technology, and generally uses offline storage, storage on centralized servers and other methods, which has the problems of easy loss, easy tampering and insecurity. SUMMARY

[0006] To solve the above technical problems, the present application provides a transaction processing method, system and device based on object chain and storage medium.

[0007] The first aspect of the present application provides a transaction processing method based on object chain, comprising:

[0008] receiving a user's creation data request, and writing corresponding target data into a data object according to the creation data request;

[0009] reading a first hash value of all field concatenations in the data object;

[0010] generating a first transaction object according to transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value.

[0011] Optionally, the first transaction object includes a second hash value of concatenation of all fields in the first transaction object, and after generating the first transaction object according to the transaction data and the first hash value, the method further comprises:

[0012] when receiving a user's transfer request for transferring the data object, generating a second transaction object according to transaction data and the second hash value, so that the second transaction object is mapped to the first transaction object through the second hash value, and the second transaction object is mapped to the data object through the first hash value.

[0013] Optionally, the writing of the corresponding target data into the data object according to the creation data request comprises:

[0014] generating an object type according to the creation data request;

[0015] generating metadata in the form of key, value pairs;

[0016] generating a data field of the target data in a string format;

[0017] generating a hash value of the data field;

[0018] generating a hash value of a storage location according to a storage location of the target data;

[0019] generating a first hash value of concatenation of all fields;

[0020] generating a data object in a JSON format according to the information generated above.

[0021] Optionally, the generating a first transaction object according to the transaction data and the first hash value comprises:

[0022] obtaining a hash value of a previous transaction object;

[0023] obtaining a transaction data object type;

[0024] obtaining a transaction type;

[0025] obtaining a username of a transaction initiator;

[0026] obtaining a username of a transaction receiver;

[0027] obtaining a hash value of a data field of the target data from the data object;

[0028] obtaining a hash value of a storage location of the target data from the data object;

[0029] generating a transaction creation time;

[0030] generating a hash value of the transaction object, i.e. a second hash value;

[0031] generating a first transaction object in a JSON format according to the information obtained or generated above.

[0032] Optionally, the writing the corresponding target data into the data object according to the data creation request comprises:

[0033] determining that there is no data duplicated with the corresponding target data according to the data creation request, and writing the target data into the data object.

[0034] Optionally, the determining that there is no data duplicated with the target data according to the data creation request comprises:

[0035] generating a hash value of a data field of the corresponding target data according to the data creation request;

[0036] comparing the hash value of the data field with hash values of existing data fields;

[0037] If there is no repeated hash value, it is determined that there is no data duplicated with the target data.

[0038] Optionally, the receiving the user-sent data creation request comprises:

[0039] Receiving the data creation request initiated by the user through a Web3 visual interface or an API interface.

[0040] Optionally, the generating the second transaction object according to the transaction data and the second hash value comprises:

[0041] Obtaining the hash value of the previous transaction object;

[0042] Obtaining the transaction data object type;

[0043] Obtaining the transaction type;

[0044] Obtaining the username of the transaction initiator;

[0045] Obtaining the username of the transaction recipient;

[0046] Obtaining the hash value of the data field of the target data from the first transaction object;

[0047] Obtaining the hash value of the storage location of the target data from the first transaction object;

[0048] Generating the transaction creation time;

[0049] Generating the hash value of the current transaction object;

[0050] Generating the second transaction object in the JSON format according to the above-obtained or generated information.

[0051] Optionally, the method is applied to an object chain, the structure of the object chain adopts a PoS algorithm, and the nodes of the object chain are composed of a leader node, a candidate leader node, a synchronization node and a verification node.

[0052] Optionally, the leader node is established by voting of the verification node, and the leader node is used for packaging data; the candidate leader node is established by voting of the verification node, and the candidate leader node is used for replacing the leader node; the synchronization node is used for synchronizing data on the object chain; and the verification node belongs to a subset of the synchronization node.

[0053] The second aspect of the present application provides a transaction processing system based on an object chain, comprising:

[0054] A receiving unit configured to receive a user-sent data creation request;

[0055] a writing unit configured to write corresponding target data into a data object according to the data creation request;

[0056] a reading unit configured to read a first hash value of all field concatenations in the data object;

[0057] a first generating unit configured to generate a first transaction object according to transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value.

[0058] The third aspect of the present application provides a transaction processing device based on an object chain, the device comprising:

[0059] a processor, a memory, an input / output unit and a bus;

[0060] The processor is connected with the memory, the input / output unit and the bus;

[0061] The memory stores a program, and the processor invokes the program to execute the method of the first aspect and any optional aspect of the first aspect.

[0062] The fourth aspect of the present application provides a computer readable storage medium, the computer readable storage medium stores a program, and the program executes the method of the first aspect and any optional aspect of the first aspect when executed on a computer.

[0063] From the above technical solutions, the present application has the following advantages:

[0064] In the transaction processing method based on the object chain provided by the present application, after the user initiates a data creation request, corresponding target data is written into a data object, the data object contains a first hash value of all field concatenations in the data object, a first transaction object is generated according to transaction data and the first hash value, so that the mapping of the first transaction object to the data object is realized through the first hash value. Through this method, the user's data assets and transaction data can be distinguished and abstracted into data objects and transaction objects, and linked with each other, solving the problem of on-chain storage of large object data. When the target data is transferred, the time sequence problem of multi-node transaction objects is solved through the concatenation order of the hash values. The application of this method has the advantages of on-chain storage of massive object data and transaction data, high TPS and low fuel cost, providing underlying infrastructure support for Web3 applications and data asset value. BRIEF DESCRIPTION OF DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort based on these drawings.

[0066] Figure 1 An embodiment flowchart of the object chain-based transaction processing method provided in the present application;

[0067] Figure 2 A system composition diagram of the object chain structure provided in the present application;

[0068] Figure 3 A communication diagram of creating a data object in the present application;

[0069] Figure 4 Another embodiment flowchart of the object chain-based transaction processing provided in the present application;

[0070] Figure 5 A communication diagram of transferring a data object in the present application;

[0071] Figure 6 An embodiment flowchart of the exception handling in the object chain-based transaction processing in the present application;

[0072] Figure 7 A system deployment structure diagram of the object chain in the present application;

[0073] Figure 8 An embodiment structure diagram of the object chain-based transaction processing system provided in the present application;

[0074] Figure 9 An embodiment structure diagram of the object chain-based transaction processing apparatus provided in the present application. DETAILED DESCRIPTION

[0075] Based on the thought of "everything is an object", the object chain integrating the technical mechanisms of InterPlanetary File System (IPFS), PoH, PoS and the like is proposed, the blocks of the existing block chain are upgraded to objects with non-fixed size and non-fixed block generation time interval, data is divided into two categories of object data and transaction data, the data assets of a user are abstracted as object data and stored based on IPFS, and the object data is linked to the transaction object chain through object Hash, solving the on-chain storage problem of large object data; the user activities are abstracted as transaction data, and the Hash (preferably keccak-256 algorithm) of the transaction data object is based on the Proof of History (PoH) to solve the time sequence problem of multiple node objects, and the Proof of Stake (PoS) is based on the consensus problem, forming a transaction object chain; the object chain has the advantages of a native public chain, such as being able to simultaneously store massive object data and high-speed transaction data, 100,000-level super-high TPS, super-low fuel cost, sub-second block generation delay (for example, through an on-demand block generation mechanism, block generation within 0.5 seconds if there is a transaction, no block generation if there is no transaction), and the like, providing underlying infrastructure support for Web3.0 applications and data asset value.

[0076] The method provided in the application is applied to the object chain, please refer to Figure 2 , in the structure of the object chain, the objects can be divided into two categories, data objects and transaction objects, the data objects are used to store data with non-fixed size, and the transaction objects are used to store multiple types of transactions, the transaction types include: creating data assets (CreateData), destroying data assets (BurnData), transferring data assets (TransferData), casting NFTs (CastNFT), destroying NFTs (BurnNFT), transferring NFTs (TransferNFT) and the like. In the application, the tree structure of the Merkle tree is changed into the link relationship of the block chain, forming a calculation mode similar to:

[0077] hash n (data n ||hash (n-1) (data (n-1) ||…hash1(data1)))(|| represents concatenation), wherein hash represents a Hash function, the time sequence relationship of transactions is determined through the sequence relationship of Hash calculation, thereby solving the time sequence problem of blocks.

[0078] The method provided in the application can be applied to the object chain, please refer to Figure 7 , Figure 7is an embodiment schematic diagram of a system deployment of an object chain structure, the system is composed of n object chain servers, the object chain servers are connected through the Internet, 1 leader node, 3 candidate leader nodes, m verification nodes and n synchronization nodes (n≥m) deployed on the object chain server are all logical nodes of the object chain server, that is, they are all carried on the object chain server. The contents responsible by each node are as follows:

[0079] Leader node:

[0080] Elected by the verification node, needs to obtain the consent of more than 2 / 3 of the verification nodes to elect the leader node, before being replaced by the candidate leader node, can be packaged with any number of data objects and transaction objects, to ensure the unique global sequence in the system.

[0081] Candidate leader node:

[0082] Elected by the verification node, needs to obtain the consent of more than 2 / 3 of the verification nodes to elect the candidate leader node, can maintain the first three candidate leader node set, and vote regularly to refresh; when the leader node is replaced, it starts from the first to replace; the purpose of setting 3 here is to ensure the availability of the candidate leader node.

[0083] Synchronization node:

[0084] Responsible for the data synchronization of the transaction object of the object chain, and ensures a certain number of copies of the data object (such as ensuring that the number of copies is greater than or equal to 3), to ensure the high availability of the data object; needs to be staked to obtain the qualification, and maintains the high availability of the object chain transaction object through the liquidity incentive of the points.

[0085] Verification node:

[0086] Is a subset of the synchronization node, the number of verification nodes can be set as:

[0087] Nv=Max (number of synchronization nodes / 10, min (number of synchronization nodes, 10)) formula 1

[0088] In formula 1, if the number of synchronization nodes is 1, then Nv=1; if the number of synchronization nodes is 20, then Nv=2; if the number of synchronization nodes is 100, then Nv=10; if the number of synchronization nodes is 1000, then Nv=100; the more the number of synchronization nodes, Nv will have a linear growth effect, so that the synchronization nodes that contribute resources to the network have the opportunity to obtain the opportunity to compete for the verification node.

[0089] The synchronization nodes can be selected from a set of synchronization nodes according to scores of the synchronization nodes, the scores being determined according to an amount of data synchronized by the synchronization nodes, an online duration of the synchronization nodes, and an active degree of verification of the synchronization nodes, and the set of verification nodes can be refreshed every 1 epoch (an epoch can be set as a fixed time duration, for example, 24 hours).

[0090] The verification nodes are responsible for verifying a transaction object hash value generated by the leader node, verifying a signature, voting for the leader node / candidate leader node, and the like, and each of the corresponding matters has a time limit, and the verification nodes are required to complete the corresponding matters within the effective time limit; the verification nodes can use GPU for parallel acceleration, so as to accelerate the running speed of the object chain; the verification nodes must be synchronization nodes or leader nodes, and a verification node that is lazy can be punished by deduction of integral points from the staking integral points; an active verification node can obtain higher liquidity integral point incentives.

[0091] The PoS consensus algorithm is based on an integral staking mechanism, quickly confirms a transaction object generated by the leader node, is used for voting and selecting a candidate leader node set, and punishes any misbehaving verification node, eliminates the waste of computing power caused by the block node selected by the PoW consensus algorithm, and realizes high TPS and low latency of the object chain.

[0092] Embodiments of the object chain-based transaction processing method, system, device and storage medium provided by the application will be described below.

[0093] Please refer to Figure 1 , Figure 2 and Figure 3 One embodiment of the object chain-based transaction processing method provided by the application comprises the following steps.

[0094] 101. receiving a user-sent data creation request, and writing corresponding target data into a data object according to the data creation request;

[0095] In actual data creation, the user initiates a data creation request for the object chain smart contract through a visual Web3 portal or an API interface and the like, and the request parameters can include a data field (Data) and a metadata field (MetaData). The smart contract is a program of a smart contract virtual machine fixed on a server of the object chain. Then, the object chain writes the target data into a data object, and the written data can include the Data, MetaData and the like. The data object contains a first hash value of all field concatenations, which is used to establish a mapping with a transaction object during subsequent data transfer.

[0096] Data objects can store data in JSON (JavaScript Object Notation) instead of the binary concatenation format of traditional blockchain, making the meaning of data fields self-explanatory. This allows data objects to store rich data types and formats and gain format extensibility.

[0097] For example, an example of a data object is:

[0098]

[0099] Wherein, ObjectType represents the object type, data indicates that the object type is a data object, and metadata can be in the form of key-value pairs with a custom format;

[0100] For example, for an image format, the MetaData field can be defined as: {"dataType":"jpg","description":"This is a picture about scenery...", "createTime":"2011-11-23 10:09:11","author":"bob and lucy", "location":"Shenzhen, Guangdong Province"};

[0101] For example, a video format can have its MetaData field defined as: {"dataType":"Video","description":"This is a short video taken last Christmas...","length":"1:25","createTime":"2020-12-25 14:20:08","author":"jack","location":"Sanya, Hainan Province"}, where "length":"1:25" indicates that the video length is 1 minute and 25 seconds, which is a special attribute that distinguishes it from non-video files.

[0102] The introduction of MetaData fields allows users to customize various fields of the metadata of data objects, thereby supporting multiple types of object data and gaining data type extensibility.

[0103] Data is a data field that can be expressed in string format.

[0104] DataHash = hash(Data), which is the hash result calculated on the data Data. The hash function can be SHA-128 or Keccak-256, etc. For example:

[0105] e207af9fa2e84493a46cd6572d26153a4d7c2fcde24352818c586eb154583095, represents the data hash value of 256-bit Keccak-256, expressed as 64 hexadecimal characters.

[0106] ObjectTime is the creation time of the data object;

[0107] DataObjectHash represents the hash value of the concatenation of all fields of the data object, represented as the first hash value, whose value is:

[0108] hash(ObjectType value || MetaData value || Data value || DataHash value…|| ObjectTime value), || represents string concatenation, and the hash function can also take algorithms such as SHA-128 or Keccak-256.

[0109] 102. Read the first hash value of the concatenation of all fields in the data object;

[0110] 103. Generate a first transaction object according to the transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value.

[0111] According to the transaction data and the first hash value, a first transaction object is formed, which contains the first hash value, and the first hash value is the hash value of the concatenation of all fields in the data object, so that the first transaction object is mapped to the data object through the first hash value, for example, an example of a first transaction object is:

[0112]

[0113]

[0114] Among them:

[0115] PrevTxObjectHash represents the hash value of the object of the previous transaction, if it is a genesis object (i.e. the first transaction object), it takes all 0 (256 bits), expressed in hexadecimal, which is 64 hexadecimal 0.

[0116] ObjectType represents the object type, Tx represents that the object type is transaction data.

[0117] TxType represents the transaction type, including CreateData, BurnData, TransferData, CastNFT, BurnNFT, TransferNFT, etc. transaction types, and as the transaction types supported by the object chain increase, transaction types can be continuously expanded.

[0118] From represents the username of the transaction initiator, for example 0x00..0 (40 hexadecimal 0 characters), which is a 160-bit hexadecimal character representation of 0 on the user account on the blockchain, i.e. 40 hexadecimal 0s.

[0119] To represents the username of the transaction recipient, for example 0xBF6... represents 0xBF60360552FCB6BaCAF58A9f6aDD50C83337aD0d, a total of 40 hexadecimal characters.

[0120] DataHash represents the DataHash of the data corresponding to the transaction.

[0121] IPFSHash represents the location hash formed by writing the data (Data) corresponding to DataHash into IPFS object storage, indicating the location of data storage, for example:

[0122] QmXMuWUj67Krxd8xoPwpHqkbGVtX3b4GnpM1ZNGaDjdLyQ represents:

[0123] The location on the IPFS storage can be accessed through:

[0124] http: / / ipfs.io / ipfs / QmXMuWUj67Krxd8xoPwpHqkbGVtX3b4GnpM1ZNGaDjdL yQ.

[0125] ReferDataObjectHash represents the hash value of the referenced data object, taken from the first hash value, i.e. DataObjectHash.

[0126] TxObjectHash represents the transaction object hash, whose value = hash(PrevTxObjectHash value || TxType value || From value || To value || DataHash value || IPFSHash value || ReferDataObjectHash value || … || ObjectTime value).

[0127] In this embodiment, the data object and the transaction object are stored in the Json format, the data is self-evident, and the serialization and deserialization of the data are facilitated; meanwhile, the metadata field (MetaData) is introduced in the data object, so that the user can customize each field of the metadata of the data object, thereby supporting various object data and obtaining the expansibility of the data type.

[0128] In the present application, data is divided into two categories: object data and transaction data, the data assets of the user are abstracted as object data, and are stored based on the IPFS chain, and the object data is linked to the transaction object through the first hash value, thereby solving the on-chain storage problem of large object data. In the transaction processing method based on the object chain provided in the present application, after the user initiates a data creation request, the corresponding target data is written into the data object, the data object includes the first hash value of all field concatenations in the data object, the first transaction object is generated according to the transaction data and the first hash value, so as to realize the mapping of the first transaction object to the data object through the first hash value. Through this method, the data assets of the user and the transaction data of the user can be abstracted as data objects and transaction objects, and are linked to each other, thereby solving the on-chain storage problem of large object data. When the target data is transferred, the time sequence problem of the multi-node transaction object is solved through the level of the hash value (i.e., the order of the hash), and the method has the native advantages of being able to simultaneously store massive object data and transaction data on the chain, high TPS, and low fuel cost, thereby providing underlying infrastructure support for Web3 applications and data asset value.

[0129] The method provided in the present application can be applied to the object chain, the object chain can carry multiple types of transactions, for example, the transfer of data assets can be realized through the method. The following will be described taking the transfer of data assets as an example.

[0130] Please refer to Figure 4 and Figure 5 The method provided in the present embodiment includes:

[0131] 401. receiving a data creation request sent by a user, and writing corresponding target data into a data object according to the data creation request;

[0132] 402. reading a first hash value of all field concatenations in the data object;

[0133] 403. generating a first transaction object according to the transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value;

[0134] In this embodiment, steps 401 to 403 are similar to steps 101 to 102 in the foregoing embodiments, and will not be described herein again.

[0135] 404、When receiving the transfer request of the user to the data object, a second transaction object is generated according to the transaction data and the second hash value, the first transaction object contains the second hash value of the concatenation of all fields in the first transaction object, so that the second transaction object is mapped to the first transaction object through the second hash value, and the second transaction object is mapped to the data object through the first hash value.

[0136] In practice, when receiving the transfer request of the user to the data object, a second transaction object is generated, and the process of generating the second transaction object is similar to that of generating the first transaction object. The first transaction object contains the second hash value of the concatenation of all fields in the first transaction object, and the second transaction object is generated according to the second hash value and the data of the current transaction. For example, an example of a second transaction object is as follows:

[0137]

[0138] Wherein, PrevTxObjectHash represents the hash value of the previous transaction object, which is taken from TxObjectHash in the first transaction object, that is, the second hash value, so that the mapping of the second transaction object to the first transaction object is realized through the second hash value. The second transaction object also contains: "ReferDataObjectHash": "1aaa..." which represents the hash value of the concatenation of all fields in the data object referred to by the second transaction object, that is, the first hash value. The mapping between the second transaction object and the data object is realized through the first hash value, and through the hierarchical relationship between the hash values, the time sequence problem of the transaction on the object chain is solved, that is, the tree structure of the Merkle tree is changed into the link relationship of the block chain.

[0139] In actual creation and transfer of data, consideration needs to be given to the abnormal handling of duplicate target data, so it is necessary to determine whether there is duplicate data, which will be illustrated below.

[0140] Please refer to Figure 6 The method provided by the embodiment comprises the following steps:

[0141] 601、Receiving a user-sent creation data request;

[0142] 602、According to the creation data request, a hash value of a data field corresponding to the target data is generated;

[0143] 603、The hash value of the data field is compared with the hash value of the existing data field. If there is no duplicate hash value, step 604 is executed, and if there is a duplicate, step 610 is executed;

[0144] 604、It is determined that there is no data duplicated with the target data;

[0145] For example, by calculating the hash of the Data field, DataHash is formed, and the existing DataHash set is compared to determine whether it is a duplicate DataHash. If there is a duplicate DataHash, it is considered that there is data duplicated with the target data. If there is no duplicate DataHash, it is determined that there is no data duplicated with the target data, and then the data object can be written. If there is duplicate data, return user error information and end the process.

[0146] 605、According to the creation data request, the corresponding target data is written into the data object;

[0147] 606、Read the first hash value of all field concatenations in the data object;

[0148] 607、According to the transaction data and the first hash value, generate the first transaction object, so that the first transaction object is mapped to the data object through the first hash value.

[0149] 608、When receiving a user transfer data object transfer request, determine whether the first hash value exists. If it exists, execute step 609. If it does not exist, execute step 610.

[0150] For example, determine whether ReferDataObjectHash exists. According to DataHash, IPFSHash, determine whether ReferDataObjectHash exists. If it exists, it means that the data object to be transferred exists, and the transaction can continue. If it does not exist, return user error information and end the process.

[0151] 609、According to the transaction data and the second hash value, generate the second transaction object;

[0152] 610、Return error information and end the process.

[0153] Return user error information and end the process.

[0154] The method provided in the application can also be applied to other various types of data asset transactions, for example: destroying data, creating NFT, transferring NFT, and destroying NFT will create corresponding types of transaction objects; when creating NFT, it is necessary to determine whether the NFT is duplicated and perform the corresponding exception handling process; destroying data, transferring NFT, and destroying NFT also need to determine whether the processed data / NFT exists, and perform the corresponding exception handling process.

[0155] The above embodiments describe the object chain-based transaction processing method provided in the application. The system, device, and computer readable storage medium provided in the application will be described below.

[0156] Referring to Figure 8 , Figure 8 For an embodiment structure diagram of the transaction processing system based on the object chain provided in the present application, the embodiment includes:

[0157] The receiving unit 801 is configured to receive a user-sent data creation request;

[0158] The writing unit 802 is configured to write corresponding target data into a data object according to the data creation request;

[0159] The reading unit 803 is configured to read a first hash value of all field concatenations in the data object;

[0160] The first generating unit 804 is configured to generate a first transaction object according to the current transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value; and generate a second hash value.

[0161] Optionally, the system further includes a second generating unit 805, configured to:

[0162] When receiving a user-sent data object transfer request, generate a second transaction object according to the current transaction data and the second hash value, so that the second transaction object is mapped to the first transaction object through the second hash value, and the second transaction object is mapped to the data object through the first hash value.

[0163] Optionally, the writing unit 802 is specifically configured to:

[0164] Generate an object type according to the data creation request;

[0165] Generate metadata in the form of key, value pairs;

[0166] Generate data fields of the target data in the form of strings (string);

[0167] Generate hash values of the data fields;

[0168] Generate hash values of storage locations according to storage locations of the target data;

[0169] Generate a first hash value of concatenations of all fields;

[0170] Generate the data object in the format of object score JSON according to the information generated above.

[0171] Optionally, the first generating unit 804 is specifically configured to:

[0172] Obtain a hash value of a previous transaction object;

[0173] Obtaining a transaction data object type;

[0174] Obtaining a transaction type;

[0175] Obtaining a username of a transaction initiator;

[0176] Obtaining a username of a transaction receiver;

[0177] Obtaining a hash value of a data field of target data from a data object;

[0178] Obtaining a hash value of a storage location of target data from a data object;

[0179] Generating a transaction creation time;

[0180] Generating a hash value of the current transaction object, i.e., a second hash value;

[0181] Generating, in a JSON format, a first transaction object according to the information obtained or generated above.

[0182] Optionally, the writing unit 802 is specifically configured to:

[0183] determine, according to the data creation request, that there is no data duplicated with the corresponding target data, and write the target data into the data object.

[0184] Optionally, the writing unit 802 is specifically configured to:

[0185] generating, according to the data creation request, a hash value of a data field of the corresponding target data;

[0186] comparing the hash value of the data field with hash values of existing data fields;

[0187] if there is no duplicated hash value, determining that there is no data duplicated with the target data.

[0188] Optionally, the receiving unit 801 is specifically configured to:

[0189] receiving a data creation request initiated by a user through a Web3 visual interface or an API interface.

[0190] Optionally, the second generating unit 805 is specifically configured to:

[0191] obtaining a hash value of a previous transaction object;

[0192] obtaining a transaction data object type;

[0193] obtaining a transaction type;

[0194] obtaining a username of a transaction initiator;

[0195] obtaining a username of a transaction receiver;

[0196] obtaining a hash value of a data field of the target data from the first transaction object;

[0197] obtaining a hash value of a storage location of the target data from the first transaction object;

[0198] generating a transaction creation time;

[0199] generating a hash value of the current transaction object;

[0200] generating a second transaction object in a JSON format according to the information obtained or generated above.

[0201] Referring to Figure 9 The application further provides a transaction processing device based on an object chain, comprising:

[0202] a processor 901, a memory 902, an input output unit 903, and a bus 904;

[0203] The processor 901 is connected with the memory 902, the input output unit 903, and the bus 904;

[0204] The memory 902 stores a program, and the processor 901 invokes the program to execute any one of the above transaction processing methods based on an object chain.

[0205] The application further relates to a computer readable storage medium, and the computer readable storage medium stores a program, and the program is characterized in that, when the program runs on a computer, the program causes the computer to execute any one of the above transaction processing methods based on an object chain.

[0206] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, and will not be described here.

[0207] In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are merely schematic, for example, the division of the units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.

[0208] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0209] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present alone, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0210] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical scheme of the present application essentially or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, read-only memory), a random access memory (RAM, random access memory), a magnetic disk or an optical disk, and various program code storage media.

Claims

1. A transaction processing method based on object chain, characterized by, The method comprises: receiving a user-sent data creation request and writing corresponding target data into a data object according to the data creation request; reading a first hash value of concatenation of all fields in the data object; generating a first transaction object according to transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value; the first transaction object contains a second hash value of concatenation of all fields in the first transaction object; after the first transaction object is generated according to the transaction data and the first hash value, the method further comprises: after receiving a user-sent transfer request of the data object, generating a second transaction object according to transaction data and the second hash value, so that the second transaction object is mapped to the first transaction object through the second hash value, and the second transaction object is mapped to the data object through the first hash value; the writing of the corresponding target data into the data object according to the data creation request comprises: generating an object type according to the data creation request; generating metadata in the form of key, value pairs; generating data fields of the target data in the form of a string string; generating a hash value of the data fields; generating a hash value of a storage location according to a storage location of the target data; generating a first hash value of concatenation of all fields; generating a data object in the format of an object score JSON according to the generated information.

2. The object chain-based transaction processing method according to claim 1, wherein The generation of the first transaction object according to the transaction data and the first hash value comprises: obtaining a hash value of a previous transaction object; obtaining a transaction data object type; obtaining a transaction type; obtaining a username of a transaction initiator; obtaining a username of a transaction receiver; obtaining a hash value of the data fields of the target data from the data object; obtaining a hash value of the storage location of the target data from the data object; generating a transaction creation time; generating a first transaction object in the format of JSON according to the obtained or generated information.

3. The object chain-based transaction processing method according to claim 1, wherein The writing of the corresponding target data into the data object according to the data creation request comprises: determining that there is no duplicate data with the corresponding target data according to the data creation request, and writing the target data into the data object.

4. The object chain-based transaction processing method according to claim 3, wherein The determination that there is no duplicate data with the target data according to the data creation request comprises: generating a hash value of the data fields of the corresponding target data according to the data creation request; comparing the hash value of the data fields with hash values of existing data fields; if there is no duplicate hash value, it is determined that there is no duplicate data with the target data.

5. The object chain-based transaction processing method according to claim 1, wherein The receiving of the user-sent data creation request comprises: receiving a data creation request initiated by a user through a Web3 visual interface or an API interface.

6. The object chain-based transaction processing method according to claim 1, wherein The generation of the second transaction object according to the transaction data and the second hash value comprises: obtaining a hash value of a previous transaction object; obtaining a transaction data object type; obtaining a transaction type; obtaining a username of a transaction initiator; obtaining a username of a transaction receiver; obtaining a hash value of the data fields of the target data from the first transaction object; obtaining a hash value of a storage location of the target data from the first transaction object; generating a transaction creation time; generating a second transaction object in a JSON format according to the above-obtained or generated information.

7. The object chain-based transaction processing method according to any one of claims 1 to 6, characterized by, The method is applied to an object chain, a structure of the object chain adopts a PoS algorithm, and nodes of the object chain are composed of a leader node, a candidate leader node, a synchronization node, and a verification node.

8. The object chain-based transaction processing method according to claim 7, wherein The leader node is established by voting of the verification node, and the leader node is used for packaging data; the candidate leader node is established by voting of the verification node, and the candidate leader node is used for succeeding to the leader node; and the synchronization node is used for synchronizing data on the object chain. The verification node belongs to a subset of the synchronization node.

9. A transaction processing system based on object chains, characterized by The system is used for executing the method in any one of claims 1 to 8, and the system comprises: a receiving unit configured to receive a data creation request sent by a user; a writing unit configured to write corresponding target data into a data object according to the data creation request; a reading unit configured to read a first hash value of all field concatenations in the data object; a first generating unit configured to generate a first transaction object according to transaction data and the first hash value, so that the first transaction object is mapped to the data object through the first hash value.

10. A transaction processing apparatus based on an object chain, characterized by comprising: The device comprises: a processor, a memory, an input / output unit, and a bus; the processor is connected with the memory, the input / output unit, and the bus; the memory stores a program, and the processor invokes the program to execute the method in any one of claims 1 to 8. 11.A computer readable storage medium, the computer readable storage medium stores a program, and the program executes the method in any one of claims 1 to 8 when executed on a computer.

Citation Information

Patent Citations

  • Data processing method, device, node equipment and storage medium

    CN111639080A