Data access method, device, electronic device and storage medium

By storing attribute-encrypted files in blocks and performing access verification on the previous data block, the security risks of CP-ABE encrypted data during attacks are solved, the security and difficulty of the data are improved, and the data is not easily hacked when intruded. Crack.

CN117056960BActive Publication Date: 2024-09-27CHINA MOBILE INTERNET CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310849459.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2024-09-27
Estimated Expiration
2043-07-11

AI Technical Summary

Technical Problem

Data encrypted by CP-ABE still has security risks when attacked, especially when illegal attackers obtain part of the data and then crack subsequent data.

Method used

By storing attribute-encrypted files in blocks, and verifying in the storage node whether the data requester has accessed the previous data block, access to the target data block is only allowed if it has been accessed, thereby increasing the difficulty for intruders to obtain all data blocks. , improve data security.

Benefits of technology

Through block storage and access verification, data security is improved, the risk of data leakage and cracking is reduced, and it is ensured that the storage node cannot obtain all the data of the attribute-encrypted file at once when it is invaded.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117056960B
    Figure CN117056960B
Patent Text Reader

Abstract

The present invention proposes a data access method, device, electronic device and storage medium, which relate to the field of communication technology. The method includes: a storage node receives a data acquisition request for a target data block sent by a data requester; based on the storage node information and index information corresponding to the target data block in the data acquisition request, verify whether the data requester has accessed the previous data block of the target data block; if the data requester has accessed the previous data block, the data requester is allowed to access the target data block; if the data requester has not accessed the previous data block, the data requester is denied access to the target data block. The present invention stores attribute encrypted files in blocks, which increases the difficulty for intruders to obtain all data blocks and improves data security; and further ensures data security by performing access verification on the previous data block.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a data access method, device, electronic equipment and storage medium. Background Art

[0002] Ciphertext Policy Attribute Based Encryption (CP-ABE) is a fuzzy encryption technology. The ciphertext access policy is formulated by the data encryption party. Only when the user's attributes conform to the ciphertext access structure can the ciphertext be decrypted. It can be applied in fields such as cloud storage sharing and permission control to achieve one-to-many encryption.

[0003] However, data encrypted by CP-ABE still has security risks when it is attacked. Summary of the invention

[0004] The present invention provides a data access method, device, electronic device and storage medium, aiming to solve one of the technical problems in the related art at least to a certain extent.

[0005] The technical solution of the present invention is as follows:

[0006] To achieve the above object, a first embodiment of the present invention provides a data access method, comprising:

[0007] Receive a data acquisition request sent by a data requester, wherein the data acquisition request is used to request to acquire a target data block, the target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes;

[0008] Verifying, according to the storage node information and index information corresponding to the target data block in the data acquisition request, whether the data requester has accessed a previous data block of the target data block;

[0009] If the data requesting party has accessed the previous data block, the data requesting party is allowed to access the target data block;

[0010] If the data requester has not accessed the previous data block, the data requester is denied access to the target data block.

[0011] To achieve the above object, a second aspect of the present invention provides another data access method, comprising:

[0012] Send a data acquisition request to the storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file;

[0013] The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block.

[0014] To achieve the above-mentioned purpose, a third aspect of the present invention provides a data access device, comprising:

[0015] A receiving module, configured to receive a data acquisition request sent by a data requester, wherein the data acquisition request is used to request acquisition of a target data block, the target data block is a non-first data block among multiple data blocks of an attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes;

[0016] A verification module, used to verify whether the data requester has accessed a previous data block of the target data block according to the storage node information and index information corresponding to the target data block in the data acquisition request;

[0017] an allowing module, used for allowing the data requesting party to access the target data block if the data requesting party has accessed the previous data block;

[0018] The rejection module is used to reject the data requesting party's access to the target data block if the data requesting party has not accessed the previous data block.

[0019] To achieve the above object, a fourth aspect of the present invention provides another data access device, comprising:

[0020] A sending module, used to send a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file;

[0021] The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block.

[0022] To achieve the above-mentioned purpose, the fifth aspect of the present invention proposes an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to implement a data access method as proposed in the first aspect of the present invention, or to implement a data access method as proposed in the second aspect of the present invention.

[0023] In order to achieve the above-mentioned objectives, the sixth aspect embodiment of the present invention proposes a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device is enabled to execute a data access method proposed in the first aspect embodiment of the present invention, or execute a data access method proposed in the second aspect embodiment of the present invention.

[0024] The technical solution provided by the embodiments of the present invention brings at least the following beneficial effects:

[0025] Multiple data blocks of attribute encrypted files are distributedly stored in corresponding storage nodes. The storage nodes receive data acquisition requests sent by data requesters for requesting target data blocks. According to the storage node information and index information corresponding to the target data blocks in the data acquisition request, it is verified whether the data requester has accessed the previous data block of the target data block. If the data requester has accessed the previous data block, the data requester is allowed to access the target data block. If the data requester has not accessed the previous data block, the data requester is denied access to the target data block. The embodiment of the present invention stores attribute encrypted files in blocks to ensure that the storage node cannot obtain all the data of the attribute encrypted file at one time when it is invaded, which increases the difficulty for the invader to obtain all the data blocks and improves the security of the data. And by performing access verification on the previous data block, data security is further guaranteed.

[0026] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0028] Figure 1 A flow chart of a data access method provided by an embodiment of the present invention;

[0029] Figure 2 A flowchart of another data access method provided by an embodiment of the present invention;

[0030] Figure 3 A schematic diagram of accessing a structure tree provided by an embodiment of the present invention;

[0031] Figure 4 A schematic diagram of a data block provided by an embodiment of the present invention;

[0032] Figure 5 A centralized attribute encrypted file access record diagram provided by an embodiment of the present invention;

[0033] Figure 6 A schematic diagram of a flow chart of another data access method provided by an embodiment of the present invention;

