Block chain-based data sharing method and terminal

By obtaining the access status information of access users and generating access keys, the data on the blockchain is nested and encrypted, which solves the real-time synchronization and security issues during data sharing and enables each user to control the shared data. Avoid divergent spread of data.

CN118740455AActive Publication Date: 2024-10-01FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410866099.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-01
Publication Date
2024-10-01
Estimated Expiration
2044-07-01

AI Technical Summary

Technical Problem

When data is shared on the blockchain, it cannot be updated synchronously in real time effectively, resulting in divergent spread of data and affecting data security.

Method used

Obtain the access status information of the access user, generate the corresponding access key, perform nested encryption on the source user's data, and store it in the shared data block, and control data access permissions based on the access status information.

Benefits of technology

It realizes real-time management of shared data by each accessing user, avoids divergent spread of data, and improves data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740455A_ABST
    Figure CN118740455A_ABST
Patent Text Reader

Abstract

The invention discloses a block chain-based data sharing method and terminal, and the method comprises the steps: obtaining access state information configured by at least two access users, the access state information being a sharing identifier or a non-sharing identifier; respectively generating an access key corresponding to each access user according to the access state information; based on the data access relationship between the access users, performing nested encryption on target data uploaded by a source user in sequence according to an access key corresponding to each access user to obtain target encrypted data of each access user; and storing the target encrypted data in a shared data block corresponding to the access user. According to the method and the device, the shared data can be effectively managed and controlled while block link data sharing is realized, and the data security is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data sharing method and terminal based on blockchain. Background Art

[0002] At present, when data on the blockchain needs to be shared, the shared data on the blockchain can be exported to an external database under the premise of ensuring data security, and the link verification mechanism is used to ensure that the shared data is only transmitted on the current link. When the state of the shared data changes, relevant steps are taken to ensure that the shared data can be updated and synchronized accordingly. The blockchain usually sets the shared data as a shared block, and then shares the shared block with other users for access. This sharing method cannot effectively control the shared data because the status update of the shared data cannot be synchronized to all access nodes in real time, and the data is prone to divergent propagation, affecting data security. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a data sharing method and terminal based on blockchain, which can effectively control the shared data and improve data security while realizing blockchain data sharing.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A data sharing method based on blockchain, comprising:

[0006] Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier;

[0007] Generate an access key corresponding to each of the access users according to the access status information;

[0008] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users;

[0009] The target encrypted data is stored in a shared data block corresponding to the access user.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A data sharing terminal based on blockchain includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following steps when executing the computer program:

[0012] Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier;

[0013] Generate an access key corresponding to each of the access users according to the access status information;

[0014] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users;

[0015] The target encrypted data is stored in a shared data block corresponding to the access user.

[0016] The beneficial effect of the present invention is that: corresponding access keys are generated according to the access status information of each access user, and then the target data shared by the source user is nested and encrypted based on the access key of each access user, so that each access user can manage and control the shared data. When the access status information set by the access user is a shared identifier, other access users can obtain the shared data from the shared data block based on the access key of the access user. When the access status information set by the access user is a non-shared identifier, other access users cannot obtain the shared data from the shared data block. In this way, each access user can manage shared data in real time, avoid divergent data propagation, and ensure data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of a data sharing method based on blockchain provided by an embodiment of the present invention;

[0018] Figure 2 An interactive schematic diagram of a blockchain-based data sharing method provided by an embodiment of the present invention;

[0019] Figure 3 A schematic diagram of the structure of a blockchain-based data sharing terminal provided by an embodiment of the present invention;

[0020] Description of labels:

[0021] 100. A data sharing terminal based on blockchain; 101. Memory; 102. Processor. DETAILED DESCRIPTION

[0022] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0023] An embodiment of the present invention provides a data sharing method based on blockchain, comprising:

[0024] Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier;

[0025] Generate an access key corresponding to each of the access users according to the access status information;

[0026] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users;

