A data storage system and data storage method based on blockchain
By designing the data storage mechanism of the main node, management node and image node on the blockchain, the security problem of user data storage on the blockchain is solved, the secure storage of user data and image is realized, and user privacy and rights are protected.
Patent Information
- Application Number
- CN202210731198.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-24
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2042-06-24
AI Technical Summary
The issue of how user data accumulated on blockchain is stored securely to protect user rights and privacy. The traditional Internet lacks the autonomy of personal data, resulting in the abuse of user data.
A blockchain-based data storage system is designed, including the main node, the management node and the image node. Through the storage mechanism of user data and the user image, the safe storage of user data is realized. The main node receives user data and querys the management node. If the corresponding relationship table does not exist, a new node will be created and associated, the management node will store user data, and the portrait node will store user images to ensure the security of data and images.
It realizes secure storage of user data, protects user privacy and rights, avoids data abuse, and enhances user data autonomy and privacy protection.
Smart Images

Figure CN114996277B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data storage system and a data storage method based on blockchain. Background Art
[0002] With the development of Web3.0 (the next generation of the Internet, which is used to summarize the various directions and characteristics that may appear at a certain stage in the development of the Internet, including the transformation of the Internet itself into a generic database), more and more users are engaged in social activities, distributed finance, metaverse, games and other activities on the blockchain, which has accumulated a large amount of user data on the blockchain. How to store this user data to protect the rights and privacy of users has become an urgent problem to be solved. Summary of the invention
[0003] The purpose of the embodiment of the present invention is to provide a data storage system and data storage method based on blockchain to achieve secure storage of user data. The specific technical solution is as follows:
[0004] In a first aspect, an embodiment of the present invention provides a data storage system based on blockchain, the data storage system comprising: a master node, a portrait node and a plurality of management nodes, the portrait node corresponds to a portrait blockchain, the portrait blockchain comprises at least one user portrait node, one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain;
[0005] The master node is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain; query whether the target user identifier exists in the correspondence table between management nodes and user identifiers, and if the target user identifier does not exist in the correspondence table between management nodes and user identifiers, create a new management node, associate the new management node with the target user identifier, add the correspondence between the new management node and the target user identifier to the correspondence table between management nodes and user identifiers, and send the user data to the new management node; and generate a user portrait corresponding to the user data based on the user data, and send the user portrait to the portrait node;
[0006] The management node is used to receive the user data, create a new user node, establish a new chain head node under the new user node, establish a new data head node under the new chain head node, and establish a new data node under the new data head node, and store the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0007] The portrait node is used to receive the user portrait, which includes the target user identifier; query whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node.
[0008] Optionally, the master node is further configured to determine a target management node corresponding to the target user identifier, and send the user data to the target management node if the target user identifier exists in the corresponding relationship table between the management nodes and user identifiers;
[0009] The management node is also used to receive the user data, query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node, and if so, store the user data in the chain head node corresponding to the target business blockchain identifier; if not, establish a new chain head node under the target user node and store the user data in the new chain head node.
[0010] Optionally, the management node establishes a new chain head node under the target user node, and stores the user data in the new chain head node, including:
[0011] The management node establishes a new chain head node under the target user node, associates the new chain head node with the target business blockchain identifier, and adds the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier; establishes a new data header node under the new chain head node, and establishes a new data node under the new data header node, and stores the user data in the new data node.
[0012] Optionally, the management node stores the user data in a chain head node corresponding to the target business blockchain identifier, including:
[0013] Based on the target block identifier, the management node queries whether the target block identifier exists in the correspondence table between the data header node and the block identifier of the target chain head node corresponding to the target business blockchain identifier. If not, a new data header node is established under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier, and a new data node is established under the new data header node, and the user data is stored in the new data node; if it exists, the user data is stored in the target data header node corresponding to the target block identifier.
[0014] Optionally, the management node stores the user data in the target data head node corresponding to the target block identifier, including: sending a confirmation request to the master node for confirming whether to store the user data, and upon receiving confirmation information fed back by the master node, establishing a new data node under the target data head node, and storing the user data in the new data node; upon receiving data discard information fed back by the master node, discarding the user data;
[0015] The master node is further configured to receive the confirmation request sent by the management node, generate a random number and generate a summary according to the activity content in the user data, select a random number of selected management nodes from all the management nodes, and send the summary to each of the selected management nodes; receive the characteristic value sent by each of the selected management nodes, and send confirmation information to the management node if the minimum characteristic value among the characteristic values is not less than a preset threshold, otherwise, send data discard information to the management node;
[0016] The management node is further used to receive the summary sent by the master node, perform feature recognition on the summary, obtain a feature value corresponding to the summary, and send the feature value to the master node, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics.
[0017] Optionally, the portrait node is also used to establish a new linked list node under the target user portrait node corresponding to the target user identifier when the target user identifier is found in the correspondence table between the user portrait node and the user identifier, and store the user portrait in the new linked list node.
[0018] Optionally, the master node generates a user portrait corresponding to the user data based on the user data, including:
[0019] The master node receives a user data acquisition request, wherein the user data acquisition request includes a designated user identifier of a designated user, a designated business blockchain identifier, and a designated block identifier; determines the designated management node corresponding to the user data acquisition request according to the designated user identifier and a correspondence table between management nodes and user identifiers in the master node; determines the designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and a correspondence table between a chain head node and a business blockchain identifier of a designated user node of the designated management node; determines the designated data head node corresponding to the user data acquisition request according to the designated block identifier and a correspondence table between a data head node and a block identifier of the designated chain head node; reads designated user data corresponding to the user data acquisition request from the designated data head node, wherein the designated user data includes information of the designated user; determines a category of the designated user according to the information of the designated user; clusters the user data of all users under the category to determine a portrait dimension of the designated user; and generates a user portrait of the designated user based on the designated user data and the portrait dimension.
[0020] Optionally, the main node is also used to: obtain a use request from the first user for a designated user portrait, the use request including: a second user identifier of a second user corresponding to the designated user portrait; based on the second user identifier, query a correspondence table between user portrait nodes and user identifiers in a portrait node to determine a designated user portrait node corresponding to the second user identifier, wherein the designated user portrait node contains information about the second user; based on the information about the second user, send a request to the second user for the designated user portrait to be used; upon receiving an authorization message fed back from the second user, read the designated user portrait in the designated user portrait node of the portrait node, and feed back the designated user portrait to the first user; upon receiving an unauthorized message fed back from the second user, feed back information about unauthorized use to the first user.
[0021] In a second aspect, an embodiment of the present invention provides a data storage method based on blockchain, which is applied to a master node of a data storage system, wherein the data storage system further includes a portrait node and a plurality of management nodes, wherein the portrait node corresponds to a portrait blockchain, wherein the portrait blockchain includes at least one user portrait node, wherein one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain; the method includes:
[0022] Receiving user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain;
[0023] Query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier;
[0024] If the target user identifier does not exist in the correspondence table between the management node and the user identifier, create a new management node, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the correspondence table between the management node and the user identifier;
[0025] Send the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0026] Based on the user data, generating a user portrait corresponding to the user data, wherein the user portrait includes the target user identifier;
[0027] The user portrait is sent to the portrait node so that the portrait node queries whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0028] Optionally, the method further comprises:
[0029] In the case where the target user identifier exists in the correspondence table between the management node and the user identifier, the target management node corresponding to the target user identifier is determined, and the user data is sent to the target management node, so that the target management node queries whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the target management node, and if so, stores the user data in the chain head node corresponding to the target business blockchain identifier; if not, establishes a new chain head node under the target user node and stores the user data in the new chain head node.
[0030] Optionally, the method further comprises:
[0031] receiving a confirmation request sent by the management node, wherein the confirmation request is used to confirm whether to store the user data;
[0032] Generate a random number and generate a summary according to the activity content in the user data, and select a random number of selected management nodes from all management nodes;
[0033] Sending the summary to each of the selected management nodes so that the selected management node performs feature recognition on the summary, obtains a feature value corresponding to the summary, and feeds back the feature value to the master node, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics;
[0034] Receiving characteristic values sent by each of the selected management nodes;
[0035] When the minimum characteristic value among the characteristic values is not less than a preset threshold, confirmation information is sent to the management node so that the management node stores the user data; otherwise, data discard information is sent to the management node so that the management node discards the user data.
[0036] Optionally, generating a user portrait corresponding to the user data based on the user data includes:
[0037] Receive a user data acquisition request, wherein the user data acquisition request includes a specified user identifier of a specified user, a specified business blockchain identifier, and a specified block identifier;
[0038] Determine the designated management node corresponding to the user data acquisition request according to the designated user identifier and the correspondence table between the management node and the user identifier in the master node;
[0039] Determine the designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and the correspondence table between the chain head node of the designated user node of the designated management node and the business blockchain identifier;
[0040] Determine the designated data header node corresponding to the user data acquisition request according to the designated block identifier and the correspondence table between the data header node of the designated chain head node and the block identifier;
[0041] Reading designated user data corresponding to the user data acquisition request from the designated data header node, wherein the designated user data includes information of a designated user;
[0042] Determine the category of the designated user according to the information of the designated user;
[0043] Clustering the user data of all users under the category to determine the portrait dimension of the designated user;
[0044] Based on the designated user data and the portrait dimension, a user portrait of the designated user is generated.
[0045] Optionally, the method further comprises:
[0046] Obtaining a use request of the first user for the specified user portrait, wherein the use request includes: a second user identifier of a second user corresponding to the specified user portrait;
[0047] According to the second user identifier, query the corresponding relationship table between the user portrait node and the user identifier in the portrait node to determine the designated user portrait node corresponding to the second user identifier, wherein the designated user portrait node contains information about the second user;
[0048] Sending a request to the second user to specify that the user portrait is to be used according to the information of the second user;
[0049] Upon receiving the authorization message fed back by the second user, reading the designated user portrait in the designated user portrait node of the portrait node, and feeding back the designated user portrait to the first user;
[0050] When receiving the unauthorized message fed back by the second user, the unauthorized use information is fed back to the first user.
[0051] In a third aspect, an embodiment of the present invention provides a data storage method based on blockchain, which is applied to a management node of a data storage system, wherein the data storage system also includes a master node, one management node is connected to one user node, and one user node is connected to at least one data blockchain; the method includes:
[0052] Receive user data generated by the business blockchain sent by the master node, wherein the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier;
[0053] Create a new user node;
[0054] Establishing a new chain head node under the new user node;
[0055] Establishing a new data head node under the new chain head node;
[0056] Establishing a new data node under the new data head node, and storing the user data in the new data node;
[0057] Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier, the new data header node records the information of the target block, the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0058] Optionally, the method further comprises:
[0059] Query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node;
[0060] If it exists, the user data is stored in the chain head node corresponding to the target business blockchain identifier;
[0061] If it does not exist, a new chain head node is established under the target user node, and the user data is stored in the new chain head node.
[0062] Optionally, establishing a new chain head node under the target user node and storing the user data in the new chain head node includes:
[0063] Establish a new chain head node under the target user node, associate the new chain head node with the target business blockchain identifier, and add the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier;
[0064] Establishing a new data head node under the new chain head node;
[0065] A new data node is established under the new data head node, and the user data is stored in the new data node.
[0066] Optionally, storing the user data in a chain head node corresponding to the target business blockchain identifier includes:
[0067] Based on the target block identifier, query whether the target block identifier exists in the corresponding relationship table between the data head node and the block identifier of the target chain head node corresponding to the target business blockchain identifier;
[0068] If it does not exist, a new data header node is established under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier, and a new data node is established under the new data header node, and the user data is stored in the new data node;
[0069] If it exists, the user data is stored in the target data header node corresponding to the target block identifier.
[0070] Optionally, storing the user data in a target data header node corresponding to the target block identifier includes:
[0071] Sending a confirmation request to the master node for confirming whether to store the user data, so that the master node generates a random number and generates a summary according to the activity content in the user data, selects a random number of selected management nodes from all management nodes, and sends the summary to each of the selected management nodes;
[0072] Receiving the summary sent by the master node;
[0073] Performing feature recognition on the summary to obtain a feature value corresponding to the summary, wherein the feature value is used to indicate the degree to which the user data can characterize user behavior characteristics;
[0074] Sending the characteristic value to the master node, so that the master node sends confirmation information to the management node when the minimum characteristic value among the characteristic values is not less than a preset threshold value, otherwise, sends data discard information to the management node;
[0075] Upon receiving the confirmation information fed back by the master node, a new data node is established under the target data head node, and the user data is stored in the new data node;
[0076] When receiving the data discarding information fed back by the master node, the user data is discarded.
[0077] In a fourth aspect, an embodiment of the present invention provides a data storage method based on blockchain, which is applied to a portrait node of a data storage system, wherein the data storage system also includes a master node, the portrait node corresponds to a portrait blockchain, and the portrait blockchain includes at least one user portrait node, and one user portrait node corresponds to one user; the method includes:
[0078] Receive a user profile sent by the master node, wherein the user profile includes the target user identifier;
[0079] Query whether the target user ID exists in the corresponding relationship table between user portrait nodes and user IDs;
[0080] If it does not exist, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node;
[0081] If it exists, a new linked list node is created under the target user portrait node corresponding to the target user identifier, and the user portrait is stored in the new linked list node.
[0082] In a fifth aspect, an embodiment of the present invention provides a blockchain-based data storage device, which is applied to a master node of a data storage system, wherein the data storage system further includes a portrait node and a plurality of management nodes, wherein the portrait node corresponds to a portrait blockchain, wherein the portrait blockchain includes at least one user portrait node, wherein one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain; the device includes:
[0083] A first receiving module is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain;
[0084] A first query module, used to query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier;
[0085] A first creation module, configured to create a new management node if the target user identifier does not exist in the correspondence table between the management node and the user identifier, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the correspondence table between the management node and the user identifier;
[0086] A first storage module is used to send the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0087] A portrait generation module, configured to generate a user portrait corresponding to the user data based on the user data, wherein the user portrait includes the target user identifier;
[0088] The second storage module is used to send the user portrait to the portrait node, so that the portrait node queries whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0089] In a sixth aspect, an embodiment of the present invention provides a blockchain-based data storage device, which is applied to a management node of a data storage system, wherein the data storage system also includes a master node, one management node is connected to one user node, and one user node is connected to at least one data blockchain; the device includes:
[0090] A second receiving module is used to receive user data generated by the business blockchain sent by the master node, wherein the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier;
[0091] The second creation module is used to create a new user node;
[0092] A third creation module is used to establish a new chain head node under the new user node;
[0093] A fourth creation module, used to establish a new data head node under the new chain head node;
[0094] A third storage module is used to establish a new data node under the new data head node and store the user data in the new data node;
[0095] Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier, the new data header node records the information of the target block, the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0096] In a seventh aspect, an embodiment of the present invention provides a data storage device based on blockchain, which is applied to a portrait node of a data storage system, wherein the data storage system further includes a master node, the portrait node corresponds to a portrait blockchain, the portrait blockchain includes at least one user portrait node, and one user portrait node corresponds to one user; the device includes:
[0097] A third receiving module is used to receive a user portrait sent by the master node, wherein the user portrait includes the target user identifier;
[0098] The second query module is used to query whether the target user identifier exists in the corresponding relationship table between user portrait nodes and user identifiers;
[0099] A fourth storage module is used to create a new user portrait node when the target user identifier does not exist in the corresponding relationship table between the user portrait node and the user identifier, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node;
[0100] The fifth storage module is used to establish a new linked list node under the target user portrait node corresponding to the target user identity when the target user identity exists in the correspondence table between the user portrait node and the user identity, and store the user portrait in the new linked list node.
[0101] In an eighth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;
[0102] Memory, used to store computer programs;
[0103] The processor is used to implement any of the above-mentioned method steps when executing the program stored in the memory.
[0104] In a ninth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any of the method steps described above is implemented.
[0105] An embodiment of the present invention further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-described method steps.
[0106] The embodiments of the present invention provide a blockchain-based data storage system and a data storage method, which realize the secure storage of user data.
[0107] Of course, it is not necessary to achieve all of the advantages described above at the same time to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0108] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0109] Figure 1 A schematic diagram of the structure of a data storage system based on blockchain provided by an embodiment of the present invention;
[0110] Figure 2 A schematic diagram of the structure of a data storage system based on blockchain provided by an embodiment of the present invention;
[0111] Figure 3 A schematic diagram showing an analysis method provided by an embodiment of the present invention;
[0112] Figure 4 A user portrait display schematic diagram provided by an embodiment of the present invention;
[0113] Figure 5 A flowchart of a data storage method based on blockchain provided by an embodiment of the present invention;
[0114] Figure 6 A flowchart of another blockchain-based data storage method provided by an embodiment of the present invention;
[0115] Figure 7 A flowchart of another data storage method based on blockchain provided in an embodiment of the present invention;
[0116] Figure 8 A schematic diagram of the structure of a data storage device based on blockchain provided by an embodiment of the present invention;
[0117] Fig. 9 A schematic diagram of the structure of another blockchain-based data storage device provided in an embodiment of the present invention;
[0118] Fig.10 A schematic diagram of the structure of another data storage device based on blockchain provided in an embodiment of the present invention;
[0119] Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0120] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0121] With the development of Web3.0, more and more users are engaged in social networking, distributed finance, metaverse, games and other activities on the blockchain, which has resulted in a large amount of user data being deposited on the blockchain. The traditional Internet lacks the autonomy of personal data. While providing users with various services such as communication, social networking, online shopping, information, and entertainment, Internet oligarchs collect a large amount of user data for accurate profiling, and conduct commercial activities such as advertising on this basis, which infringes on user rights and privacy.
[0122] To solve the above problems, an embodiment of the present invention provides a data storage system based on blockchain, the data storage system comprising: a master node, a portrait node and a plurality of management nodes, the portrait node corresponds to a portrait blockchain, the portrait blockchain comprises at least one user portrait node, one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain;
[0123] The master node receives user data sent by the business blockchain, wherein the user data includes the target user identifier of the target user, and the user data is generated when the user completes a business activity on the business blockchain; queries whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier, and if the target user identifier does not exist in the corresponding relationship table between the management node and the user identifier, creates a new management node, associates the new management node with the target user identifier, adds the corresponding relationship between the new management node and the target user identifier to the corresponding relationship table between the management node and the user identifier, and sends the user data to the new management node;
[0124] The management node receives user data, creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: the target business blockchain identifier and the target block identifier for generating the user data, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data head node and the block identifier, the new data head node records the information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0125] The main node generates a user portrait corresponding to the user data based on the user data, and sends the user portrait to the portrait node; the portrait node receives the user portrait, which includes the target user ID; it queries the correspondence table between the user portrait node and the user ID to see whether the target user ID exists. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0126] A blockchain-based data storage system provided by an embodiment of the present invention stores user portraits and user data through the interaction of a master node with a portrait node and a management node. Since one user portrait node corresponds to one user and one management node is connected to one user node, the association between nodes and users, and between users and data is realized, and the nodes and data can be bound, thereby realizing the secure storage of user data.
[0127] The blockchain-based data storage system provided in the embodiment of the present invention can be applied to blockchain scenarios to achieve data storage based on blockchain.
[0128] See also Figure 1 , a data storage system 100 based on blockchain provided by an embodiment of the present invention includes: a portrait node 110, a master node 120 and a plurality of management nodes 130 ( Figure 1 The management node is only illustrated in FIG. 1 ). The portrait node 110 corresponds to the portrait blockchain, and the portrait blockchain includes at least one user portrait node, one user portrait node corresponds to one user, one management node 130 is connected to one user node, and one user node corresponds to at least one data blockchain.
[0129] The master node 120 is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain; query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier, and if the target user identifier does not exist in the corresponding relationship table between the management node and the user identifier, create a new management node, associate the new management node with the target user identifier, add the corresponding relationship between the new management node and the target user identifier to the corresponding relationship table between the management node and the user identifier, and send the user data to the new management node.
[0130] In the embodiment of the present invention, the blockchain that generates user data, that is, the blockchain where users engage in social, distributed finance, metaverse, games and other activities is called a "business blockchain", and the blockchain that stores user data is called a "storage blockchain", that is, the data storage system 100 in the embodiment of the present invention.
[0131] When a user completes a business activity on the business blockchain, corresponding user data is generated. The business blockchain packages the generated user data and sends it to the master node 120. The user data includes the target user identifier of the target user. The master node 120 receives the user data sent by the business blockchain, and queries whether the target user identifier included in the user data exists in the corresponding relationship table between the management node and the user identifier maintained thereon. If the target user identifier does not exist in the corresponding relationship table between the management node and the user identifier, it indicates that the target user is a new user. At this time, a new management node is created for the new user, and the new management node is associated with the target user identifier. The corresponding relationship between the new management node and the target user identifier is added to the corresponding relationship table between the management node and the user identifier, and the corresponding relationship table between the management node and the user identifier maintained by the master node 120 is updated.
[0132] In an example, the management node may also maintain a correspondence table between management nodes and user identifiers. Accordingly, after the master node 120 creates a new management node for a new user and associates the new management node with the target user identifier, it may broadcast the association between the new management node and the target user identifier to all management nodes, thereby enabling each management node to update the correspondence table between the management node and the user identifier it maintains.
[0133] After creating a new management node for a new user, the master node 120 sends the user data to the new management node so that the new management node stores the user data.
[0134] The management node 130 is used to receive user data, create a new user node, establish a new chain head node under the new user node, establish a new data head node under the new chain head node, and establish a new data node under the new data head node, and store the user data in the new data node. The user data also includes: the target business blockchain identifier and the target block identifier for generating the user data, the new user node records: the information of the target user corresponding to the user data and the corresponding relationship table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the corresponding relationship table between the data head node and the block identifier, the new data head node records the information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0135] For example, Figure 2 As shown, after the management node A receives the user data sent by the master node, it creates a user node a, establishes a chain head node 1 under the user node a, establishes a data head node 1 under the new chain head node 1, and establishes a data node 11 under the data head node 1, and stores the user data in the data node 11.
[0136] The user data may also include: the target business blockchain identifier and the target block identifier for generating the user data, etc. In the management node 130 constructed for storing user data, the corresponding user information, such as identity identifier, age, gender, etc., may be stored in the management node 130; the target user information corresponding to the user data (such as user identifier, age, gender) and the correspondence table between the chain head node and the business blockchain identifier are recorded in the created new user node; the target business blockchain information (such as the target business blockchain identifier, etc.) and the correspondence table between the data header node and the block identifier are recorded in the created new chain head node; the target block information (such as the target block identifier, etc.) and the information of the data nodes contained therein are recorded in the created new data header node.
[0137] One management node 130 is connected to one user node. Accordingly, as many management nodes and user nodes are created as there are users. One user node may correspond to at least one data blockchain. One data blockchain corresponds to a business blockchain that generates user data. One data blockchain includes a chain head node and at least one data head node. One data head node includes at least one data node, that is, one chain head node and the data head node under the chain head node correspond to one data blockchain. One business blockchain of one user corresponds to one data blockchain, but one business blockchain may generate data of multiple users. In other words, the user data generated by the same business blockchain is stored in the same data blockchain. Each data head node corresponds to a block in the business blockchain, that is, the user data generated by the same block in the business blockchain is recorded under the same data head node.
[0138] The master node 120 also generates a user portrait corresponding to the user data based on the user data, and sends the user portrait to the portrait node 110 for storage.
[0139] The portrait node 110 is used to receive the user portrait, which includes the target user identifier; query whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node.
[0140] The portrait node 110 corresponds to the portrait blockchain, which is used to store the user portraits of all users. The portrait blockchain includes at least one user portrait node. One user portrait node corresponds to one user. If the same user has multiple portraits at different times, then multiple portraits will be stored. The portrait node 110 receives the user portrait and queries whether there is a target user ID in the corresponding relationship table between the user portrait node and the user ID maintained thereon. If not, it means that the target user is a new user. At this time, a new user portrait node is created for the new user, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0141] For example, Figure 2 As shown, after the portrait node receives the user data sent by the main node, it creates a user portrait node b, establishes a linked list node 1 under the user portrait node b, and stores the user portrait in the linked list node 1.
[0142] In an example, the user profile can be stored in the form of a two-dimensional array, in which one dimension represents the generation time of the user profile and the other dimension represents the user profile. The user profile of the user is stored in the new linked list node by forming the user profile and the generation time of the user profile into a two-dimensional array, and then storing the two-dimensional array in the new linked list node.
[0143] Exemplarily, the data storage system architecture constructed in the embodiment of the present invention is as follows: Figure 2 As shown, the data storage system includes: a master node, a portrait node, a management node A, a management node B and a management node N. The portrait node corresponds to a portrait blockchain (not shown in the figure). The portrait blockchain includes a user portrait node b and a user portrait node c. One user portrait node corresponds to one user. User portrait node b contains linked list node 1 and linked list node 2.
[0144] One management node is connected to one user node. Management node A is connected to user node a, management node B is connected to user node i, and no user node has been created under management node N. User node a is connected to chain head node 1, chain head node 2, and chain head node j, and user node i is connected to chain head node k.
[0145] A user node corresponds to at least one data blockchain. Figure 2 The chain head node 1 and the data head node 1 under the chain head node 1, data node 11, data node 1v, as well as data head node u and data node ux correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0146] A blockchain-based data storage system provided by an embodiment of the present invention constructs a data storage system through the interaction of a master node with a portrait node and a management node respectively. The constructed data storage system corresponds to the storage process of a new user's user portrait and user data. Since one user portrait node corresponds to one user, and one management node is connected to one user node, the association between the node and the user, and the user and the data is realized, and the node and the data can be bound, thereby realizing the secure storage of user data.
[0147] In some embodiments, the master node 120 is further configured to determine a target management node corresponding to the target user identifier and send user data to the target management node when the target user identifier exists in the corresponding relationship table between management nodes and user identifiers.
[0148] When the master node 120 finds that the target user identifier exists in the correspondence table between the management node and the user identifier maintained on it, it indicates that the target user is not a new user. At this time, by directly querying the correspondence table between the management node and the user identifier, the target management node corresponding to the target user identifier can be determined, and then the user data can be sent to the target management node for storage.
[0149] The management node 130 is also used to receive user data, query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node, and if so, store the user data in the chain head node corresponding to the target business blockchain identifier; if not, establish a new chain head node under the target user node and store the user data in the new chain head node.
[0150] If the target user is not a new user and there is a target management node, the target management node must have a target user. The management node 130 can query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier maintained on the target user node, that is, determine whether the target business blockchain identifier corresponds to the target chain head node. If it exists, it indicates that the user data generated by the target user in the target business blockchain corresponding to the target business blockchain identifier has been stored. At this time, the user data is stored in the chain head node corresponding to the target business blockchain identifier. If it does not exist, it indicates that the user data generated by the target user in the target business blockchain corresponding to the target business blockchain identifier has not been stored. At this time, a new chain head node is established under the target user node, and the user data is stored in the new chain head node.
[0151] In some embodiments, the management node 130 establishes a new chain head node under the target user node and stores the user data in the new chain head node, including: the management node 130 establishes a new chain head node under the target user node, associates the new chain head node with the target business blockchain identifier, and adds the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier; establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node.
[0152] When the management node 130 determines that the user data generated by the target user in the target business blockchain corresponding to the target business blockchain identifier has not been stored, a new chain head node is established under the target user node, and the information of the target business blockchain (such as the target business blockchain identifier, etc.) is recorded in the new chain head node, and the new chain head node is associated with the target business blockchain identifier, and the corresponding relationship between the new chain head node and the target business blockchain identifier is added to the corresponding relationship table between the chain head node and the business blockchain identifier maintained by the target user node. Further, a new data header node is established under the new chain head node, the information of the target block (such as the target block identifier, etc.) is recorded in the new data header node, and a new data node is established under the new data header node, and the association relationship between the new data header node and the target block identifier is established, and the corresponding relationship between the new data header node and the target block identifier is added to the corresponding relationship table between the data header node and the block identifier maintained by the chain head node, and the user data is stored in the new data node.
[0153] In some embodiments, the management node 130 stores the user data in the head node corresponding to the target business blockchain identifier, including: the management node 130 queries whether the target block identifier exists in the correspondence table between the data header node and the block identifier of the target chain head node corresponding to the target business blockchain identifier based on the target block identifier; if not, a new data header node is established under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier; and a new data node is established under the new data header node, and the user data is stored in the new data node; if it exists, the user data is stored in the target data header node corresponding to the target block identifier.
[0154] When the management node 130 determines that the user data generated by the target user in the target business blockchain corresponding to the target business blockchain identifier has been stored, it further queries whether the target block identifier exists in the corresponding relationship table between the data header node and the block identifier maintained by the target chain head node corresponding to the target business blockchain identifier. If it does not exist, it indicates that the user data generated by the target user on the target block of the target business blockchain has not been stored. At this time, a new data header node is established under the target chain head node, and the new data header node is associated with the target block identifier, and the corresponding relationship between the new data header node and the block identifier is added to the corresponding relationship table between the data header node and the block identifier maintained by the target chain head node, and a new data node is established under the new data header node, and the user data is stored in the new data node. If it exists, it indicates that the user data generated by the target user on the target block of the target business blockchain has been stored. At this time, the user data can be stored in the target data header node corresponding to the target block identifier.
[0155] In some embodiments, the management node 130 stores the user data in the target data head node corresponding to the target block identifier, including: sending a confirmation request to the master node 120 for confirming whether to store the user data, and upon receiving the confirmation information fed back by the master node 120, establishing a new data node under the target data head node, and storing the user data in the new data node; upon receiving the data discard information fed back by the master node 120, discarding the user data;
[0156] The master node 120 is further used to receive a confirmation request sent by the management node 130, generate a random number and generate a summary according to the activity content in the user data, select a random number of selected management nodes from all management nodes, and send the summary to each selected management node; receive the characteristic value sent by each selected management node, and send a confirmation message to the management node 130 when the minimum characteristic value among the characteristic values is not less than a preset threshold value, otherwise, send a data discard message to the management node 130;
[0157] The management node 130 is also used to receive the summary sent by the master node 120, perform feature recognition on the summary, obtain a feature value corresponding to the summary, and send the feature value to the master node 120, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics.
[0158] Each time a user completes a business activity on the business blockchain, a corresponding data packet will be generated. In the scenario where user data is used to generate a user profile, not all user business activities have an impact on the user profile. For example, user activity behaviors such as rollback operations and blind click operations cannot be used to characterize user behavior characteristics. In the case of storing the user data generated by the target user on the target block of the target business blockchain, it can be further determined whether to store the currently received user data, and user data that cannot characterize user behavior characteristics may not be stored.
[0159] In the case of storing the user data generated by the target user on the target block of the target business blockchain, the management node 130 sends a confirmation request to the master node 120 to confirm whether to store the user data. After receiving the confirmation request, the master node 120 generates a random number r using a random number generation function, where r is a positive integer greater than or equal to 1 and less than or equal to M, and M can be set according to actual needs. The above user data can also include information such as activity time, activity content, and activity results. The master node 120 generates a corresponding summary based on the activity content in the user data, randomly selects r selected management nodes from all management nodes, and sends the generated summary to each selected management node, wherein the generation of the corresponding summary based on the activity content can be implemented using existing technologies.
[0160] The selected management node receives the summary sent by the master node 120, uses the existing feature recognition technology to perform feature recognition on the summary, obtains the feature value corresponding to the summary, and the feature value indicates the degree to which the user data can characterize the user behavior characteristics, and further sends the obtained feature value to the master node 120.
[0161] The master node 120 receives the eigenvalues returned by all selected management nodes. When the minimum eigenvalue among the eigenvalues is not less than the preset threshold, it indicates that the user data can characterize the user behavior characteristics. The master node 120 sends confirmation information to the above-mentioned management node 130. When the management node 130 receives the confirmation information fed back by the master node 120, it establishes a new data node under the target data head node and stores the user data in the new data node. When the minimum eigenvalue among the eigenvalues of the master node 120 is less than the preset threshold, it indicates that the user data cannot characterize the user behavior characteristics. The master node 130 sends data discard information to the above-mentioned management node 130. When the management node 130 receives the data discard information fed back by the master node 120, it discards the user data and does not store the user data. Among them, the preset threshold can be set according to actual needs.
[0162] In some embodiments, the above-mentioned portrait node 110 is also used to establish a new linked list node under the target user portrait node corresponding to the target user identifier when the target user identifier is found in the correspondence table between the user portrait node and the user identifier, and store the user portrait in the new linked list node.
[0163] When portrait node 110 finds that the target user identifier exists in the correspondence table between user portrait nodes and user identifiers maintained on it, it indicates that the target user is not a new user. By directly querying the correspondence table between user portrait nodes and user identifiers, the target user portrait node corresponding to the target user identifier can be determined, and a new linked list node is established under the target user portrait node to store the user portrait in the new linked list node.
[0164] For example, Figure 2 As shown, when the user portrait node b has been created, a linked list node 1 can be established under the user portrait node b to store the user portrait in the linked list node 1. When the linked list node 1 already exists, a linked list node 2 can be established under the user portrait node b to store the user portrait in the linked list node 2.
[0165] One linked list node corresponds to one user portrait, and the number of linked list nodes under the user portrait node is the same as the number of user portraits of the user corresponding to the user portrait node.
[0166] In some embodiments, the master node 120 generates a user profile corresponding to the user data based on the user data, including:
[0167] The master node 120 receives a user data acquisition request, wherein the user data acquisition request includes a specified user identifier of a specified user, a specified business blockchain identifier, and a specified block identifier; determines the designated management node corresponding to the user data acquisition request according to the designated user identifier and a correspondence table between the management node and the user identifier in the master node; determines the designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and a correspondence table between the chain head node of the designated user node of the designated management node and the business blockchain identifier; determines the designated data head node corresponding to the user data acquisition request according to the designated block identifier and a correspondence table between the data head node of the designated chain head node and the block identifier; reads the designated user data corresponding to the user data acquisition request from the designated data head node, wherein the designated user data includes information of the designated user; determines a category of the designated user according to the information of the designated user; clusters the user data of all users under the category to determine a portrait dimension of the designated user; generates a user portrait of the designated user based on the designated user data and the portrait dimension.
[0168] The master node 120 receives a user data acquisition request, which includes a specified user identifier of a specified user, a specified business blockchain identifier, and a specified block identifier, and obtains the stored user data from the management node 130 using a method corresponding to the above-mentioned user data storage process.
[0169] The master node 120 reads the designated user data corresponding to the user data acquisition request from the designated data head node, which contains the information of the designated user. The information of the designated user may be, for example, the age and gender of the designated user. The category to which the designated user belongs is determined according to the information of the designated user. The category may be, for example, children, teenagers, middle-aged or elderly, or male or female. Further, for the category to which the designated user belongs, a K-MEANS (K-means clustering algorithm) clustering algorithm, a mean shift clustering algorithm, a DBSCAN (Density-Based Spatial Clustering of Applications with Noise) clustering algorithm, an EM (Expectation-maximization) clustering algorithm using a GMM (Gaussian Mixture Model) or a hierarchical clustering algorithm may be used to cluster the user data of all users under the category, cluster the user data with similar behavior characteristics into one category, and determine the dimension of any user data in the cluster containing the largest number of user data as the portrait dimension of the designated user.
[0170] After determining the portrait dimension, for each piece of data in the designated user data of the designated user, the data value of the piece of data in the portrait dimension can be collected, and the data values in all portrait dimensions can be analyzed using a target analysis method to generate a user portrait of the designated user. The detailed implementation process of using the target analysis method to analyze the data values in all portrait dimensions to generate a user portrait of the designated user can be the same as the prior art, and the embodiments of the present invention will not be repeated here.
[0171] Exemplarily, the target analysis method can be any one of a plurality of analysis methods, such as Figure 3 As shown, it can include supervised learning methods, unsupervised learning methods or adaptive learning methods, among which supervised learning methods include regression analysis methods and CNN (Convolutional Neural Network) deep learning, unsupervised learning methods include clustering analysis methods, and adaptive learning methods include GAN (Generative Adversarial Network) network prediction methods.
[0172] For example, a user profile of a user is generated as follows: Figure 4 As shown, Figure 3 The figure shows the user portrait of the user Alice, which includes portrait data of ordinary traders, liquidity providers, and market makers in finance (specific portrait data is not shown), portrait data of DAO (Data Access Object) participants and StepN (mobile travel application on Solana blockchain) participants in social aspects, portrait data of Ant Digital product owners and digital collection diamond hands in collection aspects, portrait data of Metaverse primary analysis, Roblox (multiplayer online creation game) deep participants, and Sandbox (virtual software) land builders in Metaverse aspects, and portrait data of DCL game masters and GameFi beginners in games aspects. Figure 3 The portrait data of specific dimensions are not shown.
[0173] In some embodiments, the master node 120 can also directly determine the category of the specified user based on the user data sent by the business blockchain, which includes information about the specified user; cluster the user data of all users under the category to determine the portrait dimension of the specified user, and then generate a user portrait of the specified user based on the specified user data and the portrait dimension.
[0174] In an embodiment of the present invention, the master node generates a user portrait corresponding to the user data and stores the user portrait on the portrait blockchain. Each user portrait node on the portrait blockchain corresponds to a user, and the user portrait can be connected (or bound) to the user portrait node that uniquely represents the user on the portrait blockchain. The user identity corresponding to the user portrait is assigned by the user portrait node, so that the security and privacy of the user portrait can be protected.
[0175] In some embodiments, the main node 120 is also used to: obtain a use request from the first user for a specified user portrait, the use request including: a second user identifier of a second user corresponding to the specified user portrait; based on the second user identifier, query the correspondence table between the user portrait node and the user identifier in the portrait node, determine the specified user portrait node corresponding to the second user identifier, the specified user portrait node contains information about the second user; based on the information of the second user, send a request to the second user for the specified user portrait to be used; upon receiving an authorization message fed back by the second user, read the specified user portrait in the specified user portrait node of the portrait node, and feed back the specified user portrait to the first user; upon receiving an unauthorized message fed back by the second user, feed back information about the unauthorized use to the first user.
[0176] The master node 120 obtains the use request of the first user for the designated user portrait, indicating that the first user needs to use the designated user portrait, and queries the correspondence table between the user portrait node and the user identifier maintained by the portrait node 110 of the portrait blockchain, and determines the designated user portrait node corresponding to the second user identifier through the correspondence table between the user portrait node and the user identifier, and the designated user portrait node contains the information of the second user. Exemplarily, the information of the second user may be the identity information of the second user, and a message may be sent to the second user through the identity information.
[0177] The request for using the designated user portrait sent by the master node 120 to the second user may include: user information of the first user who uses the designated user portrait, and the purpose of using the designated user portrait.
[0178] After receiving the request for the use of the designated user portrait, the second user determines whether to authorize the first user to use the designated user portrait based on the user information of the first user using the designated user portrait contained in the request, as well as the purpose of the use of the designated user portrait. When receiving the authorization message fed back by the second user, it means that the second user authorizes the first user to use the designated user portrait. At this time, the designated user portrait in the designated user portrait node of the portrait node 110 is read, and the read designated user portrait is fed back to the first user. When receiving the unauthorized message fed back by the second user, it means that the second user does not authorize the first user to use the designated user portrait, and the information of unauthorized use is fed back to the first user.
[0179] In the embodiment of the present invention, when using a user portrait, the user is notified that his / her user portrait will be used through the user information contained in the user portrait node stored in the user portrait. The user portrait is only allowed to be read and used when the user's authorization is obtained, thereby ensuring that the user's rights and privacy are not violated.
[0180] Exemplarily, in an embodiment of the present invention, a corresponding data storage system is constructed through the above-mentioned storage process of user data. After the user data corresponding to user P is stored in the management node, the user data of user P can be read from the management node, and the read user data is further analyzed to determine the portrait dimension of user P, and then the user portrait of user P is generated according to the determined portrait dimension and the user data of user P. The user portrait of user P is further stored in the user portrait node in the portrait node corresponding to the portrait blockchain. When user Q uses the user portrait of user P, the main node receives the user Q's use request for the user portrait of user P, determines the user portrait node p storing the user portrait of user P through the portrait node of the portrait blockchain, and sends a notification to user P that its user portrait is used according to the information of user P stored in the user portrait node p. The notification indicates the information of user Q and the purpose of use, etc. User P determines whether to authorize user Q to use the user portrait of user P according to the information of user Q and the purpose of use contained in the notification, and feedbacks the response information of whether authorization is given. In the case of receiving the authorization message, the user portrait of user P is read, and the read user portrait is fed back to user Q. In the case of receiving the unauthorized message, the information of unauthorized use is directly fed back to user Q.
[0181] Corresponding to the blockchain-based data storage system provided in the above embodiment, an embodiment of the present invention further provides a blockchain-based data storage method, which is applied to the master node of the data storage system, the data storage system also includes a portrait node and multiple management nodes, the portrait node corresponds to the portrait blockchain, the portrait blockchain includes at least one user portrait node, one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain; Figure 5 As shown, the method includes:
[0182] S501, receiving user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain;
[0183] S502, query whether there is a target user identifier in the corresponding relationship table between the management node and the user identifier;
[0184] S503, if the target user identifier does not exist in the management node and user identifier correspondence table, create a new management node, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the management node and user identifier correspondence table;
[0185] S504, sending the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: the target business blockchain identifier and the target block identifier for generating the user data, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data head node and the block identifier, the new data head node records the information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0186] S505, generating a user portrait corresponding to the user data based on the user data, wherein the user portrait includes a target user identifier;
[0187] S506, sending the user portrait to the portrait node, so that the portrait node queries whether the target user identifier exists in the corresponding relationship table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0188] In some embodiments, the above method further comprises:
[0189] When the target user identifier exists in the correspondence table between management nodes and user identifiers, the target management node corresponding to the target user identifier is determined, and the user data is sent to the target management node, so that the target management node queries whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the target management node, and if so, the user data is stored in the chain head node corresponding to the target business blockchain identifier; if not, a new chain head node is established under the target user node, and the user data is stored in the new chain head node.
[0190] In some embodiments, the above method further comprises:
[0191] Receive a confirmation request sent by the management node, the confirmation request is used to confirm whether to store the user data;
[0192] Generate a random number and generate a summary based on the activity content in the user data, and select a random number of selected management nodes from all management nodes;
[0193] Send the summary to each selected management node so that the selected management node can perform feature recognition on the summary, obtain feature values corresponding to the summary, and feed back the feature values to the master node, wherein the feature values are used to indicate the degree to which the user data can characterize the user behavior characteristics;
[0194] Receiving characteristic values sent by each selected management node;
[0195] When the minimum eigenvalue among the eigenvalues is not less than the preset threshold, confirmation information is sent to the management node so that the management node stores the user data. Otherwise, data discard information is sent to the management node so that the management node discards the user data.
[0196] In some embodiments, generating a user profile corresponding to the user data based on the user data includes:
[0197] Receive a user data acquisition request, where the user data acquisition request includes a specified user identifier of a specified user, a specified business blockchain identifier, and a specified block identifier;
[0198] Determine the designated management node corresponding to the user data acquisition request according to the designated user identifier and the correspondence table between the management node and the user identifier in the master node;
[0199] Determine the designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and the correspondence table between the chain head node of the designated user node of the designated management node and the business blockchain identifier;
[0200] Determine the designated data header node corresponding to the user data acquisition request according to the designated block identifier and the corresponding relationship table between the data header node of the designated chain head node and the block identifier;
[0201] Read the specified user data corresponding to the user data acquisition request from the specified data header node, where the specified user data contains information about the specified user;
[0202] Determine the category of the specified user based on the information of the specified user;
[0203] Cluster the user data of all users under the category to determine the portrait dimensions of the specified user;
[0204] Generate a user profile for the specified user based on the specified user data and profile dimensions.
[0205] In some embodiments, the above method further comprises:
[0206] Obtaining a use request of the first user for the specified user portrait, the use request including: a second user identifier of a second user corresponding to the specified user portrait;
[0207] According to the second user identifier, query the corresponding relationship table between the user portrait node and the user identifier in the portrait node to determine the designated user portrait node corresponding to the second user identifier, where the designated user portrait node contains information about the second user;
[0208] Sending a request to the second user to specify that the user portrait is to be used according to the information of the second user;
[0209] Upon receiving the authorization message fed back by the second user, reading the designated user portrait in the designated user portrait node of the portrait node, and feeding back the designated user portrait to the first user;
[0210] When receiving the unauthorized message fed back by the second user, the unauthorized use information is fed back to the first user.
[0211] Corresponding to the blockchain-based data storage system provided in the above embodiment, an embodiment of the present invention further provides a blockchain-based data storage method, which is applied to a management node of a data storage system, wherein the data storage system further includes a master node, a management node connected to a user node, and a user node connected to at least one data blockchain; Figure 6 As shown, the method includes:
[0212] S601, receiving user data generated by a business blockchain sent by a master node, where the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier;
[0213] S602, creating a new user node;
[0214] S603, establishing a new chain head node under the new user node;
[0215] S604, establishing a new data head node under the new chain head node;
[0216] S605, establishing a new data node under the new data head node, and storing the user data in the new data node;
[0217] Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier; the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier; the new data header node records the information of the target block; the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0218] In some embodiments, the above method further comprises:
[0219] Check whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node;
[0220] If it exists, the user data is stored in the chain head node corresponding to the target business blockchain identifier;
[0221] If it does not exist, a new chain head node is created under the target user node, and the user data is stored in the new chain head node.
[0222] In some embodiments, the above-mentioned step of establishing a new chain head node under the target user node and storing the user data in the new chain head node includes:
[0223] Establish a new chain head node under the target user node, associate the new chain head node with the target business blockchain identifier, and add the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier;
[0224] Create a new data head node under the new chain head node;
[0225] Create a new data node under the new data head node and store user data in the new data node.
[0226] In some embodiments, the above-mentioned storing the user data in the chain head node corresponding to the target business blockchain identifier includes:
[0227] Based on the target block identifier, query whether the target block identifier exists in the corresponding relationship table between the data header node and the block identifier of the target chain head node corresponding to the target business blockchain identifier;
[0228] If it does not exist, a new data header node is created under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier, and a new data node is created under the new data header node, and the user data is stored in the new data node;
[0229] If it exists, the user data is stored in the target data header node corresponding to the target block identifier.
[0230] In some embodiments, the above-mentioned storing the user data in the target data header node corresponding to the target block identifier includes:
[0231] Send a confirmation request to the master node to confirm whether to store the user data, so that the master node generates a random number and generates a summary according to the activity content in the user data, selects a random number of selected management nodes from all management nodes, and sends the summary to each selected management node;
[0232] Receive the summary sent by the master node;
[0233] Perform feature recognition on the summary to obtain a feature value corresponding to the summary, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics;
[0234] Send the characteristic value to the master node, so that the master node sends confirmation information to the management node when the minimum characteristic value among the characteristic values is not less than the preset threshold value, otherwise, sends data discard information to the management node;
[0235] When receiving the confirmation information fed back by the master node, a new data node is established under the target data head node, and the user data is stored in the new data node;
[0236] When receiving the data discard information fed back by the master node, the user data is discarded.
[0237] Corresponding to the data storage system based on blockchain provided in the above embodiment, an embodiment of the present invention further provides a data storage method based on blockchain, which is applied to a portrait node of a data storage system, wherein the data storage system further includes a master node, the portrait node corresponds to a portrait blockchain, and the portrait blockchain includes at least one user portrait node, wherein one user portrait node corresponds to one user; Figure 7 As shown, the method includes:
[0238] S701, receiving a user portrait sent by a master node, where the user portrait includes a target user identifier;
[0239] S702, query whether there is a target user identifier in the corresponding relationship table between user portrait nodes and user identifiers;
[0240] S703, if it does not exist, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node;
[0241] S704: If it exists, a new linked list node is created under the target user portrait node corresponding to the target user identifier, and the user portrait is stored in the new linked list node.
[0242] Corresponds to Figure 5The data storage method based on blockchain shown in the embodiment of the present invention also provides a data storage device based on blockchain, which is applied to the master node of the data storage system. The data storage system also includes a portrait node and multiple management nodes. The portrait node corresponds to the portrait blockchain. The portrait blockchain includes at least one user portrait node. One user portrait node corresponds to one user. One management node is connected to one user node. One user node corresponds to at least one data blockchain. Figure 8 As shown, the device comprises:
[0243] The first receiving module 801 is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain;
[0244] A first query module 802 is used to query whether a target user identifier exists in a corresponding relationship table between management nodes and user identifiers;
[0245] A first creation module 803 is used to create a new management node if the target user identifier does not exist in the management node-user identifier correspondence table, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the management node-user identifier correspondence table;
[0246] The first storage module 804 is used to send the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: the target business blockchain identifier and the target block identifier for generating the user data, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data head node and the block identifier, the new data head node records the information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain;
[0247] A portrait generation module 805 is used to generate a user portrait corresponding to the user data based on the user data, wherein the user portrait includes a target user identifier;
[0248] The second storage module 806 is used to send the user portrait to the portrait node so that the portrait node queries whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
[0249] Corresponds to Figure 6 The data storage method based on blockchain shown in the embodiment of the present invention also provides a data storage device based on blockchain, which is applied to a management node of a data storage system, and the data storage system also includes a master node, a management node is connected to a user node, and a user node is connected to at least one data blockchain; Fig. 9 As shown, the device comprises:
[0250] The second receiving module 901 is used to receive user data generated by the business blockchain sent by the master node, where the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier;
[0251] The second creation module 902 is used to create a new user node;
[0252] The third creation module 903 is used to establish a new chain head node under the new user node;
[0253] The fourth creation module 904 is used to establish a new data head node under the new chain head node;
[0254] The third storage module 905 is used to establish a new data node under the new data head node and store the user data in the new data node;
[0255] Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier; the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier; the new data header node records the information of the target block; the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
[0256] Corresponds to Figure 7 The data storage method based on blockchain shown in the embodiment of the present invention also provides a data storage device based on blockchain, which is applied to a portrait node of a data storage system, the data storage system also includes a master node, the portrait node corresponds to a portrait blockchain, the portrait blockchain includes at least one user portrait node, and one user portrait node corresponds to one user; Fig.10 As shown, the device comprises:
[0257] The third receiving module 101 is used to receive a user portrait sent by the master node, where the user portrait includes a target user identifier;
[0258] The second query module 102 is used to query whether the target user identifier exists in the corresponding relationship table between the user portrait node and the user identifier;
[0259] The fourth storage module 103 is used to create a new user portrait node when the target user identifier does not exist in the corresponding relationship table between the user portrait node and the user identifier, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node;
[0260] The fifth storage module 104 is used to create a new linked list node under the target user portrait node corresponding to the target user identity when there is a target user identity in the correspondence table between the user portrait node and the user identity, and store the user portrait in the new linked list node.
[0261] The embodiment of the present invention further provides an electronic device, such as Fig.11 As shown, it includes a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.
[0262] Memory 113, used for storing computer programs;
[0263] The processor 111 is used to implement the steps of any of the above-mentioned blockchain-based data storage methods when executing the program stored in the memory 113 to achieve the same technical effect.
[0264] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0265] The communication interface is used for communication between the above electronic device and other devices.
[0266] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0267] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0268] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the above-mentioned blockchain-based data storage methods are implemented to achieve the same technical effect.
[0269] In another embodiment provided by the present invention, a computer program product comprising instructions is also provided. When the computer is run on a computer, the computer executes the steps of any one of the blockchain-based data storage methods in the above embodiments to achieve the same technical effect.
[0270] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0271] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0272] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method / device / electronic device embodiment, since it is basically similar to the system embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0273] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A data storage system based on blockchain, characterized in that: The data storage system includes: a master node, a portrait node and a plurality of management nodes, the portrait node corresponds to a portrait blockchain, the portrait blockchain includes at least one user portrait node, one user portrait node corresponds to one user, one management node is connected to one user node, and one user node corresponds to at least one data blockchain; The master node is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain; query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier, and if the target user identifier does not exist in the corresponding relationship table between the management node and the user identifier, create a new management node, associate the new management node with the target user identifier, add the corresponding relationship between the new management node and the target user identifier to the corresponding relationship table between the management node and the user identifier, and send the user data to the new management node; and generate a user portrait corresponding to the user data based on the user data, and send the user portrait to the portrait node, wherein the generation of the user portrait corresponding to the user data based on the user data includes: the master node receives a user data acquisition request, and the user data acquisition request includes a specified user identifier of a specified user. The method comprises: determining a designated management node corresponding to the user data acquisition request according to the designated user identifier and the corresponding relationship table between the management node and the user identifier in the master node; determining a designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and the corresponding relationship table between the chain head node of the designated user node of the designated management node and the business blockchain identifier; determining a designated data head node corresponding to the user data acquisition request according to the designated block identifier and the corresponding relationship table between the data head node of the designated chain head node and the block identifier; reading designated user data corresponding to the user data acquisition request from the designated data head node, the designated user data containing information of the designated user; determining a category of the designated user according to the information of the designated user; clustering the user data of all users under the category to determine the portrait dimension of the designated user; generating a user portrait of the designated user based on the designated user data and the portrait dimension; The management node is used to receive the user data, create a new user node, establish a new chain head node under the new user node, establish a new data head node under the new chain head node, and establish a new data node under the new data head node, and store the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain; The portrait node is used to receive the user portrait, which includes the target user identifier; query whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node.
2. The data storage system according to claim 1, characterized in that: The master node is further configured to determine a target management node corresponding to the target user identifier, and send the user data to the target management node if the target user identifier exists in the corresponding relationship table between the management node and the user identifier; The management node is also used to receive the user data, query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node, and if so, store the user data in the chain head node corresponding to the target business blockchain identifier; if not, establish a new chain head node under the target user node and store the user data in the new chain head node.
3. The data storage system according to claim 2, characterized in that: The management node establishes a new chain head node under the target user node, and stores the user data in the new chain head node, including: The management node establishes a new chain head node under the target user node, associates the new chain head node with the target business blockchain identifier, and adds the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier; establishes a new data header node under the new chain head node, and establishes a new data node under the new data header node, and stores the user data in the new data node.
4. The data storage system according to claim 2, characterized in that: The management node stores the user data in the chain head node corresponding to the target business blockchain identifier, including: Based on the target block identifier, the management node queries whether the target block identifier exists in the correspondence table between the data header node and the block identifier of the target chain head node corresponding to the target business blockchain identifier. If not, a new data header node is established under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier, and a new data node is established under the new data header node, and the user data is stored in the new data node; if it exists, the user data is stored in the target data header node corresponding to the target block identifier.
5. The data storage system according to claim 4, characterized in that: The management node stores the user data in the target data head node corresponding to the target block identifier, including: sending a confirmation request to the master node for confirming whether to store the user data, and upon receiving confirmation information fed back by the master node, establishing a new data node under the target data head node, and storing the user data in the new data node; upon receiving data discard information fed back by the master node, discarding the user data; The master node is further configured to receive the confirmation request sent by the management node, generate a random number and generate a summary according to the activity content in the user data, select a random number of selected management nodes from all the management nodes, and send the summary to each of the selected management nodes; receive the characteristic value sent by each of the selected management nodes, and send confirmation information to the management node if the minimum characteristic value among the characteristic values is not less than a preset threshold, otherwise, send data discard information to the management node; The management node is further used to receive the summary sent by the master node, perform feature recognition on the summary, obtain a feature value corresponding to the summary, and send the feature value to the master node, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics.
6. The data storage system according to claim 1, characterized in that: The portrait node is also used to establish a new linked list node under the target user portrait node corresponding to the target user identifier when the target user identifier is found in the correspondence table between the user portrait node and the user identifier, and store the user portrait in the new linked list node.
7. The data storage system according to claim 1, characterized in that: The master node is also used to: Obtain a use request from a first user for a designated user portrait, the use request including: a second user identifier of a second user corresponding to the designated user portrait; based on the second user identifier, query a correspondence table between user portrait nodes and user identifiers in a portrait node to determine a designated user portrait node corresponding to the second user identifier, wherein the designated user portrait node includes information about the second user; based on the information about the second user, send a request to the second user for the designated user portrait to be used; upon receiving an authorization message fed back by the second user, read the designated user portrait in the designated user portrait node of the portrait node, and feed back the designated user portrait to the first user; upon receiving an unauthorized message fed back by the second user, feed back information about the unauthorized use to the first user.
8. A data storage method based on blockchain, characterized in that: A master node applied to the data storage system of claim 1, wherein the data storage system further comprises a portrait node and a plurality of management nodes, wherein the portrait node corresponds to a portrait blockchain, wherein the portrait blockchain comprises at least one user portrait node, wherein one user portrait node corresponds to one user, and one management node is connected to one user node, wherein one user node corresponds to at least one data blockchain; the method comprises: Receiving user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain; Query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier; If the target user identifier does not exist in the correspondence table between the management node and the user identifier, create a new management node, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the correspondence table between the management node and the user identifier; Send the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain; Based on the user data, generating a user portrait corresponding to the user data, wherein the user portrait includes the target user identifier; The user portrait is sent to the portrait node so that the portrait node queries whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
9. The data storage method according to claim 8, characterized in that: The method further comprises: In the case where the target user identifier exists in the correspondence table between the management node and the user identifier, the target management node corresponding to the target user identifier is determined, and the user data is sent to the target management node, so that the target management node queries whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the target management node, and if so, stores the user data in the chain head node corresponding to the target business blockchain identifier; if not, establishes a new chain head node under the target user node and stores the user data in the new chain head node.
10. The data storage method according to claim 9, characterized in that: The method further comprises: receiving a confirmation request sent by the management node, wherein the confirmation request is used to confirm whether to store the user data; Generate a random number and generate a summary according to the activity content in the user data, and select a random number of selected management nodes from all management nodes; Sending the summary to each of the selected management nodes so that the selected management node performs feature recognition on the summary, obtains a feature value corresponding to the summary, and feeds back the feature value to the master node, wherein the feature value is used to indicate the degree to which the user data can characterize the user behavior characteristics; Receiving characteristic values sent by each of the selected management nodes; When the minimum characteristic value among the characteristic values is not less than a preset threshold, confirmation information is sent to the management node so that the management node stores the user data; otherwise, data discard information is sent to the management node so that the management node discards the user data.
11. The data storage method according to claim 8, characterized in that: The generating, based on the user data, a user portrait corresponding to the user data, includes: Receive a user data acquisition request, wherein the user data acquisition request includes a specified user identifier of a specified user, a specified business blockchain identifier, and a specified block identifier; Determine the designated management node corresponding to the user data acquisition request according to the designated user identifier and the correspondence table between the management node and the user identifier in the master node; Determine the designated chain head node corresponding to the user data acquisition request according to the designated business blockchain identifier and the correspondence table between the chain head node of the designated user node of the designated management node and the business blockchain identifier; Determine the designated data header node corresponding to the user data acquisition request according to the designated block identifier and the correspondence table between the data header node of the designated chain head node and the block identifier; Reading designated user data corresponding to the user data acquisition request from the designated data header node, wherein the designated user data includes information of a designated user; Determine the category of the designated user according to the information of the designated user; Clustering the user data of all users under the category to determine the portrait dimension of the designated user; Based on the designated user data and the portrait dimension, a user portrait of the designated user is generated.
12. The data storage method according to claim 11, characterized in that: The method further comprises: Obtaining a use request of the first user for the specified user portrait, wherein the use request includes: a second user identifier of a second user corresponding to the specified user portrait; According to the second user identifier, query the corresponding relationship table between the user portrait node and the user identifier in the portrait node to determine the designated user portrait node corresponding to the second user identifier, wherein the designated user portrait node contains information about the second user; Sending a request to the second user to specify that the user portrait is to be used according to the information of the second user; Upon receiving the authorization message fed back by the second user, reading the designated user portrait in the designated user portrait node of the portrait node, and feeding back the designated user portrait to the first user; When receiving the unauthorized message fed back by the second user, the unauthorized use information is fed back to the first user.
13. A data storage method based on blockchain, characterized in that: A management node applied to the data storage system of claim 1, wherein the data storage system further comprises a master node, one management node is connected to one user node, and one user node is connected to at least one data blockchain; the method comprises: Receive user data generated by the business blockchain sent by the master node, wherein the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier; Create a new user node; Establishing a new chain head node under the new user node; Establishing a new data head node under the new chain head node; Establishing a new data node under the new data head node, and storing the user data in the new data node; Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier, the new data header node records the information of the target block, the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
14. The data storage method according to claim 13, characterized in that: The method further comprises: Query whether the target business blockchain identifier exists in the correspondence table between the chain head node and the business blockchain identifier of the target user node under the management node; If it exists, the user data is stored in the chain head node corresponding to the target business blockchain identifier; If it does not exist, a new chain head node is established under the target user node, and the user data is stored in the new chain head node.
15. The data storage method according to claim 14, characterized in that: The step of establishing a new chain head node under the target user node and storing the user data in the new chain head node comprises: Establish a new chain head node under the target user node, associate the new chain head node with the target business blockchain identifier, and add the correspondence between the new chain head node and the target business blockchain identifier to the correspondence table between the chain head node and the business blockchain identifier; Establishing a new data head node under the new chain head node; A new data node is established under the new data head node, and the user data is stored in the new data node.
16. The data storage method according to claim 14, characterized in that: The storing of the user data in the chain head node corresponding to the target business blockchain identifier includes: Based on the target block identifier, query whether the target block identifier exists in the corresponding relationship table between the data head node and the block identifier of the target chain head node corresponding to the target business blockchain identifier; If it does not exist, a new data header node is established under the target chain head node, the new data header node is associated with the target block identifier, and the correspondence between the new data header node and the block identifier is added to the correspondence table between the data header node and the block identifier, and a new data node is established under the new data header node, and the user data is stored in the new data node; If it exists, the user data is stored in the target data header node corresponding to the target block identifier.
17. The data storage method according to claim 16, characterized in that: The storing the user data in the target data header node corresponding to the target block identifier includes: Sending a confirmation request to the master node for confirming whether to store the user data, so that the master node generates a random number and generates a summary according to the activity content in the user data, selects a random number of selected management nodes from all management nodes, and sends the summary to each of the selected management nodes; Receiving the summary sent by the master node; Performing feature recognition on the summary to obtain a feature value corresponding to the summary, wherein the feature value is used to indicate the degree to which the user data can characterize user behavior characteristics; Sending the characteristic value to the master node, so that the master node sends confirmation information to the management node when the minimum characteristic value among the characteristic values is not less than a preset threshold value, otherwise, sends data discard information to the management node; Upon receiving the confirmation information fed back by the master node, a new data node is established under the target data head node, and the user data is stored in the new data node; When receiving the data discarding information fed back by the master node, the user data is discarded.
18. A data storage method based on blockchain, characterized in that: A portrait node applied to the data storage system of claim 1, wherein the data storage system further comprises a master node, the portrait node corresponds to a portrait blockchain, the portrait blockchain comprises at least one user portrait node, and one user portrait node corresponds to one user; the method comprises: Receive a user profile sent by the master node, wherein the user profile includes a target user identifier; Query whether the target user ID exists in the corresponding relationship table between user portrait nodes and user IDs; If it does not exist, create a new user portrait node, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node; If it exists, a new linked list node is created under the target user portrait node corresponding to the target user identifier, and the user portrait is stored in the new linked list node.
19. A data storage device based on blockchain, characterized in that: A master node applied to the data storage system of claim 1, wherein the data storage system further comprises a portrait node and a plurality of management nodes, wherein the portrait node corresponds to a portrait blockchain, wherein the portrait blockchain comprises at least one user portrait node, wherein one user portrait node corresponds to one user, and one management node is connected to one user node, wherein one user node corresponds to at least one data blockchain; the device comprises: A first receiving module is used to receive user data sent by the business blockchain, wherein the user data includes a target user identifier of a target user, and the user data is generated when the user completes a business activity on the business blockchain; A first query module, used to query whether the target user identifier exists in the corresponding relationship table between the management node and the user identifier; A first creation module, configured to create a new management node if the target user identifier does not exist in the correspondence table between the management node and the user identifier, associate the new management node with the target user identifier, and add the correspondence between the new management node and the target user identifier to the correspondence table between the management node and the user identifier; A first storage module is used to send the user data to the new management node so that the new management node creates a new user node, establishes a new chain head node under the new user node, establishes a new data head node under the new chain head node, and establishes a new data node under the new data head node, and stores the user data in the new data node; wherein the user data also includes: a target business blockchain identifier and a target block identifier for generating the user data, the new user node records: information of the target user corresponding to the user data and a correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: information of the target business blockchain and a correspondence table between the data head node and the block identifier, the new data head node records information of the target block, the new chain head node and the data head node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain; A portrait generation module, configured to generate a user portrait corresponding to the user data based on the user data, wherein the user portrait includes the target user identifier; The second storage module is used to send the user portrait to the portrait node, so that the portrait node queries whether the target user identifier exists in the correspondence table between the user portrait node and the user identifier. If not, a new user portrait node is created, a new linked list node is established under the new user portrait node, and the user portrait is stored in the new linked list node.
20. A data storage device based on blockchain, characterized in that: A management node applied to the data storage system of claim 1, wherein the data storage system further comprises a master node, one of the management nodes is connected to one user node, and one user node is connected to at least one data blockchain; The device comprises: A second receiving module is used to receive user data generated by the business blockchain sent by the master node, wherein the user data includes a target user identifier of a target user, a target business blockchain identifier for generating the user data, and a target block identifier; The second creation module is used to create a new user node; A third creation module is used to establish a new chain head node under the new user node; A fourth creation module, used to establish a new data head node under the new chain head node; A third storage module is used to establish a new data node under the new data head node and store the user data in the new data node; Among them, the new user node records: the information of the target user corresponding to the user data and the correspondence table between the chain head node and the business blockchain identifier, the new chain head node records: the information of the target business blockchain and the correspondence table between the data header node and the block identifier, the new data header node records the information of the target block, the new chain head node and the data header node under the new chain head node correspond to a data blockchain, and a business blockchain of a user corresponds to a data blockchain.
21. A data storage device based on blockchain, characterized in that: Applied to the data storage system of claim 1, the data storage system further comprises a master node, the portrait node corresponds to a portrait blockchain, the portrait blockchain comprises at least one user portrait node, and one user portrait node corresponds to one user; the device comprises: A third receiving module is used to receive a user portrait sent by the master node, wherein the user portrait includes a target user identifier; The second query module is used to query whether the target user identifier exists in the corresponding relationship table between user portrait nodes and user identifiers; A fourth storage module is used to create a new user portrait node when the target user identifier does not exist in the corresponding relationship table between the user portrait node and the user identifier, establish a new linked list node under the new user portrait node, and store the user portrait in the new linked list node; The fifth storage module is used to establish a new linked list node under the target user portrait node corresponding to the target user identity when the target user identity exists in the correspondence table between the user portrait node and the user identity, and store the user portrait in the new linked list node.
22. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 8 to 18 when executing a program stored in a memory.
23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 8 to 18 are implemented.