[0034] Figure 7 A schematic diagram of a flow chart of another data access method provided by an embodiment of the present invention;

[0035] Figure 8 A signaling interaction diagram of a data access method provided by an embodiment of the present invention;

[0036] Fig. 9 An access record flow chart of a data access method provided by an embodiment of the present invention;

[0037] Fig.10 A schematic diagram of the structure of a data access device provided by an embodiment of the present invention;

[0038] Fig.11 A schematic diagram of the structure of another data access device provided by an embodiment of the present invention;

[0039] Fig.12 A block diagram of an electronic device 1200 provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0040] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0041] The data access method and device according to the embodiment of the present invention are described below with reference to the accompanying drawings.

[0042] The one-to-many encryption feature of CP-ABE can solve the space occupation problem caused by multiple asymmetric encryption of the same file in cloud storage, and at the same time ensure that the data exists in an encrypted form, which has many application scenarios in cloud data sharing and permission control. When files encrypted by CP-ABE are attacked by malicious attacks, there is a risk of data leakage. By storing encrypted files in blocks, the difficulty of data acquisition can be increased to a certain extent, reducing the risk of leakage; however, if illegal attackers have already obtained part of the data, there is still a risk of cracking subsequent data.

[0043] In view of the above problems, an embodiment of the present invention provides a data access method to improve data security. Figure 1 The data access method of the embodiment of the present invention is implemented by a data access device provided by the embodiment of the present invention, which can be set in an electronic device to implement the data access method of the embodiment of the present invention.

[0044] like Figure 1 As shown, the data access method of the embodiment of the present invention is a processing flow of a storage node, and the method includes the following steps:

[0045] Step 101, receiving a data acquisition request sent by a data requester, wherein the data acquisition request is used to request acquisition of a target data block, the target data block is a non-first data block among multiple data blocks of an attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes.

[0046] In the embodiment of the present invention, when the data requester requests to obtain the target data block, a data acquisition request is generated and sent to the storage node storing the target data block, so as to request to obtain the target data block in the storage node.

[0047] The data requester is a user who requests to access the attribute encrypted file, such as user 1, user 2, etc.

[0048] The attribute encryption file is an encrypted ciphertext provided by the data provider, including multiple data blocks.

[0049] The storage node is used to receive data acquisition requests sent by the data requester.

[0050] Step 102: verify whether the data requester has accessed the previous data block of the target data block according to the storage node information and index information corresponding to the target data block in the data acquisition request.

[0051] In an embodiment of the present invention, the data acquisition request carries the storage node information and index information corresponding to the target data block requested to be acquired. After receiving the data acquisition request, the storage node verifies the data requester according to the storage node information and index information to determine whether the data requester has accessed the previous data block of the target data block.

[0052] Step 103: If the data requesting party has accessed the previous data block, the data requesting party is allowed to access the target data block.

[0053] In the embodiment of the present invention, after the storage node verifies the data requester, if it is determined that the data requester has accessed the previous data block of the target data block, the verification passes and the storage node allows the data requester to access the target data block.

[0054] Step 104: If the data requester has not accessed the previous data block, the data requester is denied access to the target data block.

[0055] In the embodiment of the present invention, after the storage node verifies the data requester, if it is determined that the data requester has not accessed the previous data block of the target data block, the verification fails and the storage node denies the data requester access to the target data block.

[0056] This embodiment provides a data access method, in which multiple data blocks of an attribute encrypted file are distributedly stored in corresponding storage nodes, and the storage node receives a data acquisition request sent by a data requester for requesting a target data block; based on the storage node information and index information corresponding to the target data block in the data acquisition request, it verifies whether the data requester has accessed the previous data block of the target data block; if the data requester has accessed the previous data block, the data requester is allowed to access the target data block; if the data requester has not accessed the previous data block, the data requester is denied access to the target data block. The embodiment of the present invention stores the attribute encrypted file in blocks to ensure that the storage node cannot obtain all the data of the attribute encrypted file at once when it is invaded, which increases the difficulty for the intruder to obtain all the data blocks and improves the security of the data; and further ensures data security by performing access verification on the previous data block.

[0057] In order to clearly explain the previous embodiment, this embodiment provides another data access method. Figure 2 A schematic flow chart of another data access method provided by an embodiment of the present invention.

[0058] like Figure 2 As shown, the data access method of the embodiment of the present invention is a processing flow of a storage node. Figure 1 Based on the illustrated embodiment, the method may include the following steps:

[0059] Step 201, encrypt the received multiple blocks to obtain encrypted data blocks.

[0060] Specifically, the receiving data provider divides the attribute encrypted file into multiple blocks; allocates storage nodes and indexes to each block to determine the storage node information and index information of each block; for any block, encrypts the storage node information and index information of the current block and its next adjacent block to obtain an encrypted data block; stores each data block in a corresponding storage node; and publishes the storage node information and index information of the first data block among the multiple data blocks.

[0061] In the embodiment of the present invention, the data provider may encrypt the file to be encrypted by CP-ABE to obtain an attribute encrypted file. The specific steps include:

[0062] 1. Construct an access tree T. The access tree defines the attribute conditions that the decryption user must meet. The leaf nodes of the tree are attributes, the non-leaf nodes x are threshold gates, and the number of child nodes num is used. x and threshold k x To describe, and 0≤k x ≤num x When k x =1, it is an OR gate; when k x =num x , which is an AND gate.

[0063] 2. Choose a cyclic group of prime order p with a generator g Choose two random indices The system public key is: g,h=g β ,e(g,g) α , the system private key is: MK=(β,g α ).in, is the integer domain, e(g,g) is a bilinear map, is a bilinear group of prime order p, and g is The generator of .