[0027] The target encrypted data is stored in a shared data block corresponding to the access user.

[0028] From the above description, it can be seen that the beneficial effects of the present invention are: corresponding access keys are generated according to the access status information of each access user, and then the target data shared by the source user is nested and encrypted based on the access key of each access user, so that each access user can manage and control the shared data. When the access status information set by the access user is a shared identifier, other access users can obtain the shared data from the shared data block based on the access key of the access user. When the access status information set by the access user is a non-shared identifier, other access users cannot obtain the shared data from the shared data block. In this way, each access user can manage shared data in real time, avoid divergent data propagation, and ensure data security.

[0029] Furthermore, before obtaining the access status information configured by at least two access users, the method further includes:

[0030] Obtain the target data and source status information uploaded by the source user;

[0031] Generate a source key according to the identification information of the target data and the source state information;

[0032] Encrypting the target data according to the source key to obtain source encrypted data;

[0033] The target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each access user to obtain the target encrypted data of each access user, including:

[0034] The source encrypted data is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users.

[0035] From the above description, it can be seen that since the source key and other access keys are generated based on the same identification information and status information configured by different users, when the status information configured by the source user and the access user is the same, the encryption keys of all users are the same. At this time, each user's access key can decrypt all nested encrypted target encrypted data, thereby realizing data sharing. When the status information configured by the source user and the access user is different, the user's encryption keys are different. At this time, only some users' access keys can decrypt the nested encrypted target encrypted data, thereby realizing data control. At the same time, when the source status information uploaded by the source user is a non-shared identifier, and the target data is encrypted based on the source key of the non-shared identifier, even if the source key is the same as other access keys, the access user cannot access the data, that is, all access users are prohibited from accessing the data, thereby realizing security control of the shared data source.

[0036] Further, storing the target encrypted data in a shared data block corresponding to the accessing user includes:

[0037] Calculate the hash value of the target encrypted data, and generate a data identifier according to the data type, data name and the hash value of the target encrypted data;

[0038] The target encrypted data is stored in a shared data block corresponding to the access user according to the data identifier.

[0039] As can be seen from the above description, the target encrypted data is stored in the shared data block, so that other access users can access the shared data through the shared data block. At the same time, the data identifier is created through the hash value, data type and data name, which is convenient for the access user to traverse and check the specified data.

[0040] Furthermore, the nested encryption of the source encrypted data in sequence according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users includes:

[0041] In response to a data access request of a target access user, determine an i-th access user requested by the target access user, and obtain, through the shared data block, i-th target encrypted data obtained after the i-th access user performs nested encryption on the source encrypted data, where i is an integer greater than or equal to 1;

[0042] According to the access key corresponding to the target access user, the i-th target encrypted data is encrypted again to obtain the target encrypted data corresponding to the target access user.

[0043] From the above description, it can be seen that if i is 1, when the target access user requests to access the first access user, the first target encrypted data is obtained after the first access user performs nested encryption on the source encrypted data, that is, the first target encrypted data is encrypted twice in a nested manner (source key and the access key of the first access user). After obtaining the first target encrypted data, the first target encrypted data is encrypted according to the access key of the target access user. At this time, the target encrypted data corresponding to the target access user is encrypted three times in a nested manner (source key, access key of the first access user, and access key of the target access user). In this way, when the next access user needs to access the target access user, its access rights need to be determined based on the status information of the source user, the first access user, and the target access user, which effectively avoids the divergent propagation of shared data.

[0044] Furthermore, after obtaining the i-th target encrypted data obtained by the i-th access user performing nested encryption on the source encrypted data through the shared data block, the method further includes:

[0045] Decrypting the i-th target encrypted data step by step according to the access key corresponding to the i-th access user;

[0046] If the decryption is successful and the source state information is the sharing identifier, the target data uploaded by the source user is returned to the target access user;

[0047] If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data.

