A transaction storage method, device and computer readable storage medium
By constructing transaction blocks and setting keys, the flexibility and security issues of blockchain storage methods in Web3.0 are solved, enabling diversified transaction storage and security verification, suitable for data sharing and private storage in Web3.0.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-14
- Publication Date
- 2026-03-03
AI Technical Summary
Existing blockchain storage methods have limitations in data sharing scenarios, cannot adapt to the diverse needs of Web3.0, and have limited transaction types, lacking flexibility and security.
By constructing transaction structure features and types to create transaction blocks and setting transaction keys, combined with a binary tree storage structure, a closed loop of transaction structure, blocks, and links is formed, realizing multi-block storage and security verification.
It enables flexible storage to adapt to various transaction types, ensures transaction security, is suitable for diverse application scenarios of Web 3.0, and supports data sharing and private storage.
Smart Images

Figure CN118445856B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage, and more particularly to a transaction storage method, apparatus, and a computationally readable storage medium. Background Technology
[0002] Blockchain technology, due to its tamper-proof and decentralized characteristics, has been widely used in the field of storage encryption. However, current methods primarily realize block value on the blockchain, that is, by encrypting and binding data through encryption features or unique characteristics of blocks to achieve tamper-proofing. But this approach is generally limited in its application scenarios and the types of transactions it can handle are also relatively limited.
[0003] With the widespread adoption of Web 3.0, its focus is on data sharing, particularly cloud-to-cloud data sharing, making it suitable for various application scenarios. However, simply using existing block storage and encryption methods is not well-suited to the development and application of Web 3.0. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a transaction storage method, device and computer-readable storage medium that can flexibly apply to various transaction types and ensure transaction security, and is well applicable to various application scenarios of Web3.0.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A transaction storage method includes the following steps:
[0007] Receive a transaction creation request, the transaction creation request including transaction structure characteristics and transaction type;
[0008] Construct a corresponding transaction structure based on the transaction structure characteristics and transaction type, create a corresponding transaction block, and store the transaction structure in the transaction block;
[0009] Receive a transaction key setting request, wherein the transaction key setting request includes transaction key characteristics;
[0010] A corresponding key is set for the transaction block according to the transaction key characteristics, and the key is stored in the transaction block.
[0011] Furthermore, the transaction block also stores transaction links;
[0012] The process after receiving a transaction creation request also includes the following steps:
[0013] Assign corresponding link member identifiers according to the transaction structure characteristics and transaction type, and add the link member identifiers to the transaction link;
[0014] The transaction link is directed to the transaction structure corresponding to the link member identifier based on the link member identifier.
[0015] Furthermore, it also includes the following steps:
[0016] Receive a transaction setting request, the transaction setting request including transaction status and transaction characteristics;
[0017] The transaction details and characteristics are stored in the transaction block.
[0018] Furthermore, it also includes the following steps:
[0019] Receive a transaction status submission request, wherein the transaction status submission request includes the target transaction structure characteristics, target transaction type, and target transaction key corresponding to the transaction status;
[0020] Match the corresponding transaction block according to the target transaction structure characteristics and target transaction type, and search for the corresponding matching transaction key in the transaction block;
[0021] Determine whether the target transaction key is the same as the matching transaction key. If so, store the transaction information corresponding to the transaction status submission request in the corresponding transaction block. If not, create a new transaction block and store the target transaction key and the transaction information corresponding to the transaction status submission request in the new transaction block.
[0022] Furthermore, it also includes the following steps:
[0023] Receive a transaction link lookup request, the transaction link lookup request including a link member identifier;
[0024] The transaction link to which the member belongs is searched and located based on the link member identifier.
[0025] Furthermore, the transaction structure features are stored in base64.
[0026] Furthermore, the transaction structure, transaction blocks, and transaction links are all stored in the form of a binary tree.
[0027] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0028] A transaction storage device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the transaction storage method described above.
[0029] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0030] A computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the steps of the transaction storage method described above.
[0031] The beneficial effects of this invention are as follows: It constructs a corresponding transaction structure based on a transaction creation request containing transaction structure characteristics and transaction type, creates a corresponding transaction block, stores the transaction structure in the transaction block, and simultaneously sets a corresponding key for the transaction block based on the transaction key characteristics in the transaction key setting request, and stores the key in the transaction block. On the one hand, it allows for flexible setting of various different transaction types and the creation of corresponding transaction modules to store transactions with corresponding structures, achieving multi-block storage of different types of transactions. On the other hand, after creating a transaction block corresponding to the transaction structure, setting a corresponding key and storing it in the transaction block effectively verifies the security of the transaction and increases the security of transaction storage. Therefore, it can flexibly apply to various transaction types while ensuring transaction security, making it well-suited for various application scenarios of Web 3.0. Attached Figure Description
[0032] Figure 1 This is a flowchart illustrating the steps of a transaction storage method according to an embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of the structure of a transaction storage device according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the structure of a transaction constructed according to an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram illustrating the relationship between the transaction structure, transaction block, and transaction link in an embodiment of the present invention.
[0036] Figure 5 This is a schematic diagram illustrating the binary tree storage of transactions according to an embodiment of the present invention. Detailed Implementation
[0037] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0038] The transaction storage method, apparatus, and computer-readable storage medium described in this application are applicable to scenarios requiring various types of transaction storage, and are particularly suitable for various Web 3.0 application scenarios. The following detailed embodiments illustrate these applications:
[0039] In one alternative implementation, such as Figure 1 As shown, a transaction storage method includes the following steps:
[0040] S1. Receive a transaction creation request, wherein the transaction creation request includes transaction structure characteristics and transaction type;
[0041] S2. Construct a corresponding transaction structure based on the transaction structure characteristics and transaction type, create a corresponding transaction block, and store the transaction structure in the transaction block;
[0042] The transaction structure features are stored in base64 format; storing them in base64 format creates a tag that facilitates searching for the structure features.
[0043] Users can flexibly configure transaction types, which include, but are not limited to: a piece of data, a file, a key, a transaction note, etc.
[0044] A transaction block corresponds to the formed transaction structure; a corresponding transaction block is created and stored for each transaction structure constructed.
[0045] S3. Receive a transaction key setting request, wherein the transaction key setting request includes transaction key characteristics;
[0046] S4. Set a corresponding key for the transaction block according to the transaction key characteristics, and store the key in the transaction block;
[0047] By storing keys in transaction blocks, it can be ensured that the transaction content stored in the transaction block is protected by the keys. Whether the corresponding transaction key needs to be decrypted to see the corresponding transaction content is specifically set by the transaction setter.
[0048] The transaction block also stores transaction links;
[0049] The process after receiving a transaction creation request also includes the following steps:
[0050] Assign corresponding link member identifiers according to the transaction structure characteristics and transaction type, and add the link member identifiers to the transaction link;
[0051] The transaction link is directed to the transaction structure corresponding to the link member identifier based on the link member identifier.
[0052] Once a user sets their transaction structure characteristics and transaction type, they become a member of the transaction chain. At this point, a corresponding chain member identifier is assigned to the user and added to the transaction chain. Simultaneously, the transaction chain points to the transaction structure corresponding to the chain member identifier, as shown below. Figures 3-4 As shown, the transaction structure, transaction blocks, and transaction links correspond to each other, forming a closed loop;
[0053] For example, if a user sets the transaction structure characteristics to: file storage; and the transaction type to: file, the system will create a transaction block to store the transaction structure. At the same time, it will check whether the user has set the transaction key characteristics. If not, the corresponding transaction key characteristics will be none. Furthermore, a link member identifier will be assigned to the user and stored in the transaction link. The transaction link will point to the transaction structure set by the user, thus forming a closed loop of storage file - file block - file link.
[0054] In this embodiment, such as Figure 5 As shown, the transaction structure, transaction blocks, and transaction links are all stored in the form of a binary tree.
[0055] In another alternative implementation, the following steps are also included:
[0056] Receive a transaction setting request, the transaction setting request including transaction status and transaction characteristics;
[0057] The transaction details and characteristics are stored in the transaction block;
[0058] like Figure 3 As shown, transaction status refers to the current execution or storage status of a transaction; transaction characteristics refer to transaction characteristic attributes, such as: file attributes such as importance or urgency;
[0059] If a user sets a corresponding key, then when other users want to access the transactions set by that user, they will need the correct key to decrypt before access is allowed. For example:
[0060] When a user needs to access a transaction to complete a task / download / install, they need to know the transaction structure characteristics and transaction key characteristics; otherwise, they can only know the transaction structure characteristics and transaction link members. Specific scenarios are explained below:
[0061] Xiaohong, the task dispatcher: Transaction structure: meeting content; Transaction type: meeting; Transaction status: pending report, needs to be organized; Transaction characteristics: urgent;
[0062] When Xiao Dong accesses the transaction, he only knows the transaction structure and link members. He needs to ask Xiao Hong for the transaction key in order to see the transaction information and characteristics stored in the transaction block.
[0063] In another alternative implementation, the following steps are also included:
[0064] Receive a transaction status submission request, wherein the transaction status submission request includes the target transaction structure characteristics, target transaction type, and target transaction key corresponding to the transaction status;
[0065] Match the corresponding transaction block according to the target transaction structure characteristics and target transaction type, and search for the corresponding matching transaction key in the transaction block;
[0066] Determine whether the target transaction key is the same as the matching transaction key. If so, store the transaction information corresponding to the transaction status submission request in the corresponding transaction block. If not, create a new transaction block and store the target transaction key and the transaction information corresponding to the transaction status submission request in the new transaction block.
[0067] For example, if Xiao Dong needs to submit the information he has, he needs to provide the transaction structure characteristics: meeting content; transaction type: meeting and corresponding transaction key characteristics.
[0068] If the keys do not match, a new transaction block is created to store the key characteristics and the information to be committed. If they match, a binary tree is added to the transaction status in the transaction block to add the information to be committed, forming a record. The transaction status displays the overall transaction status, and the specific status is formed by small branches (binary trees). That is, if the keys are the same, it means that the link is reliable; otherwise, a new transaction block is created to store its corresponding information.
[0069] In this implementation, unlike the traditional approach of directly rejecting data mismatches, a mismatch simply means that the corresponding transaction cannot be joined, but it does not affect joining the blockchain. At this time, a new transaction block is generated to store the information to be submitted by the user. That is, the characteristic of the transaction block pool in this implementation is that access is possible when the data matches, and a new transaction block is added on the node when the data does not match. This realizes both data sharing on the link (when the key matches) and data isolation on the link (when the key does not match, the information is kept private), which can be applied to various application scenarios.
[0070] In another alternative implementation, the following steps are also included:
[0071] Receive a transaction link lookup request, the transaction link lookup request including a link member identifier;
[0072] The transaction link to which the member belongs is searched and located based on the link member identifier;
[0073] In this embodiment, users can search for and find their own transaction links based on the link member identifier.
[0074] In another alternative implementation, such as Figure 2As shown, a transaction storage device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a transaction storage method described in any of the above embodiments.
[0075] In another alternative embodiment, a computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the steps of a transaction storage method described in any of the above embodiments.
[0076] In summary, the transaction storage method, apparatus, and computer-readable storage medium provided by this invention construct a corresponding transaction structure based on a transaction creation request containing transaction structure features and transaction type, create a corresponding transaction block, store the transaction structure in the transaction block, and simultaneously set a corresponding key for the transaction block according to the transaction key features in the transaction key setting request, and store the key in the transaction block. Furthermore, once the transaction structure features and transaction type are set, a link member identifier is assigned to the user, stored in the transaction link, and the transaction link points to the transaction structure corresponding to the link member identifier. Thus, the transaction structure, transaction block, and transaction link form a closed loop. The system allows for flexible configuration of various transaction types and the creation of corresponding transaction modules to store transactions with the corresponding structures. This enables multi-block storage of different types of transactions. Furthermore, after creating a transaction block corresponding to the transaction structure, a corresponding key is set and stored within the transaction block. This effectively verifies the security of the transaction and increases the security of transaction storage. Simultaneously, when data is submitted, if the key does not match, access is not directly denied. Instead, a new transaction block is created to store the data to be submitted. This achieves both data sharing and data isolation on the link. Therefore, it can flexibly apply various transaction types while ensuring transaction security, making it well-suited for various Web3.0 application scenarios.
[0077] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A transaction storage method characterized by comprising: The method comprises the steps of: receiving a transaction creation request, the transaction creation request comprising transaction structure features and a transaction type; constructing a corresponding transaction structure according to the transaction structure features and the transaction type, and creating a corresponding transaction block, and storing the transaction structure in the transaction block; receiving a transaction key setting request, the transaction key setting request comprising transaction key features; setting a corresponding key for the transaction block according to the transaction key features, and storing the key in the transaction block; the transaction block further stores a transaction link; after receiving the transaction creation request, the method further comprises the steps of: allocating a corresponding link member identifier according to the transaction structure features and the transaction type, and adding the link member identifier to the transaction link; pointing the transaction link to the transaction structure corresponding to the link member identifier according to the link member identifier; receiving a transaction setting request, the transaction setting request comprising transaction conditions and transaction features; storing the transaction conditions and the transaction features in the transaction block; receiving a transaction condition submission request, the transaction condition submission request comprising target transaction structure features and a target transaction type corresponding to the transaction conditions, and a target transaction key; matching a corresponding transaction block according to the target transaction structure features and the target transaction type, and searching for a corresponding matching transaction key in the transaction block; judging whether the target transaction key is the same as the matching transaction key, if yes, storing the transaction conditions corresponding to the transaction condition submission request in the corresponding transaction block, if not, creating a new transaction block, and storing the target transaction key and the transaction conditions corresponding to the transaction condition submission request in the new transaction block.
2. The method of claim 1, wherein, the method further comprises the steps of: receiving a transaction link search request, the transaction link search request comprising a link member identifier; searching for and finding the transaction link where the link member identifier is located according to the link member identifier.
3. The method of claim 1 or 2, wherein, The transaction structure features are stored in base64.
4. The method of claim 1 or 2, wherein, The transaction structure, the transaction block and the transaction link are stored in the form of a binary tree.
5. A transaction storage apparatus comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the transaction storage method according to any one of claims 1 to 4.
6. A computer-readable storage medium having stored thereon computer program instructions, wherein, The computer program instructions are executed by the processor to realize the steps of the transaction storage method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Block generation method, block chain ecosystem, and computer readable storage medium
CN109088914A
Medical data sharing method and device based on blockchain, equipment and storage medium
CN112948853A