[0064] 3. Choose a polynomial q for each node in the visit tree y (x), starting from the root node R, randomly select a And set q y (0) = s, that is, when the unknown number x of the polynomial = 0, q y (0) is S. For any other node, q y The value of (0) is calculated based on the polynomial defined by the parent node.

[0065] 4. Let Y be the set of leaf nodes in the visit tree. The ciphertext is constructed by visiting the tree as follows:

[0066]

[0067] Among them, CT is the encrypted ciphertext; T is the access tree; W is the plaintext, that is, the file to be encrypted; s is the random number of the root node; att(y) is the attribute associated with the leaf node y; H function is a hash function that can randomly map any attribute to An element of a group; C.C y and C y′ They are all ciphertext parameters, which are expressed as the result calculated by other parameters.

[0068] 5. Take a set of attributes S as the input of the CP-ABE algorithm and randomly select one Pick a random number for any attribute j∈S Output the user's private key represented by the set S: SK = Among them, D j and D j ′ They are all key parameters, which are calculated from other parameters.

[0069] Furthermore, the attribute encrypted file is segmented to obtain multiple blocks, and the segmentation process specifically includes:

[0070] right Data is divided into blocks according to the number of subtrees of the access control tree T. Figure 3 As shown, the user can select the layer below the root R as the basis for block division. For example, if the L1 layer is selected, the number of data blocks N=2; if the L2 layer is selected, the number of data blocks N=4.

[0071] Furthermore, multiple blocks are encrypted, and the specific process includes:

[0072] Will After N blocks, we get According to the above CP-ABE encryption process, Packaged as CT i Uploaded to the blockchain, where is the i-th block, is the i-th encrypted block.

[0073] By dividing the data into blocks, it can be ensured that when the storage node of the blockchain is attacked and data is leaked, the attacker cannot obtain complete user data, which can improve data security.

[0074] In the embodiment of the present invention, the blockchain node receives the block data CT uploaded by the user. i After that, the block data is randomly assigned a storage node Node and a data block index Index. Each block data holds the storage node Node and data block index Index of the next block data to form the following Figure 4 The data block B shown i .

[0075] Furthermore, the data block is encrypted, and the specific process includes:

[0076] The blockchain uses the subtree layer number L set by the user to encrypt the block data in the order of the data blocks, and constructs the ciphertext by accessing the tree as follows:

[0077]

[0078] in, For data block B i The ciphertext of i A random value stored for the subtree root r; Y i T i The collection of leaf nodes.

[0079] Store each encrypted data block in the corresponding storage node and index the data i Recorded in the data index table of the node. Among them, the storage node is on the blockchain, and the storage node Node1 and data block index Index1 of the first data block B1 are published as the access entry of the attribute encrypted file through the blockchain.

[0080] On the basis of block data encryption, the data blocks with random storage nodes and data block indexes are encrypted twice, which can hide the index and storage node values ​​in the data and improve the security of data storage. In addition, the block data also uses attribute encryption, which will not change the original fuzzy characteristics of attribute encryption.

[0081] Furthermore, the access entry published to the outside is mapped with the attribute encrypted file uploaded by the data provider, and a storage space is established on the blockchain. The file read times corresponding to the storage node Node1 and the data block index Index1 of the first data block B1 are set to 0, the reading user list is empty, and a hash value sequence table is established. The hash value sequence table includes multiple hash values ​​arranged in the sorting order of the corresponding data blocks, and each hash value is obtained by hashing the storage node information and index information of the corresponding data block.

[0082] As a possible implementation, a hash operation is performed on the storage node Node corresponding to any data block and the sum of the data block index Index Node+Index to obtain a corresponding hash value, and each hash value is recorded in sequence in a hash value sequence table.

[0083] Step 202, receiving a data acquisition request sent by a data requester, wherein the data acquisition request is used to request acquisition of a target data block, the target data block is a non-first data block among multiple data blocks of an attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes.

[0084] In the embodiment of the present invention, the specific process of step 202 can refer to the relevant description of step 101 in the above embodiment, which will not be repeated here.

[0085] Step 203, based on the storage node information and index information corresponding to the target data block in the data acquisition request, verify whether the data requester has accessed the previous data block of the target data block, if so, execute steps 204 and 205, otherwise execute step 206.

[0086] In an embodiment of the present invention, after the data requester sends a data acquisition request, the storage node receives the data acquisition request, analyzes the data acquisition request, extracts the storage node information and index information corresponding to the target data block requested to be acquired, and based on the extracted storage node information, index information and identity information of the data requester, the blockchain verifies the data acquisition request and verifies the legitimacy of the extracted storage node Node, data block index Index and the identifier of the data requester (such as user ID).

[0087] Furthermore, after the blockchain verifies the data requester, it records the access to the target data block based on the storage node information and index information carried in the data acquisition request.

[0088] The access record of the data requester to the target data block includes: the identity information of the data requester, the storage node Node of the target data block accessed by the data requester, the data block index Index and the first hash value of the target data block.

[0089] In the embodiment of the present invention, a hash operation is performed according to the storage node information and index information carried in the data acquisition request to obtain a first hash value corresponding to the target data block.

[0090] As a possible implementation manner, a hash operation is performed on the sum of the storage node Node of the target data block and the data block index Index Node+Index to obtain a first hash value corresponding to the target data block.

[0091] In the embodiment of the present invention, after the first hash value is obtained, the first hash value is added to the user access record of the data requester.

[0092] Furthermore, if the first hash value is the hash value of the first data block, the blockchain establishes a user access record.

[0093] If the first hash value is not the hash value of the first data block, then according to the hash value sequence table, it is queried in the user access record whether there is a second hash value before the first hash value; if the second hash value exists in the user access record, it is confirmed that the data requester has accessed the previous data block of the target data block; if the second hash value does not exist in the user access record, it is confirmed that the data requester has not accessed the previous data block of the target data block.

[0094] Step 204: If the data requester has accessed the previous data block, the data requester is allowed to access the target data block.