[0048] From the above description, it can be seen that when the state information of the source user and the access user are set as shared identifiers, the keys for nested encryption of the target encrypted data are the same, so all encryption layers can be decrypted based on the access key of the last access user, thereby obtaining the target data. When the state information of the source user or the access user has a non-shared identifier, the keys for nested encryption are different, so all encryption layers cannot be decrypted based on the access key of the last user, and the target data cannot be obtained. In this way, a data sharing ladder is formed based on the state information configured by the access user, so that data propagation is managed in the blockchain to ensure data security.

[0049] Another embodiment of the present invention provides a blockchain-based data sharing terminal, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the following steps when executing the computer program:

[0050] Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier;

[0051] Generate an access key corresponding to each of the access users according to the access status information;

[0052] Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users;

[0053] The target encrypted data is stored in a shared data block corresponding to the access user.

[0054] From the above description, it can be seen that the beneficial effects of the present invention are: corresponding access keys are generated according to the access status information of each access user, and then the target data shared by the source user is nested and encrypted based on the access key of each access user, so that each access user can manage and control the shared data. When the access status information set by the access user is a shared identifier, other access users can obtain the shared data from the shared data block based on the access key of the access user. When the access status information set by the access user is a non-shared identifier, other access users cannot obtain the shared data from the shared data block. In this way, each access user can manage shared data in real time, avoid divergent data propagation, and ensure data security.

[0055] Furthermore, before obtaining the access status information configured by at least two access users, the method further includes:

[0056] Obtain the target data and source status information uploaded by the source user;

[0057] Generate a source key according to the identification information of the target data and the source state information;

[0058] Encrypting the target data according to the source key to obtain source encrypted data;

[0059] The target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each access user to obtain the target encrypted data of each access user, including:

[0060] The source encrypted data is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users.

[0061] From the above description, it can be seen that since the source key and other access keys are generated based on the same identification information and status information configured by different users, when the status information configured by the source user and the access user is the same, the encryption keys of all users are the same. At this time, each user's access key can decrypt all nested encrypted target encrypted data, thereby realizing data sharing. When the status information configured by the source user and the access user is different, the user's encryption keys are different. At this time, only some users' access keys can decrypt the nested encrypted target encrypted data, thereby realizing data control. At the same time, when the source status information uploaded by the source user is a non-shared identifier, and the target data is encrypted based on the source key of the non-shared identifier, even if the source key is the same as other access keys, the access user cannot access the data, that is, all access users are prohibited from accessing the data, thereby realizing security control of the shared data source.

[0062] Further, storing the target encrypted data in a shared data block corresponding to the accessing user includes:

[0063] Calculate the hash value of the target encrypted data, and generate a data identifier according to the data type, data name and the hash value of the target encrypted data;

[0064] The target encrypted data is stored in a shared data block corresponding to the access user according to the data identifier.

[0065] As can be seen from the above description, the target encrypted data is stored in the shared data block, so that other access users can access the shared data through the shared data block. At the same time, the data identifier is created through the hash value, data type and data name, which is convenient for the access user to traverse and check the specified data.

[0066] Furthermore, the nested encryption of the source encrypted data in sequence according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users includes:

[0067] In response to a data access request of a target access user, determine an i-th access user requested by the target access user, and obtain, through the shared data block, i-th target encrypted data obtained after the i-th access user performs nested encryption on the source encrypted data, where i is an integer greater than or equal to 1;

[0068] According to the access key corresponding to the target access user, the i-th target encrypted data is encrypted again to obtain the target encrypted data corresponding to the target access user.

[0069] From the above description, it can be seen that if i is 1, when the target access user requests to access the first access user, the first target encrypted data is obtained after the first access user performs nested encryption on the source encrypted data, that is, the first target encrypted data is encrypted twice in a nested manner (source key and the access key of the first access user). After obtaining the first target encrypted data, the first target encrypted data is encrypted according to the access key of the target access user. At this time, the target encrypted data corresponding to the target access user is encrypted three times in a nested manner (source key, access key of the first access user, and access key of the target access user). In this way, when the next access user needs to access the target access user, its access rights need to be determined based on the status information of the source user, the first access user, and the target access user, which effectively avoids the divergent propagation of shared data.