[0095] In the embodiment of the present invention, when it is confirmed that the data requester has accessed the previous data block, the verification passes and the blockchain allows access to the target data block.

[0096] Furthermore, if the data requester has accessed the previous data block, the blockchain records at least one of the data requester's identifier, the storage node information of the target data block, and the index information.

[0097] Furthermore, the data requester reads the target data block And decrypt it with the user's private key SK to get the decrypted block CT of the target data block i and the Node and Index of the next data block so that the data requester can send a data acquisition request for the next data block.

[0098] The data requester obtains the decrypted block CT of the target data block i After obtaining the Node and Index of the next data block, a data acquisition request for the next data block can be generated and sent to the corresponding storage node. After being verified by the blockchain, the data requester is allowed to access the next data block until the last data block is obtained.

[0099] It should be noted that if the Node and Index of the next data block are not obtained after decrypting the target data block, the target data block is considered to be the last data block.

[0100] Furthermore, after obtaining all the blocks, the data requester locally splices the data blocks to obtain the complete ciphertext CT (i.e., the attribute encrypted file), and then decrypts it using the user's private key SK to obtain the original data W (i.e., the original file to be encrypted).

[0101] Step 205: The target data block is the last data block among the multiple data blocks, and the number of access times of the attribute encrypted file is updated.

[0102] In an embodiment of the present invention, when the target data block read by the user is the last data block, that is, the first hash value obtained is the last data in the hash value sequence table, the blockchain will increase the number of accesses of the attribute encrypted file by A+1, and add the identifier of the data requester to the access user list.

[0103] Furthermore, after the encrypted data is published, due to statistical or operational needs, the data publisher needs to know how many users have accessed the data they have published. In the existing centralized attribute encryption file management system, the data access records are recorded by a centralized organization and provided to the data publisher, such as Figure 5As shown in the figure, DU (Data User) represents the data requester and DO (Data Owner) represents the data provider. However, the centralized data statistics method is not credible and can be easily tampered with. The interests of users cannot be effectively protected and users cannot fully trust the data, resulting in low user participation and enthusiasm.

[0104] In an embodiment of the present invention, the data provider can read the access count A and user list data corresponding to the attribute encrypted file parameters Node1 and Index1 on the blockchain to obtain the access count and access user data of the attribute encrypted file.

[0105] The blockchain records the number of visits and access users of the data requester, and utilizes the decentralized, tamper-proof and trustworthy characteristics of the blockchain to ensure data security while also ensuring the credibility of data access records.

[0106] Step 206: If the data requester has not accessed the previous data block, the data requester is denied access to the target data block.

[0107] In the embodiment of the present invention, if the second hash value does not exist in the user access record, the user's current access is invalid and the target data block cannot be obtained.

[0108] Every time a data requester accesses a data block, the blockchain will record the identity of the data requester and verify the Node i and Index i Whether it is legal or not, even if the data requester obtains part of the data block illegally, since there is no legal access record of the data requester's previous data block on the blockchain, the data requester's illegal access will be rejected, ensuring the security of the data.

[0109] In an embodiment of the present invention, a storage node receives a data acquisition request for a target data block sent by a data requester; based on the storage node information and index information corresponding to the target data block in the data acquisition request, the storage node verifies whether the data requester has accessed the previous data block of the target data block; if the data requester has accessed the previous data block, the data requester is allowed to access the target data block; if the data requester has not accessed the previous data block, the data requester is denied access to the target data block; when the target data block is the last data block among multiple data blocks, the number of accesses to the attribute encrypted file is updated. In an embodiment of the present invention, the number of accesses and access users of the data accesser are recorded through the blockchain, while increasing the difficulty for an intruder to obtain all data blocks and further ensuring data security by performing access verification of the previous data block, and the credibility of the data access record is ensured by utilizing the decentralized, tamper-proof and trustworthy characteristics of the blockchain.

[0110] Figure 6 A schematic flow chart of another data access method provided by an embodiment of the present invention.

[0111] like Figure 6 As shown, the data access method of the embodiment of the present invention is an access process of a data requester, and the method may include the following steps:

[0112] Step 601: Send a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file.

[0113] Among them, the target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used for the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block.

[0114] In the embodiment of the present invention, the attribute encryption file is an encrypted ciphertext provided by a data provider, including multiple data blocks, and the multiple data blocks are distributed and stored in corresponding storage nodes.

[0115] When a data requester requests access to a target data block, a data acquisition request is generated according to the storage node information and index information corresponding to the target data block, and the data acquisition request is sent to the storage node.

[0116] The data requester is a user who requests to access the attribute encrypted file, such as user 1, user 2, etc.

[0117] The storage node is used to receive a data acquisition request sent by a data requester and verify whether the data requester is allowed to access the target data block.

[0118] In an embodiment of the present invention, after a data requester sends a data acquisition request to a storage node, the storage node verifies whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information carried in the data acquisition request. If the data requester has accessed the previous data block, the data requester is allowed to access the target data block; if the data requester has not accessed the previous data block, the data requester is denied access to the target data block.

[0119] An embodiment of the present invention provides a data access method, in which a data requester sends a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encrypted file. The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and multiple data blocks are distributed and stored in the corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block. In the embodiment of the present invention, the data requester sends a data acquisition request to pass the data access verification of the storage node, so that the data requester can legally and orderly obtain the data in the target data block, thereby ensuring the security of the data.

[0120] Figure 7 A schematic flow chart of another data access method provided by an embodiment of the present invention.

[0121] like Figure 7 As shown, the data access method of the embodiment of the present invention is an access process of the data requester. Figure 6 Based on the illustrated embodiment, the method may include the following steps:

[0122] Step 701: Send a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file.

[0123] In the embodiment of the present invention, the attribute encryption file is an encrypted ciphertext provided by a data provider, including multiple data blocks, and the multiple data blocks are distributed and stored in corresponding storage nodes.

[0124] The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes.

[0125] When a data requester requests access to a target data block, a data acquisition request is generated according to the storage node information and index information corresponding to the target data block, and the data acquisition request is sent to the storage node.

[0126] The data requester is a user who requests to access the attribute encrypted file, such as user 1, user 2, etc.

[0127] In an embodiment of the present invention, the process of obtaining the target data block includes:

[0128] The publishing information of the storage node is obtained, wherein the publishing information includes the storage node information and index information of the first data block of the attribute encrypted file.

[0129] In an embodiment of the present invention, the storage node is on the blockchain, and the storage node Node1 and the data block index Index1 of the first data block B1 in the attribute encrypted file are published as the access entry of the attribute encrypted file through the blockchain.

[0130] The data requester obtains the storage node information and index information of the first data block through the access entry published by the storage node; based on the storage node information and index information of the first data block, accesses the storage node corresponding to the first data block to obtain the first data block; decrypts the first data block to obtain the decrypted blocks of the first data block, as well as the storage node information and index information corresponding to the next data block after the first data block.

[0131] The data access party uses the user private key SK to decrypt the first data block, and obtains the decrypted block CT1 of the first data block and the storage node information Node2 and index information Index2 of the next data block after the first data block, so that the data request party can send a data acquisition request for the next data block.

[0132] The data acquisition request for the next data block is sent to the corresponding storage node to obtain the next data block after the first data block, and it is decrypted using the user private key SK to obtain the block CT2 of the next data block after the first data block, the next data block storage node information Node3 and index information Index3 of the next data block, and so on, until the target data block is obtained.

[0133] It should be noted that the user private key SK is generated during the encryption process of the attribute encrypted file based on the attribute conditions that the data access party must meet when decrypting.

[0134] Step 702: If the storage node allows the data requester to access the target data block, the target data block is decrypted to obtain a decrypted sub-block; if the decrypted target data block does not contain the storage node information and index information corresponding to the next data block, the target data block is taken as the last data block among the multiple data blocks, and the decrypted sub-blocks are merged according to the access order to obtain an attribute encrypted file.

[0135] In the embodiment of the present invention, when the storage node confirms that the data requester has accessed the previous data block, the verification passes and the data requester is allowed to access the target data block.

[0136] In the case that the storage node allows the data requester to access the target data block, the data requester decrypts the target data block to obtain decrypted blocks.

[0137] In an embodiment of the present invention, the data requester uses the user private key SK to decrypt the target data block to obtain the blocks corresponding to the target data block, as well as the storage node information and index information of the next data block of the target data block stored in the target data block.

[0138] Furthermore, based on the storage node information and index information of the next data block of the target data block, a data acquisition request for the next data block of the target data block is generated, and the data blocks are acquired and decrypted in turn to obtain the blocks corresponding to each data block until the block corresponding to the last data block is obtained.

[0139] If the storage node information and index information of the next data block are not obtained after decrypting the target data block, it is considered that the target data block is the last data block.

[0140] In the embodiment of the present invention, the obtained blocks are merged according to the access order to obtain the attribute encrypted file.

[0141] Furthermore, the data access party can decrypt the attribute encrypted file using the user private key SK to obtain the original data.

[0142] The embodiment of the present invention provides a data access method, in which a data requester sends a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encrypted file; if the storage node allows the data requester to access the target data block, the target data block is decrypted to obtain the decrypted blocks; if the decrypted target data block does not contain the storage node information and index information corresponding to the next data block, the target data block is used as the last data block among multiple data blocks, and the decrypted blocks are merged according to the access order to obtain the attribute encrypted file. The embodiment of the present invention can send a data acquisition request to make the storage node perform data access verification on the previous data block for the data requester, and obtain the data in the target data block when the storage node allows access, thereby obtaining the attribute encrypted file; the data requester obtains data legally and orderly, and ensures the security of the data.

[0143] To clearly illustrate the data access method of the embodiment of the present invention, the following is combined with Figure 8 The signaling interaction diagram shown in FIG. 1 is used to describe an exemplary implementation of the data access method of an embodiment of the present invention. Figure 8 As shown, the data access method of the embodiment of the present invention includes:

[0144] Step 801: A data requester accesses an access entry published by a storage node; the access entry is the storage node and data block index of the first data block in an attribute encrypted file.

[0145] Step 802: The storage node sends the storage node information and index information of the first data block to the data requester.

[0146] Step 803: The data requester sends a first data acquisition request to the blockchain. The first data acquisition request includes the identifier of the data requester, the storage node information of the first data block, and the index information.

[0147] Step 804: The blockchain performs data verification on the first data acquisition request, and establishes a user access record after successful verification.

[0148] Step 805: After successfully verifying the first data acquisition request, the blockchain sends the first data block to the data requester.

[0149] Step 806: The data requesting party decrypts the first data block, and obtains the blocks corresponding to the first data block and the storage node information and index information of the next data block.

[0150] Step 807: The data requester sends a second data acquisition request to the blockchain. The second data acquisition request includes the identifier of the data requester, the storage node information and index information of the next data block of the first data block.

[0151] Step 808: The blockchain performs data verification on the second data acquisition request, and after successful verification, records the data requester's access to the next data block of the first data block.

[0152] Step 809: After successfully verifying the second data acquisition request, the blockchain sends the next data block of the first data block to the data requester.

[0153] Step 810: The data requesting party decrypts the next data block of the first data block to obtain the blocks corresponding to the next data block of the first data block.

[0154] In step 811, the data requesting party concatenates the sub-block corresponding to the first data block and the sub-block corresponding to the next data block of the first data block to obtain an attribute encrypted file, and decrypts the attribute encrypted file to obtain the original file.

[0155] Step 812: The data provider accesses the access entry published by the access storage node.