[0070] Furthermore, after obtaining the i-th target encrypted data obtained by the i-th access user performing nested encryption on the source encrypted data through the shared data block, the method further includes:

[0071] Decrypting the i-th target encrypted data step by step according to the access key corresponding to the i-th access user;

[0072] If the decryption is successful and the source state information is the sharing identifier, the target data uploaded by the source user is returned to the target access user;

[0073] If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data.

[0074] From the above description, it can be seen that when the state information of the source user and the access user are set as shared identifiers, the keys for nested encryption of the target encrypted data are the same, so all encryption layers can be decrypted based on the access key of the last access user, thereby obtaining the target data. When the state information of the source user or the access user has a non-shared identifier, the keys for nested encryption are different, so all encryption layers cannot be decrypted based on the access key of the last user, and the target data cannot be obtained. In this way, a data sharing ladder is formed based on the state information configured by the access user, so that data propagation is managed in the blockchain to ensure data security.

[0075] The embodiments of the present invention provide a data sharing method and terminal based on blockchain, which can be applied to a local area network file sharing scenario, and can effectively control shared data and improve data security while realizing blockchain data sharing. The following is an explanation through specific embodiments:

[0076] Please refer to Figure 1 to Figure 2 , Embodiment 1 of the present invention is:

[0077] A data sharing method based on blockchain, comprising:

[0078] S1. Obtain access status information configured by at least two access users, where the access status information is a shared identifier or a non-shared identifier.

[0079] Specifically, before step S1, the method further includes:

[0080] S101, obtaining target data and source status information uploaded by a source user, wherein the source status information is a shared identifier or a non-shared identifier.

[0081] S102: Generate a source key according to the identification information of the target data and the source state information.

[0082] In some embodiments, the identification information of the target data includes a unique device identifier of the device that uploaded the target data and a unique user identifier.

[0083] In some embodiments, the steps S101 to S102 are specifically as follows: in response to the source user uploading the target data, the device attributes, user attributes and source status information of the target data are obtained through the server, and the device unique identifier and user unique identifier are respectively confirmed according to the device attributes and user attributes; finally, the server generates a source key in the form of device unique identifier-user unique identifier-source status information. For example, the shared identifier is set to 1 and the non-shared identifier is set to 0. If the source user uploads the target data A, the device unique identifier of the target data A is OS1952471DE, the user unique identifier is 91547112, and the source status information is a non-shared identifier, then the source key key0 generated by the source user is {OS1952471DE-91547112-0}.

[0084] In some embodiments, keys of different users are stored by a key center.

[0085] S103: Encrypt the target data according to the source key to obtain source encrypted data.

[0086] In some embodiments, after the key center obtains the source key from the server, it encrypts the target data according to the source key based on the encryption algorithm preset by the source user to obtain the source encrypted data, wherein the encryption algorithm is XOR, AES or DES.

[0087] S2. Generate access keys corresponding to each of the access users according to the access status information.

[0088] In some embodiments, when obtaining the access status information configured by the access user, the identification information of the target data configured by the access user is obtained synchronously, so as to generate the access key according to the identification information and the access status information. That is, the source key and the access key are generated in the same way. For example, if the access status information of the target data A configured by the current access user 1 is a shared identification, the access key key1 generated by the access user 1 is {OS1952471DE-91547112-1}.

[0089] S3. Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each access user to obtain the target encrypted data of each access user.

[0090] Specifically, step S3 includes:

[0091] S31. Perform nested encryption on the source encrypted data in sequence according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users.

[0092] Specifically, the step S31 includes:

[0093] S311. In response to a data access request from a target access user, determine the i-th access user requested by the target access user, and obtain the i-th target encrypted data after the i-th access user performs nested encryption on the source encrypted data through the shared data block, where i is an integer greater than or equal to 1.