[0156] Step 813: The storage node sends the storage node information and index information of the first data block to the data provider.

[0157] Step 814: The data provider sends a read request to the blockchain, where the read request is used to read the access record of the storage node information and index information of the first data block.

[0158] Step 815: The blockchain sends the access count and access user data to the data provider.

[0159] It should be noted that in the above exemplary embodiment, the number of blocks corresponding to the attribute encrypted file is 2. In other embodiments, the number of blocks N can also be other integers. When the number of blocks is other integers, the data requester needs to send N data acquisition requests to the blockchain in the order of data blocks until the block corresponding to the last data block is obtained, and the decrypted blocks are merged according to the access order to obtain the attribute encrypted file.

[0160] In the case where the number of blocks is another integer, as another exemplary embodiment, see Fig. 9 , the process of obtaining access records includes:

[0161] The data provider obtains the ciphertext (i.e., the attribute encrypted file) by encrypting the original data by attributes, and divides the attribute encrypted file into CT_1, CT_2, ..., CT_NB, a total of NB blocks, and makes each block data hold the storage node and data block index of the next block data to form a data block. For example, block CT_1 combines the storage node Node_2 and data block index Index_2 of block CT_2 to form data block B_1; block CT_2 combines the storage node Node_3 and data block index Index_3 of block CT_3 to form data block B_2. Random storage nodes and data block indexes are assigned to data blocks, such as Fig. 9 The M nodes shown may have a different number of nodes from the number of data blocks. The data blocks are stored in corresponding storage nodes on the blockchain. The storage node Node1 and the data block index Index1 of the first data block B1 are published as access entries for attribute encrypted files through the storage nodes on the blockchain.

[0162] The data requester reads the first data block through the access entry, decrypts the first data block to obtain the corresponding block CT_1 and the storage node Node_2 and data block index Index_2 of the next data block; the data requester's identifier (such as user ID), the storage node and data block index of the next data block form a data acquisition request for the next data block, which is sent to the corresponding storage node. The storage node receives the data acquisition request and verifies the data requester who initiated the data acquisition request. The verification is performed by sending the next data block to the data requester. The data requester obtains the blocks corresponding to the next data block and the storage nodes and data block indexes carried therein by decryption, and can generate a new data acquisition request. By analogy, the data requester can obtain the blocks corresponding to each data block in the order of the data blocks until the storage nodes and data block indexes carried therein are no longer obtained after decryption, indicating that the data requester has read all the data blocks. The data requester merges the obtained blocks (for example, by splicing) to obtain an attribute encrypted file, and uses the user's private key to decrypt the attribute encrypted file to obtain the original data.

[0163] When the data requester reads the data block on the blockchain, a corresponding access record will be generated after the blockchain verification is completed. If the data requested by the data requester is the first data block, the blockchain will establish a user access record; the user access record includes the number of accesses A to the attribute encrypted file and the access user data (such as the user ID list).

[0164] Data providers can read user access data on the blockchain.

[0165] In order to implement the above embodiment, the present invention also provides a data access device.

[0166] Fig.10 A structural diagram of a data access device provided by an embodiment of the present invention.

[0167] like Fig.10 As shown, the data access device 1000 includes: a receiving module 1001 , a checking module 1002 , a allowing module 1003 and a rejecting module 1004 .

[0168] The receiving module 1001 is used to receive a data acquisition request sent by a data requester, wherein the data acquisition request is used to request acquisition of a target data block, which is a non-first data block among multiple data blocks of an attribute encrypted file, and multiple data blocks are distributedly stored in corresponding storage nodes.

[0169] The verification module 1002 is used to verify whether the data requester has accessed the previous data block of the target data block according to the storage node information and index information corresponding to the target data block in the data acquisition request.

[0170] The allowing module 1003 is used to allow the data requesting party to access the target data block if the data requesting party has accessed the previous data block.

[0171] The rejection module 1004 is used to reject the data requesting party's access to the target data block if the data requesting party has not accessed the previous data block.

[0172] Furthermore, in a possible implementation of the embodiment of the present invention, the allowing module 1003 is further configured to:

[0173] According to the storage node information and index information carried in the data acquisition request, the access to the target data block is recorded.

[0174] Perform a hash operation according to the storage node information and index information carried in the data acquisition request to obtain a first hash value corresponding to the target data block;

[0175] The first hash value is added to the user access record of the data requester.

[0176] Furthermore, in a possible implementation of the embodiment of the present invention, the verification module 1002 is further configured to:

[0177] According to the hash value sequence table, querying whether there is a second hash value before the first hash value in the user access record, wherein the hash value sequence table includes a plurality of hash values ​​arranged according to the sorting order of the corresponding data blocks, and each hash value is obtained by performing a hash operation on the storage node information and index information of the corresponding data block;

[0178] If the second hash value exists in the user access record, it is confirmed that the data requester has accessed the previous data block of the target data block;

[0179] If the second hash value does not exist in the user access record, it is confirmed that the data requester has not accessed the previous data block of the target data block.

[0180] Furthermore, in a possible implementation of the embodiment of the present invention, the device further includes:

[0181] A plurality of blocks obtained by receiving a data provider by segmenting the attribute encrypted file;

[0182] Allocate storage nodes and indexes to each block to determine the storage node information and index information of each block;

[0183] For any block, encrypt the storage node information and index information of the current block and its adjacent next block to obtain an encrypted data block;

[0184] Storing each data block in a corresponding storage node; and,

[0185] Publish the storage node information and index information of the first data block among multiple data blocks.

[0186] For any block, the storage node information and index information of the current block and its adjacent next block are encrypted to obtain an encrypted data block, including:

[0187] For any block, the storage node information and index information of the current block and its next adjacent block are attribute-encrypted using the subtree corresponding to the current block within the set number of layers to obtain an encrypted data block.

[0188] The target data block is the last data block among the multiple data blocks, and the access count of the attribute encrypted file is updated;

[0189] The multiple data blocks are obtained by segmenting the attribute encrypted file.

[0190] Record at least one of the identifier of the data requester, the storage node information of the target data block, and the index information.

[0191] In the embodiment of the present invention, the specific manner in which each module in the data access device of the above embodiment performs operations has been described in detail in the embodiment of the data access method, and will not be repeated here.

[0192] The present embodiment provides a data access device, wherein multiple data blocks of an attribute encrypted file are distributedly stored in corresponding storage nodes, and the storage node receives a data acquisition request sent by a data requester for requesting a target data block; based on the storage node information and index information corresponding to the target data block in the data acquisition request, the data requester is verified to see whether the data requester has accessed the previous data block of the target data block; if the data requester has accessed the previous data block, the data requester is allowed to access the target data block; if the data requester has not accessed the previous data block, the data requester is denied access to the target data block. The embodiment of the present invention stores the attribute encrypted file in blocks, ensuring that the storage node cannot obtain all the data of the attribute encrypted file at once when being invaded, increasing the difficulty for the invader to obtain all the data blocks and improving the security of the data; and further ensuring data security by performing access verification on the previous data block.

[0193] In order to implement the above embodiment, the present invention also provides another data access device. Fig.11 A structural diagram of a data access device provided by an embodiment of the present invention.

[0194] like Fig.11 As shown, the data access device 1100 includes: a sending module 1101.

[0195] The sending module 1101 is used to send a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file.

[0196] Among them, the target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used for the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block.

[0197] Furthermore, in a possible implementation of the embodiment of the present invention, the sending module 1101 is further configured to:

[0198] Obtaining the publishing information of the storage node, wherein the publishing information includes the storage node information and index information of the first data block of the attribute encrypted file;

[0199] According to the storage node information and index information of the first data block, access the storage node corresponding to the first data block to obtain the first data block;

[0200] The first data block is decrypted to obtain the decrypted blocks of the first data block, and the storage node information and index information corresponding to the next data block after the first data block.

[0201] If the storage node allows the data requester to access the target data block, the target data block is decrypted to obtain the decrypted blocks;

[0202] If the decrypted target data block does not contain the storage node information and index information corresponding to the next data block, the target data block is taken as the last data block among the multiple data blocks, and the decrypted blocks are merged according to the access order to obtain the attribute encrypted file.

[0203] In the embodiment of the present invention, the specific manner in which each module in the data access device of the above embodiment performs operations has been described in detail in the embodiment of the data access method, and will not be repeated here.

[0204] An embodiment of the present invention provides a data access device, in which a data requester sends a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encrypted file. The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and multiple data blocks are distributed and stored in the corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether the data requester is allowed to access the target data block according to whether the data requester has accessed the previous data block. In the embodiment of the present invention, the data requester sends a data acquisition request to pass the data access verification of the storage node, so that the data requester can legally and orderly obtain the data in the target data block, thereby ensuring the security of the data.

[0205] Fig.12 A block diagram of an electronic device 1200 provided in an embodiment of the present invention.

[0206] like Fig.12 As shown, the electronic device 1200 includes:

[0207] The memory 1201 and the processor 1202, a bus 1203 connecting different components (including the memory 1201 and the processor 1202), the memory 1201 stores a computer program, and when the processor 1202 executes the program, the data access method of the embodiment of the present invention is implemented.

[0208] Bus 1203 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.

[0209] The electronic device 1200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 1200, including volatile and non-volatile media, removable and non-removable media.

[0210] The memory 1201 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 1204 and / or cache memory 1205. The electronic device 1200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 1206 may be used to read and write non-removable, non-volatile magnetic media ( Fig.12not shown, usually called a "hard drive"). Although Fig.12 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 1203 via one or more data medium interfaces. The memory 1201 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0211] A program / utility 1208 having a set (at least one) of program modules 1207 may be stored, for example, in the memory 1201, such program modules 1207 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 1207 generally perform the functions and / or methods of the embodiments described herein.

[0212] The electronic device 1200 may also communicate with one or more external devices 1209 (e.g., keyboard, pointing device, display 1212, etc.), one or more devices that enable a user to interact with the electronic device 1200, and / or any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 1212. Furthermore, the electronic device 1200 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 1213. Fig.12 As shown, the network adapter 1213 communicates with other modules of the electronic device 1200 via the bus 1203. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0213] The processor 1202 executes various functional applications and data processing by running the programs stored in the memory 1201 .

[0214] In order to implement the above embodiments, the present invention also proposes a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute a data access method as mentioned above. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, an optical data storage device, etc.

[0215] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0216] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0217] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

[0218] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0219] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0220] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0221] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0222] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A data access method, characterized in that: include: Receive a data acquisition request sent by a data requester, wherein the data acquisition request is used to request to acquire a target data block, the target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; Verifying, according to the storage node information and index information corresponding to the target data block in the data acquisition request, whether the data requester has accessed a previous data block of the target data block; If the data requesting party has accessed the previous data block, the data requesting party is allowed to access the target data block; If the data requesting party has not accessed the previous data block, denying the data requesting party access to the target data block; The verifying, according to the storage node information and index information corresponding to the target data block in the data acquisition request, whether the data requester has accessed a previous data block of the target data block comprises: According to the hash value sequence table, querying whether there is a second hash value before the first hash value in the user access record, wherein the hash value sequence table includes a plurality of hash values ​​arranged according to the sorting order of the corresponding data blocks, and each of the hash values ​​is obtained by performing a hash operation on the storage node information and index information of the corresponding data block; If the second hash value exists in the user access record, it is confirmed that the data requester has accessed the previous data block of the target data block; If the second hash value does not exist in the user access record, it is confirmed that the data requester has not accessed the previous data block of the target data block.