[0094] like Figure 2As shown, in some embodiments, if the current data blockchain L includes a source user, an accessing user 1 and an accessing user 2, where the source key key0 of the source user is {OS1952471DE-91547112-0}, the access key key1 of the accessing user 1 is {OS1952471DE-91547112-1}, and the access key key2 of the accessing user 2 is {OS1952471DE-91547112-1}, then at this time, the nested encryption of the first target encrypted data of the accessing user 1 can be expressed as [key1(key0(target data))], and the nested encryption of the second target encrypted data of the accessing user 2 can be expressed as [key2(key1(key0(target data)))]. If the current access user 3 requests to access the target data, and it is determined that the user requested by access user 3 is access user 1, the first target encrypted data obtained through the shared data block is [key1(key0(target data)]. If the current access user 3 requests to access the target data, and it is determined that the user requested by access user 3 is access user 2, the second target encrypted data obtained through the shared data block is [key2(key1(key0(target data)))]. And so on.

[0095] In some embodiments, if the user requested by the target access user is the source user, the source encrypted data of the source user is obtained through the shared data block. For example, if the current access user 3 requests to access the target data, it is determined that the user requested by the access user 3 is the source user, and the source encrypted data obtained through the shared data block is [key0 (target data)].

[0096] S312. According to the access key corresponding to the target access user, the i-th target encrypted data is re-encrypted to obtain the target encrypted data corresponding to the target access user.

[0097] In some embodiments, the access key key3 of the current access user 3 is {OS1952471DE-91547112-1}. If the user that the access user 3 requests to access is the access user 1, the target encrypted data of the access user 3 is: [key3(key1(key0(target data)))]. If the user that the access user 3 requests to access is the access user 2, the target encrypted data of the access user 3 is: [key3(key2(key1(key0(target data))))]. If the user that the access user 3 requests to access is the source user, the target encrypted data of the access user 3 is: [key y3(key0(target data))]. And so on.

[0098] After step S311, the method further includes:

[0099] S3101. Decrypt the i-th target encrypted data step by step according to the access key corresponding to the i-th access user.

[0100] S3102: If the decryption is successful and the source status information is the sharing identifier, the target data uploaded by the source user is returned to the target access user.

[0101] S3103: If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data.

[0102] In some embodiments, if the current accessing user 3 obtains the first target encrypted data [key1(key0(target data)], the first target encrypted data [key1(key0(target data)] is decrypted step by step according to the access key key1 of the accessing user 1, wherein, since key1={OS1952471DE-91547112-1} and key0={OS1952471DE-91547112-0}, and the source state information is a non-shared identifier. Therefore, the decryption fails, and the accessing user 3 is prohibited from accessing the target data.

[0103] In some embodiments, if the source status information of the source user and the access status information of the accessing user 1 are both shared identifiers, the source key key0 of the source user and the access key key1 of the accessing user 1 are both {OS1952471DE-91547112-1}. At this time, if the current accessing user 3 obtains the first target encrypted data as [key1(key0(target data)], the first target encrypted data [key1(key0(target data)] is decrypted step by step according to the access key key1 of the accessing user 1. Since key1 is the same as key0 and the source status information is a shared identifier, the decryption is successful and the target data is returned to the accessing user 3.

[0104] In some embodiments, if the source status information of the source user and the access status information of the access user 1 are both shared identifiers, and the access status information of the access user 2 is a non-shared identifier, then the access key key2 of the access user 2 = {OS1952471DE-91547112-0}. At this time, if the current access user 3 obtains the second target encrypted data [key2(key1(key0(target data)))], the second target encrypted data [key2(key1(key0(target data)))] is decrypted step by step according to the access key key2 of the access user 2. Since key2 is different from key1 and key0, key2 cannot decrypt the encryption layer of key1 and key0, and the decryption fails, and the access user 3 is prohibited from accessing the target data.

[0105] In some embodiments, if the source status information of the source user and the access status information of the access user 2 are both shared identifiers, and the access status information of the access user 1 is a non-shared identifier, then the access key key1 of the access user 1 = {OS1952471DE-91547112-0}. At this time, if the current access user 3 obtains the second target encrypted data [key2(key1(key0(target data)))], the second target encrypted data [key2(key1(key0(target data)))] is decrypted step by step according to the access key key2 of the access user 2. Since key1 is different from key2 and key0, key2 cannot decrypt the encryption layer of key1, and the decryption fails, and the access user 3 is prohibited from accessing the target data.

[0106] It can be seen that whether the target access user can access the target data depends on the source status information of the source user and the access status information of the user nested by the requested user. That is, when the source status information of the source user is set to non-shared, all access users cannot access the target data, realizing the data source control of shared data. When the access status information of user a is set to non-shared, only users whose data access process passes through user a cannot access the target data, realizing partial permission control of shared data. In addition, the dissemination range of the current target data can be determined based on the number of nested encryption layers, effectively avoiding the divergent dissemination of data.

[0107] S4. Storing the target encrypted data in a shared data block corresponding to the accessing user.

[0108] Specifically, step S4 includes:

[0109] S41. Calculate a hash value of the target encrypted data, and generate a data identifier according to the data type, data name and hash value of the target encrypted data.

[0110] In some embodiments, the data identifier may be specifically {music-What you want.mp3-92fed86f2502ba48eb4eadf09811886ebad914cc}.

[0111] S42: Store the target encrypted data in a shared data block corresponding to the accessing user according to the data identifier.

[0112] In some embodiments, a block status identifier can be created so that target encrypted files with the same block status identifier can be stored in the same interval, which facilitates data traversal access and improves search efficiency. The block status identifier is used to indicate whether the target encrypted data is shared, 1 indicates shared, and 0 indicates non-shared. Specifically, the target encrypted data list name in the shared data block is: {music-What yo u want.mp3-92fed86f2502ba48eb4eadf09811886ebad914cc-1}, {file-1.exe-f5785f9d76b77f604f49f881c078abec26602062-1}, etc.

[0113] Please refer to Figure 3 , Embodiment 2 of the present invention is:

[0114] A blockchain-based data sharing terminal 100 includes a memory 101, a processor 102, and a computer program stored in the memory 101 and running on the processor 102. When the processor 102 executes the computer program, each step of the blockchain-based data sharing method in the above-mentioned embodiment 1 is implemented.

[0115] In summary, the present invention provides a data sharing method and terminal based on blockchain, which generates corresponding access keys according to the access status information of each access user, and then nests and encrypts the target data shared by the source user based on the access key of each access user to form a data sharing ladder, so that data propagation can be managed according to the configuration of each access user in the blockchain to ensure data security. When the access status information set by the access user is a shared identifier, other access users can obtain shared data from the shared data block based on the access key of the access user. When the access status information set by the access user is a non-shared identifier, other access users cannot obtain shared data from the shared data block. In this way, each access user can manage shared data in real time to avoid divergent data propagation. At the same time, based on the source status information configured by the source user who uploaded the target data, the access rights of all access users can be directly controlled to ensure the data security of the source user.

[0116] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A data sharing method based on blockchain, characterized in that: include: Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier; Generate an access key corresponding to each of the access users according to the access status information; Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users; The target encrypted data is stored in a shared data block corresponding to the access user.

2. A data sharing method based on blockchain according to claim 1, characterized in that: Before obtaining the access status information configured by at least two access users, the method further includes: Obtain the target data and source status information uploaded by the source user; Generate a source key according to the identification information of the target data and the source state information; Encrypting the target data according to the source key to obtain source encrypted data; The target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each access user to obtain the target encrypted data of each access user, including: The source encrypted data is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users.

3. A data sharing method based on blockchain according to claim 1, characterized in that: The storing the target encrypted data in a shared data block corresponding to the access user comprises: Calculate the hash value of the target encrypted data, and generate a data identifier according to the data type, data name and the hash value of the target encrypted data; The target encrypted data is stored in a shared data block corresponding to the access user according to the data identifier.

4. A data sharing method based on blockchain according to claim 2, characterized in that: The nested encryption of the source encrypted data in sequence according to the access key corresponding to each access user to obtain the target encrypted data of each access user comprises: In response to a data access request of a target access user, determine an i-th access user requested by the target access user, and obtain, through the shared data block, i-th target encrypted data obtained after the i-th access user performs nested encryption on the source encrypted data, where i is an integer greater than or equal to 1; According to the access key corresponding to the target access user, the i-th target encrypted data is encrypted again to obtain the target encrypted data corresponding to the target access user.

5. A data sharing method based on blockchain according to claim 4, characterized in that: After obtaining the i-th target encrypted data obtained by the i-th access user performing nested encryption on the source encrypted data through the shared data block, the method further includes: Decrypting the i-th target encrypted data step by step according to the access key corresponding to the i-th access user; If the decryption is successful and the source state information is the sharing identifier, the target data uploaded by the source user is returned to the target access user; If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data.

6. A data sharing terminal based on blockchain, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Acquire access status information configured by at least two access users, wherein the access status information is a shared identifier or a non-shared identifier; Generate an access key corresponding to each of the access users according to the access status information; Based on the data access relationship between the access users, the target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users; The target encrypted data is stored in a shared data block corresponding to the access user.

7. A blockchain-based data sharing terminal according to claim 6, characterized in that: Before obtaining the access status information configured by at least two access users, the method further includes: Obtain the target data and source status information uploaded by the source user; Generate a source key according to the identification information of the target data and the source state information; Encrypting the target data according to the source key to obtain source encrypted data; The target data uploaded by the source user is sequentially nested and encrypted according to the access key corresponding to each access user to obtain the target encrypted data of each access user, including: The source encrypted data is sequentially nested and encrypted according to the access key corresponding to each of the access users to obtain the target encrypted data of each of the access users.

8. A blockchain-based data sharing terminal according to claim 6, characterized in that: The storing the target encrypted data in a shared data block corresponding to the access user comprises: Calculate the hash value of the target encrypted data, and generate a data identifier according to the data type, data name and the hash value of the target encrypted data; The target encrypted data is stored in a shared data block corresponding to the access user according to the data identifier.

9. A blockchain-based data sharing terminal according to claim 7, characterized in that: The nested encryption of the source encrypted data in sequence according to the access key corresponding to each access user to obtain the target encrypted data of each access user comprises: In response to a data access request of a target access user, determine an i-th access user requested by the target access user, and obtain, through the shared data block, i-th target encrypted data obtained after the i-th access user performs nested encryption on the source encrypted data, where i is an integer greater than or equal to 1; According to the access key corresponding to the target access user, the i-th target encrypted data is encrypted again to obtain the target encrypted data corresponding to the target access user.

10. A data sharing terminal based on blockchain according to claim 9, characterized in that: After obtaining the i-th target encrypted data obtained by the i-th access user performing nested encryption on the source encrypted data through the shared data block, the method further includes: Decrypting the i-th target encrypted data step by step according to the access key corresponding to the i-th access user; If the decryption is successful and the source state information is the sharing identifier, the target data uploaded by the source user is returned to the target access user; If the decryption fails or the source state information is a non-shared identifier, the target access user is prohibited from accessing the target data.

Citation Information

Patent Citations

  • Data transaction system and method

    CN112732829A

  • Block chain storage scheme based on DHT and IPFS

    CN116522383A

  • Data security sharing method and system based on multi-permission attribute-based encryption

    CN116668072A

  • Hierarchical encryption privacy protection method based on block chain

    CN116842573A

  • Method of manufacturing horse bean enzyme and horse bean enzyme manufactured by using the same

    KR1020210115946A