2. The method according to claim 1, characterized in that If the data requesting party has accessed the previous data block, then after the data requesting party is allowed to access the target data block, the method further includes: According to the storage node information and index information carried in the data acquisition request, the access to the target data block is recorded.

3. The method according to claim 2, characterized in that The step of recording access to the target data block according to the storage node information and index information carried in the data acquisition request includes: Performing a hash operation according to the storage node information and index information carried in the data acquisition request to obtain a first hash value corresponding to the target data block; The first hash value is added to the user access record of the data requester.

4. The method according to any one of claims 1 to 3, characterized in that: Before receiving the data acquisition request sent by the data requester, the method further includes: A plurality of blocks obtained by receiving a data provider by segmenting the attribute encrypted file; Allocating storage nodes and indexes to each of the blocks to determine storage node information and index information of each of the blocks; For any block, encrypt the storage node information and index information of the current block and its adjacent next block to obtain an encrypted data block; storing each of the data blocks in a corresponding storage node; and, The storage node information and index information of the first data block among the multiple data blocks are published.

5. The method according to claim 4, characterized in that The number of the multiple blocks is determined by the data provider according to the number of subtrees within a set number of layers in the access control tree; For any block, the storage node information and index information of the current block and its adjacent next block are encrypted to obtain an encrypted data block, including: For any block, the storage node information and index information of the current block and its adjacent next block are attribute-encrypted using the subtree corresponding to the current block within the set number of layers to obtain an encrypted data block.

6. The method according to any one of claims 1 to 3, characterized in that: The target data block is the last data block among the multiple data blocks, and the method further comprises: Update the access count of the attribute encrypted file; The multiple data blocks are obtained by segmenting the attribute encrypted file.

7. The method according to any one of claims 1 to 3, characterized in that: The data requester has accessed the previous data block, and the method further includes: Record at least one of the identifier of the data requester, the storage node information and the index information of the target data block.

8. A data access method, characterized in that: include: Send a data acquisition request to the storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file; The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether to allow the data requester to access the target data block according to whether the data requester has accessed the previous data block; Among them, the storage node queries whether there is a second hash value before the first hash value in the user access record according to the hash value sequence table; if the second hash value exists in the user access record, the storage node confirms that the data requester has accessed the previous data block of the target data block; if the second hash value does not exist in the user access record, the storage node confirms that the data requester has not accessed the previous data block of the target data block; the hash value sequence table includes multiple hash values ​​arranged according to the sorting order of the corresponding data blocks, and each hash value is obtained by hashing the storage node information and index information of the corresponding data block.

9. The method according to claim 8, characterized in that The method further comprises: Acquire the publishing information of the storage node, wherein the publishing information includes the storage node information and index information of the first data block of the attribute encrypted file; Accessing a storage node corresponding to the first data block according to the storage node information and index information of the first data block to obtain the first data block; The first data block is decrypted to obtain decrypted blocks of the first data block, and storage node information and index information corresponding to a next data block after the first data block.

10. The method according to claim 8 or 9, characterized in that: After sending a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encrypted file, the method further includes: If the storage node allows the data requester to access the target data block, the target data block is decrypted to obtain decrypted blocks; If the decrypted target data block does not contain the storage node information and index information corresponding to the next data block, the target data block is used as the last data block among the multiple data blocks, and the decrypted blocks are merged according to the access order to obtain the attribute encrypted file.

11. A data access device, characterized in that: include: A receiving module, configured to receive a data acquisition request sent by a data requester, wherein the data acquisition request is used to request acquisition of a target data block, the target data block is a non-first data block among multiple data blocks of an attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; A verification module, used to verify whether the data requester has accessed a previous data block of the target data block according to the storage node information and index information corresponding to the target data block in the data acquisition request; an allowing module, used for allowing the data requesting party to access the target data block if the data requesting party has accessed the previous data block; a rejection module, configured to reject the data requesting party's access to the target data block if the data requesting party has not accessed the previous data block; The verification module is specifically used for: According to the hash value sequence table, querying whether there is a second hash value before the first hash value in the user access record, wherein the hash value sequence table includes a plurality of hash values ​​arranged according to the sorting order of the corresponding data blocks, and each of the hash values ​​is obtained by performing a hash operation on the storage node information and index information of the corresponding data block; If the second hash value exists in the user access record, it is confirmed that the data requester has accessed the previous data block of the target data block; If the second hash value does not exist in the user access record, it is confirmed that the data requester has not accessed the previous data block of the target data block.

12. A data access device, characterized in that: include: A sending module, used to send a data acquisition request to a storage node according to the storage node information and index information corresponding to the target data block to be accessed in the attribute encryption file; The target data block is a non-first data block among multiple data blocks of the attribute encrypted file, and the multiple data blocks are distributedly stored in corresponding storage nodes; the data acquisition request is used by the storage node to verify whether the data requester has accessed the previous data block of the target data block based on the storage node information and index information, so as to determine whether to allow the data requester to access the target data block according to whether the data requester has accessed the previous data block; Among them, the storage node queries whether there is a second hash value before the first hash value in the user access record according to the hash value sequence table; if the second hash value exists in the user access record, the storage node confirms that the data requester has accessed the previous data block of the target data block; if the second hash value does not exist in the user access record, the storage node confirms that the data requester has not accessed the previous data block of the target data block; the hash value sequence table includes multiple hash values ​​arranged according to the sorting order of the corresponding data blocks, and each hash value is obtained by hashing the storage node information and index information of the corresponding data block.

13. An electronic device, characterized in that: include: processor; a memory for storing executable instructions for the processor; The processor is configured to execute the instructions to implement the data access method according to any one of claims 1 to 7, or to implement the data access method according to any one of claims 8 to 10.

14. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the data access method as described in any one of claims 1 to 7, or execute the data access method as described in any one of claims 8 to 10.