Data access method, device, electronic device and computer readable medium

By using user trust values ​​and blockchain technology in the data access method in the electric power business field to generate and forward encrypted data, the problems of low retrieval efficiency and insufficient security in data sharing are solved, and efficient and secure data access is achieved. .

CN118690412BActive Publication Date: 2024-10-22STATE GRID DIGITAL TECHNOLOGY HOLDING CO LTD +5
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411155703.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-10-22
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In the field of electric power business, in the data access and sharing between the company and users, due to the large amount of data and the complexity of encrypted data, the retrieval efficiency is low and there are problems of insufficient security.

Method used

By obtaining the user ID and search keywords, calculate the user's trust value and perform access verification, generate trapdoor data based on the trust value and preset threshold, and determine the target ciphertext address using the inverted index data and vector inner product in the blockchain , extract and forward the target ciphertext to ensure the security and efficiency of data access.

Benefits of technology

It improves the retrieval efficiency of encrypted data, enhances the security of the data access process, and ensures the reliability and privacy of data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690412B_ABST
    Figure CN118690412B_ABST
Patent Text Reader

Abstract

The present application discloses a data access method, device, electronic device and computer-readable medium, which relates to the field of blockchain technology. The method includes: in response to a data access request, obtaining a user identifier and a search keyword; obtaining user attribute data according to the user identifier to determine the current trust value of this access, and determining the final trust value corresponding to the user identifier in combination with the historical trust value; performing access verification based on the final trust value and a preset threshold, and generating trapdoor data based on the search keyword and the encrypted search key in response to the access verification being passed; obtaining inverted index data, calculating the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data to determine the target ciphertext address; extracting the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwarding it to the user. Improve the data retrieval efficiency in the data access process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a data access method, device, electronic device and computer-readable medium. Background Art

[0002] At present, in the field of power business, electronic certificate data, as a professional and credential electronic document with legal effect, is increasingly becoming the main electronic certificate for market entities and citizens to carry out activities and is an important basic data to support management services. For example, in the power business, power grid companies are involved in a large number of electronic certificate data produced and issued by power grid companies and approved and verified by enterprises or individuals in their production and operation activities such as power engineering infrastructure, operation and maintenance, and marketing. These and similar scenarios involve a large amount of data access and sharing between enterprises and users. Due to the privacy of electronic certificate data and the diversity of people involved in business scenarios, it is urgent to improve the security of electronic certificate data sharing. Moreover, due to the large amount of data to be shared between companies and users and the complexity of encrypted data, the retrieval efficiency of encrypted data is low. Summary of the invention

[0003] In view of this, the embodiments of the present application provide a data access method, device, electronic device and computer-readable medium, which can solve the existing problem of low retrieval efficiency of encrypted data due to the large amount of data to be shared between companies and users and the complexity of encrypted data.

[0004] To achieve the above-mentioned purpose, according to one aspect of an embodiment of the present application, a data access method is provided, including: in response to a data access request, obtaining a corresponding user identifier and a search keyword; according to the user identifier, obtaining user attribute data to determine the current trust value of this access, and determining the final trust value corresponding to the user identifier according to the current trust value and the historical trust value; performing access verification based on the final trust value and a preset threshold, and in response to the access verification being passed, generating trapdoor data based on the search keyword and an encrypted search key; obtaining inverted index data stored in a blockchain, calculating the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determining a target ciphertext address based on the vector inner product; extracting a target ciphertext corresponding to the target ciphertext address in a local server through the blockchain and forwarding the target ciphertext to a user corresponding to the user identifier.

[0005] Optionally, determining the current trust value of the current visit includes: constructing a weight matrix based on user attribute data and preset measurement indicators; and determining the current trust value of the current visit based on the weight matrix and the user attribute data.

[0006] Optionally, a weight matrix is ​​constructed based on user attribute data and preset measurement indicators, including: converting the user attribute data into a column matrix, converting the preset measurement indicators into a row matrix; calculating the vector inner product of each user attribute data in the column matrix and each preset measurement indicator in the row matrix to obtain the weight matrix.

[0007] Optionally, based on the weight matrix and user attribute data, the current trust value of this visit is determined, including: dividing the user attribute data into levels, and determining the attribute trust value corresponding to each level of the user attribute data; determining the current trust value of this visit based on the weight values ​​in the weight matrix, the attribute trust values ​​and the weight values ​​of the preset measurement indicators.

[0008] Optionally, before determining the final trust value corresponding to the user identification, the method further includes: in response to detecting a dangerous behavior operation of the user, determining a risk coefficient corresponding to the dangerous behavior operation; and updating the current trust value based on the risk coefficient.

[0009] Optionally, based on the current trust value and the historical trust value, the final trust value corresponding to the user identification is determined, including: determining each historical moment corresponding to the historical trust value, and based on a preset time decay coefficient, determining the weight value of the historical trust value corresponding to each historical moment; based on the weight value, the historical trust value and the current trust value, determining the final trust value corresponding to the user identification.

[0010] Optionally, before obtaining the inverted index data stored in the blockchain, the method also includes: obtaining the data to be shared, extracting keywords from the data to be shared; converting the extracted keywords into keyword vectors, encrypting the keyword vectors using an encrypted search key to generate encrypted keywords; generating a ciphertext address containing the keyword vector, and pairing the encrypted keywords and the ciphertext address to generate inverted index data.

[0011] Optionally, determining the target ciphertext address based on the vector inner product includes: determining the ciphertext address paired with the encryption keyword corresponding to the vector inner product equal to a preset value as the target ciphertext address.

[0012] Optionally, a target ciphertext corresponding to a target ciphertext address is extracted from a local server through blockchain and the target ciphertext is forwarded to a user corresponding to the user identifier, including: determining a local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; extracting the corresponding target ciphertext from a local server according to the local storage address corresponding to the target ciphertext address through blockchain; and forwarding the target ciphertext to the user corresponding to the user identifier.

[0013] In addition, the present application also provides a data access device, including: an acquisition unit, configured to acquire a corresponding user identifier and search keyword in response to a data access request; a trust value determination unit, configured to acquire user attribute data based on the user identifier to determine the current trust value of this access, and determine the final trust value corresponding to the user identifier based on the current trust value and the historical trust value; a trapdoor data generation unit, configured to perform access verification based on the final trust value and a preset threshold, and generate trapdoor data based on the search keyword and an encrypted search key in response to the access verification being passed; a target ciphertext address determination unit, configured to acquire inverted index data stored in a blockchain, calculate the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determine the target ciphertext address based on the vector inner product; a forwarding unit, configured to extract a target ciphertext corresponding to the target ciphertext address in a local server through the blockchain and forward the target ciphertext to the user corresponding to the user identifier.

[0014] Optionally, the trust value determination unit is further configured to: construct a weight matrix based on the user attribute data and preset measurement indicators; and determine the current trust value of this visit based on the weight matrix and the user attribute data.

[0015] Optionally, the trust value determination unit is further configured to: convert the user attribute data into a column matrix, and convert the preset measurement indicators into a row matrix; calculate the vector inner product of each user attribute data in the column matrix and each preset measurement indicator in the row matrix to obtain a weight matrix.

[0016] Optionally, the trust value determination unit is further configured to: classify user attribute data into levels, and determine the attribute trust value corresponding to each level of user attribute data; determine the current trust value of this visit based on the weight values ​​in the weight matrix, the attribute trust values ​​and the weight values ​​of the preset measurement indicators.

[0017] Optionally, the data access device further comprises an updating unit configured to: determine a risk factor corresponding to the dangerous behavior operation in response to detecting the dangerous behavior operation of the user; and update the current trust value based on the risk factor.

[0018] Optionally, the trust value determination unit is further configured to: determine each historical moment corresponding to the historical trust value, and based on a preset time decay coefficient, determine the weight value of the historical trust value corresponding to each historical moment; based on the weight value, the historical trust value and the current trust value, determine the final trust value corresponding to the user identifier.

[0019] Optionally, the data access device also includes an inverted index data generation unit, which is configured to: obtain the data to be shared, extract keywords from the data to be shared; convert the extracted keywords into keyword vectors, encrypt the keyword vectors using an encryption search key to generate encrypted keywords; generate a ciphertext address containing the keyword vector, and pair the encrypted keywords and the ciphertext address to generate inverted index data.

[0020] Optionally, the target ciphertext address determining unit is further configured to: determine the ciphertext address paired with the encryption keyword corresponding to the vector inner product equal to a preset value as the target ciphertext address.

[0021] Optionally, the forwarding unit is further configured to: determine the local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; extract the corresponding target ciphertext from the local server according to the local storage address corresponding to the target ciphertext address through the blockchain; and forward the target ciphertext to the user corresponding to the user identifier.

[0022] In addition, the present application also provides a data access electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the one or more processors implement the data access method as described above.

[0023] In addition, the present application also provides a computer-readable medium on which a computer program is stored, and when the program is executed by a processor, the data access method as described above is implemented.

[0024] To achieve the above objective, according to another aspect of the embodiments of the present application, a computer program product is provided.

[0025] A computer program product according to an embodiment of the present application includes a computer program, and when the program is executed by a processor, the data access method provided by the embodiment of the present application is implemented.

[0026] One embodiment of the above invention has the following advantages or beneficial effects: the application obtains the corresponding user identification and search keyword in response to the data access request; obtains the user attribute data according to the user identification to determine the current trust value of this access, and determines the final trust value corresponding to the user identification according to the current trust value and the historical trust value; performs access verification based on the final trust value and the preset threshold, and generates trapdoor data based on the search keyword and the encrypted search key in response to the access verification passing; obtains the inverted index data stored in the blockchain, calculates the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determines the target ciphertext address based on the vector inner product; extracts the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwards the target ciphertext to the user corresponding to the user identification. Combining the blockchain with the trust value calculation, the security of the data access process is ensured, and the time complexity of the retrieval can be reduced by using the vector inner product to determine the target ciphertext address. The use of the inverted index structure can improve the data retrieval efficiency in the data access process.

[0027] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] The accompanying drawings are used to better understand the present application and do not constitute an improper limitation on the present application.

[0029] Figure 1 is a schematic diagram of the main process of a data access method according to an embodiment of the present application;

[0030] Figure 2 is a schematic diagram of the main process of a data access method according to an embodiment of the present application;

[0031] Figure 3 This is a schematic diagram of the electronic certificate data sharing process of the data access method according to an embodiment of the present application;

[0032] Figure 4 is a schematic diagram of an access verification process of a data access method according to an embodiment of the present application;

[0033] Figure 5 It is a schematic diagram of the electronic certificate data encryption and sharing process of the data access method according to one embodiment of the present application;

[0034] Figure 6 is a schematic diagram of an inverted index structure of a data access method according to an embodiment of the present application;

[0035] Figure 7 is a schematic diagram of main units of a data access device according to an embodiment of the present application;

[0036] Figure 8 is an exemplary system architecture diagram to which the embodiments of the present application can be applied;

[0037] Fig. 9 It is a structural diagram of a computer system of a terminal device or server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0038] The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of known functions and structures is omitted in the following description. It should be noted that the acquisition, transmission, storage, use, and processing of data in the technical solution of the present application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of the present application, certain software, components, models, and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must have used the solution. In the technical solution of the present application, the collection, analysis, use, transmission, storage, and other aspects of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, and are used for legal and reasonable purposes, and are not shared, leaked, or sold outside of these legal uses, and are subject to supervision and management by regulatory authorities. Take necessary measures to prevent illegal access to such personal information, ensure that persons with access to personal information comply with relevant laws and regulations, and ensure the security of personal information. Once such personal information is no longer needed, risks should be minimized by limiting or even prohibiting data collection and / or deleting data.

[0039] When used, including in certain related applications, user privacy is protected by de-identifying data, such as by removing specific identifiers when used, controlling the amount or specificity of data stored, controlling how data is stored, and / or other methods of de-identification.

[0040] Figure 1 is a schematic diagram of the main process of a data access method according to an embodiment of the present application, such as Figure 1 As shown, the data access method mainly includes the following steps S101 to S105.

[0041] Step S101, in response to a data access request, obtaining a corresponding user identifier and a search keyword.

[0042] In this embodiment, the architecture model of the data access system may include users (electronic certificate users, electronic certificate owners), storage servers, blockchains, and secret key distribution centers. The data access method is executed in the data access system. The execution subject of the data access method (for example, it may be a server in the data access system for controlling blockchains, secret key distribution centers, and storage servers) may receive a data access request initiated by a user to the blockchain by wired connection or wireless connection. Taking electronic certificate data sharing as an example, in the field of electronic certificate data sharing, a user identifier may be carried in a data access request, and the user identifier may be used to characterize the number or name of the electronic certificate data user who initiated the data access request. The embodiment of the present application does not specifically limit the user identifier. A search keyword may also be carried in the data access request. The search keyword may be one or more electronic certificate data keywords owned by the electronic certificate data that the electronic certificate data user needs to access. The search keyword may be in the form of a symbol, a text, or a picture. The embodiment of the present application does not specifically limit the form and number of the search keyword.

[0043] Step S102, obtaining user attribute data according to the user identifier to determine the current trust value of this visit, and determining the final trust value corresponding to the user identifier according to the current trust value and the historical trust value.

[0044] Specifically, determining the current trust value of this visit includes: constructing a weight matrix based on user attribute data and preset measurement indicators; and determining the current trust value of this visit based on the weight matrix and the user attribute data.

[0045] The execution subject can call the relevant user information library according to the user identification to obtain the user attribute data corresponding to the user identification under authorization. For example, the user attribute data may include the user's gender, language, region, role and other data. The embodiment of the present application does not specifically limit the user attribute data.

[0046] The preset measurement indicators may include users, devices, and environments. The execution subject may construct a weight matrix based on the set of users, devices, and environments formed by the preset measurement indicators and the set of attributes of the electronic certificate data user. Specifically, the weight matrix may be accurately constructed based on the correlation between the preset measurement indicators in the set of users, devices, and environments formed by the preset measurement indicators and the user attributes in the set of attributes of the electronic certificate data user.

[0047] A user (e.g., a user of electronic certificate data) initiates an access request to the blockchain. The blockchain first Verification is performed, and if it passes, the trust value is calculated for it, otherwise its access is blocked.

[0048] If the user If the verification is successful, the execution subject can determine the current trust value of this access based on the weights in the weight matrix, the attribute trust value corresponding to the user attribute data, and the weight value of the preset measurement indicator.

[0049] Specifically, based on the weight matrix and user attribute data, the current trust value of this visit is determined, including: dividing the user attribute data into levels, and determining the attribute trust value corresponding to each level of the user attribute data; determining the current trust value of this visit based on the weight values ​​in the weight matrix, the attribute trust values ​​and the weight values ​​of the preset measurement indicators.

[0050] The execution entity can classify the user attribute data based on dimensions such as basic information and work information, and determine the attribute trust value corresponding to the user attribute data of each class. Among them, the attribute trust value of the user attribute data corresponding to the basic information is higher than the attribute trust value of the user attribute data corresponding to the work information. The weight value of the preset metric indicator can be customized by the user, or it can be optimized by the weight value of the historical preset metric indicator. The embodiment of the present application does not specifically limit the weight value of the preset metric indicator. Based on the preset comprehensive trust value formula, and according to the weight value in the weight matrix, the attribute trust value and the weight value of the preset metric indicator, the comprehensive trust value is calculated, and the comprehensive trust value is determined as the current trust value of this visit.

[0051] Specifically, before determining the final trust value corresponding to the user identification, the method further includes: in response to detecting a dangerous behavior operation of the user, determining a risk coefficient corresponding to the dangerous behavior operation; and updating the current trust value based on the risk coefficient.

[0052] In order to prevent malicious attacks by users (such as electronic certificate data users), dangerous behavior detection is added when calculating the current trust value. When a dangerous behavior operation of a user (such as an electronic certificate data user) is detected, the current trust value of the user (such as an electronic certificate data user) is adjusted down by a preset range. Specifically, a corresponding risk coefficient can be set for each dangerous behavior operation, and the current trust value is updated with the corresponding risk coefficient based on the detected dangerous behavior operation of the user (such as the electronic certificate data user). Specifically, updating the current trust value may include: calculating a comprehensive risk coefficient based on the risk coefficient corresponding to the detected dangerous behavior operation of the user (such as the electronic certificate data user), and multiplying the comprehensive risk coefficient with the current trust value before the update (that is, based on the preset comprehensive trust value formula, and according to the weight value in the weight matrix, the attribute trust value and the weight value of the preset measurement indicator, the comprehensive trust value is calculated) to obtain the updated current trust value.

[0053] Specifically, based on the current trust value and the historical trust value, the final trust value corresponding to the user identification is determined, including: determining each historical moment corresponding to the historical trust value, and based on a preset time attenuation coefficient, determining the weight value of the historical trust value corresponding to each historical moment; based on the weight value, the historical trust value and the current trust value, determining the final trust value corresponding to the user identification.

[0054] The time decay factor is introduced. As the time from the current moment increases, the credibility of the user's (e.g., electronic certificate data user) historical trust value decreases. The trust values ​​at historical moments are weighted to ensure the credibility of the user's (e.g., electronic certificate data user) trust value. The preset time decay coefficient can be, for example: , let a certain moment in history be ,but , is the attenuation ratio of the trust value from the current moment, is the initial value at the current moment, is the correlation coefficient. The farther away from the current moment, the greater the degree of attenuation of the trust value. Calculate the weight of the historical trust value at different moments .

[0055] Finally, the trust values ​​at different moments (including historical moments and the current moment) (i.e., historical trust values ​​and current trust values) are weighted calculated based on the determined weight values ​​(the weight value at the current moment can be set to 1, without attenuation) to accurately obtain the final trust value of the user (e.g., the user of electronic certificate data).

[0056] Step S103, performing access verification based on the final trust value and the preset threshold, and generating trapdoor data based on the search keyword and the encrypted search key in response to the access verification being passed.

[0057] After obtaining the final trust value, the final trust value can be compared with the preset threshold. If the final trust value reaches the preset threshold, it is determined that the access verification is passed, and access is allowed, otherwise the user is blocked from access. When the access verification is passed, the execution subject can generate corresponding trapdoor data based on the preset trapdoor data generation algorithm based on the search keyword and the encrypted search key. For example, the trapdoor generation algorithm can be: , input public parameters to the trapdoor generation algorithm program , Encrypted Search Key , search keywords And the serial number corresponding to the search keyword , you can output the trapdoor data of the search keyword .

[0058] Step S104, obtaining the inverted index data stored in the blockchain, calculating the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determining the target ciphertext address based on the vector inner product.

[0059] Specifically, before obtaining the inverted index data stored in the blockchain, the method also includes: obtaining the data to be shared, extracting keywords from the data to be shared; converting the extracted keywords into keyword vectors, encrypting the keyword vectors using an encrypted search key to generate encrypted keywords; generating a ciphertext address containing the keyword vector, and pairing the encrypted keywords and the ciphertext address to generate inverted index data.

[0060] The data to be shared can be the electronic certificate data of the owner of the electronic certificate data authorized for use. The embodiment of the present application does not specifically limit the type and content of the data to be shared. In the embodiment of the present application, the keywords in the extracted data to be shared can be converted into keyword vectors by word embedding. After encrypting the keyword vector, an encrypted keyword is generated to convert the unordered keyword encryption index into an ordered structure, which is convenient for subsequent vector inner product calculations and improves the retrieval efficiency during data access. After generating the encrypted keyword, the execution entity can generate a ciphertext address containing the keyword vector based on the local server, and pair the encrypted keyword with the ciphertext address to generate inverted index data.

[0061] Obtain the inverted index data stored in the blockchain, calculate the vector inner product (i.e., dot product) of the trapdoor data and the encrypted keyword in the inverted index data, and determine the target ciphertext address based on the vector inner product. Specifically, determining the target ciphertext address based on the vector inner product includes: determining the ciphertext address paired with the encrypted keyword corresponding to the vector inner product equal to a preset value (which can be customized by the user and is not specifically limited in the embodiment of the present application) as the target ciphertext address. The target ciphertext address can be, for example, ,in, is the target ciphertext at the target ciphertext address.

[0062] Step S105, extracting the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwarding the target ciphertext to the user corresponding to the user identifier.

[0063] Specifically, a target ciphertext corresponding to a target ciphertext address is extracted from a local server through blockchain and the target ciphertext is forwarded to a user corresponding to the user identifier, including: determining a local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; extracting the corresponding target ciphertext from a local server according to the local storage address corresponding to the target ciphertext address through blockchain; and forwarding the target ciphertext to the user corresponding to the user identifier.

[0064] This embodiment obtains the corresponding user identification and search keywords in response to the data access request; obtains user attribute data according to the user identification to determine the current trust value of this access, and determines the final trust value corresponding to the user identification according to the current trust value and the historical trust value; performs access verification based on the final trust value and the preset threshold, and generates trapdoor data based on the search keyword and the encrypted search key in response to the access verification passing; obtains the inverted index data stored in the blockchain, calculates the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determines the target ciphertext address based on the vector inner product; extracts the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwards the target ciphertext to the user corresponding to the user identification. Combining blockchain with trust value calculation ensures the security of the data access process, and using the vector inner product to determine the target ciphertext address can reduce the time complexity of retrieval, and using the inverted index structure can improve the data retrieval efficiency in the data access process.

[0065] Figure 2 is a schematic diagram of the main flow of a data access method according to an embodiment of the present application, such as Figure 2 As shown, the data access method mainly includes the following steps S201 to S208.

[0066] Step S201, in response to a data access request, obtaining a corresponding user identifier and a search keyword.

[0067] Taking electronic certificate data sharing as an example, in the field of electronic certificate data sharing, a data access request may carry a user identifier, which may be used to characterize the number or name of the electronic certificate data user who initiates the data access request. The embodiment of the present application does not specifically limit the user identifier. A search keyword may also be carried in the data access request. The search keyword may be one or more electronic certificate data keywords owned by the electronic certificate data that the electronic certificate data user needs to access. The search keyword may be in the form of a symbol, text, or image. The embodiment of the present application does not specifically limit the form and number of the search keywords.

[0068] Step S202: acquiring user attribute data according to the user identifier.

[0069] The user identifier can be used to represent the number or name of the electronic certificate data user who initiates the data access request. The user attribute data may include the user's gender, language, region, role, etc. The embodiment of the application does not specifically limit the user attribute data.

[0070] Step S203, converting the user attribute data into a column matrix, and converting the preset measurement index into a row matrix.

[0071] Assume that the user attribute data corresponds to the attribute set: , the preset metrics correspond to the set of three preset metrics users, devices, and environments . Then the attribute set corresponding to the user attribute data Convert it into a column matrix and set the set corresponding to the preset metric Converted into a row matrix to calculate the weight matrix.

[0072] Step S204, calculating the vector inner product of each user attribute data in the column matrix and each preset metric index in the row matrix to obtain a weight matrix.

[0073] The vector inner product of each vector corresponding to each user attribute data in the column matrix and each vector corresponding to each preset measurement indicator in the row matrix is ​​calculated, and the cosine similarity, that is, the degree of correlation, is obtained according to the vector inner product, and the weight matrix is ​​obtained according to the cosine similarity. That is, each value in the weight matrix is ​​the cosine similarity between the vector corresponding to a user attribute data and the vector corresponding to a preset measurement indicator.

[0074] Step S205, based on the weight matrix and the user attribute data, determine the current trust value of this visit, and determine the final trust value corresponding to the user identifier according to the current trust value and the historical trust value.

[0075] Based on each cosine similarity in the weight matrix and the attribute trust value corresponding to the user attribute data and the weight value of the preset measurement indicator, the final comprehensive trust value is determined as the current trust value.

[0076] Taking into account the user's malicious attack behavior and time decay factor, the risk coefficient and time decay coefficient corresponding to the dangerous behavior operation are introduced. Based on a comprehensive analysis of the current trust value, historical trust value, risk coefficient and time decay coefficient, the final trust value corresponding to the user corresponding to the user identification (for example, the user of electronic certificate data) can be accurately determined.

[0077] Step S206, performing access verification based on the final trust value and the preset threshold, and in response to the access verification being passed, generating trapdoor data based on the search keyword and the encrypted search key.

[0078] When the user When the verification is passed, the trust value is calculated. After the final trust value is obtained, the final trust value can be compared with the preset threshold. If the final trust value reaches the preset threshold, it is determined that the access verification is passed, and access is allowed, otherwise the user access is blocked. When the access verification is passed, the execution subject can generate the corresponding trapdoor data based on the preset trapdoor data generation algorithm based on the search keyword and the encrypted search key. For example, the trapdoor generation algorithm can be: , input public parameters to the trapdoor generation algorithm program , Encrypted Search Key , search keywords And the serial number corresponding to the search keyword , you can output the trapdoor data of the search keyword Through the user's Double verification of authentication and trust value can improve the security of data access.

[0079] Step S207, obtaining the inverted index data stored in the blockchain, calculating the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determining the target ciphertext address based on the vector inner product.

[0080] The inverted index stores the keyword ciphertext (i.e., encrypted keyword) and the storage address containing the keyword ciphertext (i.e., encrypted keyword). The inverted index is stored in the blockchain. For example, the encrypted keyword is ,in is any random number of the same length as the keyword data. At the same time, the improved trapdoor data becomes . Encrypt keywords and trapdoor data Respectively expressed as vector form and , and then calculate the inner product of the two vectors to perform a binary search. Calculating the inner product of the two vectors is a process of using a bilinear map to query whether the keyword satisfies the index item identifier. Using a bilinear map to calculate the inner product of the search trap and the index vector to perform a binary search reduces the time complexity of the retrieval from Reduce to .

[0081] Step S208, extracting the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwarding the target ciphertext to the user corresponding to the user identifier.

[0082] According to the preset mapping relationship between the ciphertext address and the local storage address, the local storage address corresponding to the target ciphertext address is determined; the corresponding target ciphertext is extracted from the local server according to the local storage address corresponding to the target ciphertext address through the blockchain; and the target ciphertext is forwarded to the user corresponding to the user ID.

[0083] The embodiment of the present application realizes data sharing based on blockchain, adopts a data storage mode that combines on-chain and off-chain, reduces the computing overhead of blockchain, prevents data tampering, and realizes the secure sharing of encrypted electronic certificate data.

[0084] Figure 3It is a schematic diagram of the electronic certificate data sharing process of the data access method according to an embodiment of the present application. The data access method of the embodiment of the present application can be applied to the field of electronic certificate data sharing, and the following is an example of electronic certificate sharing. In the embodiment of the present application, the relevant terms involved are explained as follows: Electronic certificate: refers to a certificate that stores and manages traditional paper certificates (such as identity cards, driver's licenses, business licenses, etc.) in electronic form. This digital transformation can improve efficiency, convenience and security, and promote the digital development of various administrative, commercial and social services. Blockchain: Blockchain is a distributed ledger technology that records and verifies information transactions in a decentralized, transparent and tamper-proof manner. Blockchain forms a growing chain by dividing data into blocks and linking them in chronological order, each block contains the information of the previous block and a timestamp. This design makes the blockchain highly secure and transparent. Each node participating in the blockchain network has a complete copy of the ledger, and reaches consensus through a consensus algorithm to ensure the consistency of the ledger. This decentralized feature makes the blockchain not easy to be attacked or tampered with, because to change the information of a block, it is necessary to modify the information of all subsequent blocks, and this must be agreed upon by the majority of nodes in the network. Inverted Index: An inverted index is a data structure used to quickly find documents containing specific words. It is designed to improve the efficiency of text retrieval, especially in large-scale text datasets. The core idea of ​​the inverted index is to map the words in a document to the documents or locations where they appear, rather than mapping documents to words. This reverse mapping method can greatly speed up the text retrieval process. The inverted index contains two main parts: Vocabulary: This is a list of all unique words that appear in a document. Each word has a unique identifier, usually an integer. Inverted List: For each word, there is an associated inverted list that records the documents or locations containing the word. The inverted list can contain document IDs, location information, frequency, etc. Searchable Encryption: Searchable Encryption is an encryption technology that protects data privacy. It allows users to search and retrieve data in an encrypted state without first decrypting the entire dataset. This encryption method has important applications in cloud computing, database security, and privacy protection. Searchable encryption encrypts data while retaining certain search capabilities. Common searchable encryption technologies include symmetric searchable encryption and public key searchable encryption.Symmetric searchable encryption uses the same key for encryption and search, while public key searchable encryption uses a public key to encrypt data and a private key for search. A common application scenario is in a cloud computing environment, where users can upload data to the cloud without the cloud service provider being able to access or understand the data content. Users can use searchable encryption technology to perform search operations in encrypted data without having to download the entire data locally for decryption. This helps improve data privacy and security, especially for data containing sensitive information. Bilinear Mapping: Bilinear Mapping is a mathematical tool in cryptography that is often used to build various encryption schemes and protocols. A bilinear mapping is a binary mapping that refers to a mapping between two vector spaces while performing a linear mapping on two vectors. Bilinear mapping can be used in searchable encryption to achieve matching between data and decryption of ciphertext. Definition: Let. and Is a prime number The multiplication cyclic group of g is the multiplication cyclic group A generator of , then a bilinear map There are three properties as follows: Bilinear: For , ,satisfy ; Non-degenerate: ,satisfy ; Computability: For , there exists a probabilistic polynomial-time algorithm to compute .make and yes dimensional vector, then .

[0085] The architecture model of the data access system involved in the data access method of the embodiment of the present application includes the following participants: users (electronic certificate data users, electronic certificate data owners), storage servers, blockchains, and key distribution centers. The specific system model consists of the following: Figure 3 Specifically, the blockchain can authenticate the user (electronic certificate data user, electronic certificate data owner). The user (electronic certificate data owner) can upload the data index (for example, the inverted index in the embodiment of the present application) to the blockchain for storage. The user (electronic certificate data user) can submit the trapdoor data to the blockchain for ciphertext matching operations. The blockchain sends a request to the key distribution center to obtain the key, and the key distribution center runs the system parameters to generate a search encryption key. and a symmetric encryption key , and stored on the blockchain. Users (owners of electronic certificate data) can encrypt and store electronic certificate data in the storage server, and can obtain the target ciphertext in the local server through the blockchain.

[0086] The data access method of this application involves user identity creation, access verification, and data access operations. The specific description is as follows:

[0087] User identity creation: The user initiates an application to the blockchain network, and the blockchain assigns a unique At the same time, existing users in the blockchain assign role identities with corresponding permissions to new users, and then the blockchain network assigns corresponding user blocks to new users. Finally, the blockchain sends a request to the key distribution center, which runs the system parameters and generates a search encryption key. and a symmetric encryption key , and stored on the blockchain.

[0088] Access verification: When a user initiates access to a blockchain, the blockchain network will first verify the user’s After verification, the user's trust value is calculated. If the trust value reaches the established threshold, the user is assigned the corresponding access rights; otherwise, the user's access is blocked.

[0089] Data access operation: After the user obtains access rights, the blockchain will search for the encryption key and a symmetric encryption key Send it to the user, who can then use and Shared data can be retrieved and decrypted, and new data can be encrypted and uploaded. The blockchain records each user's access log and stores it on the chain for subsequent calculation of the user's trust value.

[0090] Access Verification: Access Verification Process: Figure 4 : is a schematic diagram of an access verification process of a data access method according to an embodiment of the present application. Figure 4 As shown in the figure, the user initiates an access request to the blockchain, and the blockchain first Verification is performed, and if it passes, the trust value is calculated, otherwise the access is blocked; when the trust value is calculated, if the trust value reaches the threshold, access is allowed, if it does not reach the threshold, access is blocked; when the user accesses, when the system detects dangerous operations, the user's trust value will be greatly reduced, thereby blocking access; finally, the user's access ends, the access log is recorded, and uploaded to the blockchain storage.

[0091] Specifically, the trust value calculation: the trust value calculation of the electronic certificate data user in the embodiment of the present application can be obtained by weighted calculation of the historical trust value of the electronic certificate data user's previous visits and the current trust value of this visit. Among them, the calculation of the trust value is measured by three indicators: user, device, and environment. The logistic regression model (logistic) is used to calculate the trust value of a single indicator according to the attributes of the current electronic certificate data user, where the attributes of the electronic certificate data user are stored in the access log, and finally the trust value of the electronic certificate data user at the current moment is obtained by weighted calculation.

[0092] For example, the trust value of the electronic certificate data user is calculated as follows:

[0093] make is the set of three metrics of trust value: user, device, and environment. To access the user's attribute set. According to the correlation between the measurement indicators and user attributes, a weight matrix is ​​constructed. ,in For the The attribute is calculated in The weight of the trust value of the measurement indicator; at the same time, the attribute information is graded and its The attribute trust value when the trust value of the measurement indicator is It is used by the electronic certificate data user to calculate the When the metric is The attribute trust value.

[0094] The logistic regression model is used to calculate the basic trust value of each metric:

[0095]

[0096] make For measurement indicators The final comprehensive trust value can be calculated based on the weight of .

[0097] At the same time, in order to prevent malicious attacks by users of electronic certificate data, dangerous behavior detection is added when calculating the trust value. When the system detects dangerous behavior of the accessing user, the trust value of the electronic certificate data user will be significantly reduced. For dangerous behavior collection, is the risk coefficient corresponding to the dangerous behavior, then:

[0098]

[0099] in, is 0 or a minimum value.

[0100] The comprehensive risk factor of electronic certificate data users is .

[0101] The current time of the electronic certificate data user The comprehensive trust value .

[0102] Finally, the time decay factor is introduced. As the time from the current moment increases, the credibility of the historical trust value of the electronic certificate data user decreases. The trust values ​​at historical moments are weighted to ensure the credibility of the trust value of the electronic certificate data user.

[0103] Time decay coefficient: , let a certain moment in history be ,but , is the attenuation ratio of the trust value from the current moment, is the initial value at the current moment, is the correlation coefficient. The farther away from the current moment, the greater the degree of attenuation of the trust value. Calculate the weight of the historical trust value at different moments .

[0104] Finally, the trust values ​​at different times are weighted and calculated to obtain the final trust value of the electronic certificate data user, as follows:

[0105]

[0106] After obtaining access rights, users can perform data access operations. Specifically, data access operations involve the following data encryption and search processes:

[0107] The electronic certificate data encryption symbols are shown in the following table:

[0108]

[0109] Figure 5 FIG. 1 is a schematic diagram of the electronic certificate data encryption and sharing process of the data access method according to an embodiment of the present application. Figure 5 As shown in the figure, the data encryption and sharing process is as follows: Data encryption and upload: The owner of the electronic certificate data builds the electronic certificate data set locally , and extract the keywords of the electronic certificate file, extract the keywords of each electronic certificate file, and build the electronic certificate keyword set . Using a symmetric encryption key and encrypted search key For each electronic certificate data in the electronic certificate data set and the plain text of keywords in the electronic certificate keyword set Encrypt and generate electronic certificate data ciphertext (i.e. target ciphertext) and keyword ciphertext (i.e. encrypted keyword) ,Will Store on the local server and record the storage address , while generating Contains keywords The ciphertext storage address set . Then the keyword ciphertext (that is, encrypted keyword) and ciphertext address Pairing to form an inverted index Finally, the inverted index (which stores the keyword ciphertext and the storage address containing the keyword ciphertext) is used as a transaction to send a request to the blockchain network for storage. Encrypted data query search: The electronic certificate data user conducts a certificate query on the owner of a certain electronic certificate data. The electronic certificate data user first selects the search keyword contained in the electronic certificate to be searched. , generate trapdoor data (Trapdoor Generation Algorithm , enter common parameters , Encrypted Search Key , search keywords And the serial number corresponding to the search keyword , output the trapdoor of the search keyword ), sent to the blockchain, and matched with the inverted index stored in the blockchain by the owner of the license data. If the match is successful, the data containing the keyword is obtained. The ciphertext storage address set ,according to , the blockchain is searched and extracted in the local server (target ciphertext), and then forwarded to the electronic certificate data user, who uses the symmetric encryption key , for the electronic certificate ciphertext (i.e. the target ciphertext ) to decrypt and obtain the required electronic certificate text; otherwise, the relevant data information will be returned to the user.

[0110] Figure 6 FIG. 1 is a schematic diagram of an inverted index structure of a data access method according to an embodiment of the present application. Figure 6 As shown:

[0111] The encryption keyword Enc (w1, *, …, *) corresponds to the ciphertext address set Address (C w1 ):Address(C 1w1 ), Address (C 2w1 ), …;

[0112] The encryption keyword Enc(w1, w2, *, …, *) corresponds to the ciphertext address set Address(C w2 ):Address(C 1w2 ), Address (C 2w2 ), …;

[0113] The encryption keyword Enc (w1, w2, w3, …, *), the corresponding ciphertext address set is Address (C w3 ):Address(C 1w3 ), Address (C 2w3 ), …;

[0114] Encryption keyword Enc(w1, w2, w3, ..., w y ), the corresponding ciphertext address set is Address (C wy ):Address(C 1wy ), Address (C 2wy ),….

[0115] Constructing an inverted index: In order to improve the efficiency of searching, the embodiment of the present application adopts a new encryption method to transform the disordered encrypted keyword sequence structure into an ordered structure. In an ordered structure, the idea of ​​binary search can be used for efficient searching. In the searching process, the encrypted keywords and trapdoors are searched based on bilinear mapping. The improved inverted index structure is as follows Figure 6 As shown. Figure 6 The encryption keyword is ,in is any random number of the same length as the keyword data. At the same time, the improved trapdoor becomes . Encrypt keywords and trapdoor Respectively expressed as vector form and , and then calculate the inner product of the two vectors to perform binary search. Calculating the inner product of the two vectors is a process of using bilinear mapping to query whether the keyword satisfies the index item identification.

[0116] Data encryption and search in data access operations involve the keyword search encryption algorithm. The keyword search encryption algorithm consists of five sub-algorithms: initialization algorithm , encryption algorithm , Trapdoor Generation Algorithm , Matching test algorithm , Search Algorithm Among them, the initialization algorithm , enter security parameters , output common parameters and the encrypted search key . Define common parameters separately , encrypted search key .in For a bilinear map , is the generator, Is a prime number Cyclic group of , yes dimensional non-zero vector, There are two dimensional full rank matrix, A collision-resistant hash function Among them, the encryption algorithm , enter a keyword set , Search for encryption keys And public parameters , output encrypted index keyword dictionary .

[0117] Single encrypted index key The specific generation process is as follows:

[0118] / / Generate a Dimensional vector :

[0119]

[0120]

[0121]

[0122]

[0123] / / Use segmentation marker vector Vector Convert to two vectors :

[0124]

[0125]

[0126]

[0127] / / right Two vectors are encrypted to generate keywords The corresponding encrypted index :

[0128]

[0129] Trapdoor Generation Algorithm , enter common parameters , key , search keywords And the serial number corresponding to the search keyword , output the trapdoor data of the search keyword The specific algorithm for generating trapdoor data is as follows:

[0130] / / Generate a Dimensional vector :

[0131]

[0132]

[0133]

[0134]

[0135] / / Use segmentation marker vector Vector Convert to two vectors :

[0136]

[0137]

[0138]

[0139] calculate And output keywords The corresponding encrypted index :

[0140]

[0141] Matching test algorithm , enter the generated search trap , public parameters And encrypted index keywords , calculated as follows:

[0142]

[0143] If the equation holds, output 1; otherwise, output 0.

[0144] Search Algorithms , enter the keyword you want to search The corresponding trapdoor , output the address of the encrypted file or (Indicates that no search results containing the keyword were found The specific algorithm is as follows:

[0145]

[0146] initialization ; ; ;

[0147]

[0148] ;

[0149] ;

[0150] ;

[0151] ;

[0152] ;

[0153]

[0154] The embodiment of the present application can realize the sharing of electronic certificate data based on blockchain, and use blockchain technology to solve the problem of malicious tampering in the process of sharing encrypted electronic certificate data; use trust calculation to ensure the security of the access process, and prevent malicious operations by users of electronic certificate data; and use the idea of ​​binary search and the inverted index structure to improve the search efficiency of encrypted electronic certificates. A data storage mode that combines on-chain and off-chain is adopted, and the inverted index of data search is stored on the chain, and the electronic certificate data is encrypted and stored in the local server, thereby preventing the data from being maliciously tampered with; the trust value calculation of the user of the electronic certificate data is added to the access verification, and a new trust calculation model is constructed, which can effectively improve the security of the access process and prevent malicious operations by users of the electronic certificate data; a new encryption algorithm is applied to construct an inverted index of the ciphertext, and based on the idea of ​​binary search, a ciphertext fast search algorithm is proposed to improve the search efficiency of the electronic certificate ciphertext.

[0155] The embodiment of the present application implements data sharing based on blockchain, and adopts a data storage mode that combines on-chain and off-chain to reduce the computational overhead of blockchain, while preventing data tampering, and realizing the secure sharing of encrypted electronic certificate data. In the process of data sharing, a dynamic trust value calculation is performed based on the attributes of the electronic certificate data user of the electronic certificate data. According to the attributes of the electronic certificate data user at different times, the trust evaluation results of the electronic certificate data user are obtained in real time, and finally the access request of the electronic certificate data user is judged according to the evaluation results. It effectively improves the security of the data access process, and also prevents malicious operations by the electronic certificate data user during the data access process. When encrypting keywords, an encryption method of encrypting keyword vectors instead of single keywords is used to convert the unordered keyword encryption index into an ordered structure, and then a bilinear mapping is used to calculate the inner product of the search trap and the index vector to perform a binary search, thereby reducing the time complexity of the retrieval from. Reduce to . A data storage mode that combines on-chain and off-chain (storing encrypted electronic certificate data in a local database and storing keyword indexes on the chain) is adopted to reduce the storage burden of the blockchain, while taking advantage of the decentralized nature of the blockchain to prevent data tampering. Trust value calculation is added to the data access process. The trust value of the electronic certificate data user is calculated based on the access history of the electronic certificate data user and the current access information. A trusted connection channel can be established between the electronic certificate data user and the data, while also preventing malicious operations by the electronic certificate data user and achieving secure data sharing. Based on the idea of ​​inverted index structure and binary search, a new ciphertext search algorithm is proposed to improve the search efficiency of ciphertext, thereby accelerating the rate of data sharing.

[0156] Figure 7 Schematic diagram of the main units of the data access device according to an embodiment of the present application. Figure 7 As shown, the data access device 700 includes an acquisition unit 701, a trust value determination unit 702, a trapdoor data generation unit 703, a target ciphertext address determination unit 704 and a forwarding unit 705.

[0157] The acquisition unit 701 is configured to acquire the corresponding user identification and search keyword in response to a data access request.

[0158] The trust value determination unit 702 is configured to obtain user attribute data according to the user identification to determine the current trust value of this visit, and determine the final trust value corresponding to the user identification according to the current trust value and the historical trust value.

[0159] The trapdoor data generating unit 703 is configured to perform access verification based on the final trust value and a preset threshold, and generate trapdoor data based on the search keyword and the encrypted search key in response to the access verification being passed.

[0160] The target ciphertext address determining unit 704 is configured to obtain the inverted index data stored in the blockchain, calculate the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determine the target ciphertext address based on the vector inner product.

[0161] The forwarding unit 705 is configured to extract the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forward the target ciphertext to the user corresponding to the user identifier.

[0162] In some embodiments, the trust value determination unit 702 is further configured to: construct a weight matrix based on user attribute data and preset metrics; and determine the current trust value of this visit based on the weight matrix and the user attribute data.

[0163] In some embodiments, the trust value determination unit 702 is further configured to: convert the user attribute data into a column matrix, and convert the preset measurement indicators into a row matrix; calculate the vector inner product of each user attribute data in the column matrix and each preset measurement indicator in the row matrix to obtain a weight matrix.

[0164] In some embodiments, the trust value determination unit 702 is further configured to: classify the user attribute data into levels, and determine the attribute trust value corresponding to each level of the user attribute data; determine the current trust value of this visit based on the weight value in the weight matrix, the attribute trust value and the weight value of the preset measurement indicator.

[0165] In some embodiments, the data access device further includes Figure 7 The updating unit not shown in the figure is configured to: in response to detecting the dangerous behavior operation of the user, determine the risk coefficient corresponding to the dangerous behavior operation; and update the current trust value based on the risk coefficient.

[0166] In some embodiments, the trust value determination unit 702 is further configured to: determine each historical moment corresponding to the historical trust value, and based on a preset time decay coefficient, determine the weight value of the historical trust value corresponding to each historical moment; based on the weight value, the historical trust value and the current trust value, determine the final trust value corresponding to the user identifier.

[0167] In some embodiments, the data access device further includes Figure 7The inverted index data generation unit not shown in the figure is configured to: obtain the data to be shared, extract the keywords in the data to be shared; convert the extracted keywords into keyword vectors, encrypt the keyword vectors using an encrypted search key to generate encrypted keywords; generate a ciphertext address containing the keyword vector, and pair the encrypted keywords with the ciphertext address to generate inverted index data.

[0168] In some embodiments, the target ciphertext address determining unit 704 is further configured to: determine the ciphertext address paired with the encryption keyword corresponding to the vector inner product equal to a preset value as the target ciphertext address.

[0169] In some embodiments, the forwarding unit 705 is further configured to: determine the local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; extract the corresponding target ciphertext from the local server according to the local storage address corresponding to the target ciphertext address through the blockchain; and forward the target ciphertext to the user corresponding to the user identifier.

[0170] It should be noted that the data access method and the data access device of the present application have a corresponding relationship in terms of specific implementation contents, so the repeated contents will not be described again.

[0171] Figure 8 An exemplary system architecture 800 to which the data access method or data access device according to the embodiment of the present application can be applied is shown.

[0172] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0173] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0174] The terminal devices 801 , 802 , and 803 may be various electronic devices having a data access processing screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0175] Server 805 can be a server that provides various services, such as a background management server that provides support for data access requests submitted by users using terminal devices 801, 802, and 803 (only as an example). The background management server can respond to the data access request and obtain the corresponding user identification and search keyword; obtain user attribute data based on the user identification to determine the current trust value of this access, and determine the final trust value corresponding to the user identification based on the current trust value and the historical trust value; perform access verification based on the final trust value and the preset threshold, and generate trapdoor data based on the search keyword and the encrypted search key in response to the access verification passing; obtain the inverted index data stored in the blockchain, calculate the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determine the target ciphertext address based on the vector inner product; extract the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forward the target ciphertext to the user corresponding to the user identification. Combining blockchain with trust value calculation to ensure the security of the data access process, using the vector inner product to determine the target ciphertext address can reduce the time complexity of retrieval, and using the inverted index structure can improve the data retrieval efficiency in the data access process.

[0176] It should be noted that the data access method provided in the embodiment of the present application is generally executed by the server 805 , and accordingly, the data access device is generally set in the server 805 .

[0177] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0178] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present application. Fig. 9 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0179] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the computer system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0180] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0181] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present application are executed.

[0182] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, for example, but are not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0183] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0184] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes an acquisition unit, a trust value determination unit, a trapdoor data generation unit, a target ciphertext address determination unit and a forwarding unit. The names of these units do not constitute limitations on the units themselves in some cases.

[0185] As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device responds to a data access request, obtains the corresponding user identification and search keyword; obtains user attribute data according to the user identification to determine the current trust value of this access, and determines the final trust value corresponding to the user identification according to the current trust value and the historical trust value; performs access verification based on the final trust value and the preset threshold, and generates trapdoor data based on the search keyword and the encrypted search key in response to the access verification passing; obtains the inverted index data stored in the blockchain, calculates the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determines the target ciphertext address based on the vector inner product; extracts the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forwards the target ciphertext to the user corresponding to the user identification.

[0186] The computer program product of the present application includes a computer program, and when the computer program is executed by a processor, the data access method in the embodiment of the present application is implemented.

[0187] According to the technical solution of the embodiment of the present application, the blockchain is combined with the trust value calculation to ensure the security of the data access process. The target ciphertext address is determined by using the vector inner product, which can reduce the time complexity of the retrieval. The inverted index structure is used to improve the data retrieval efficiency during the data access process.

[0188] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A data access method, It is characterized in that include: In response to the data access request, obtaining a corresponding user identifier and a search keyword; According to the user identifier, user attribute data is obtained to determine the current trust value of this visit, and according to the current trust value and the historical trust value, a final trust value corresponding to the user identifier is determined; Based on the final trust value and a preset threshold, performing access verification, and in response to the access verification being passed, generating trapdoor data based on the search keyword and the encrypted search key; Obtain inverted index data stored in the blockchain, calculate the vector inner product of the trapdoor data and the encrypted keyword in the inverted index data, and determine the target ciphertext address based on the vector inner product; The target ciphertext corresponding to the target ciphertext address is extracted from the local server through the blockchain and the target ciphertext is forwarded to the user corresponding to the user identifier.

2. The method according to claim 1, It is characterized in that Determining the current trust value of the current visit includes: Constructing a weight matrix based on the user attribute data and preset measurement indicators; Based on the weight matrix and the user attribute data, a current trust value of this visit is determined.

3. The method according to claim 2, It is characterized in that The step of constructing a weight matrix based on the user attribute data and preset measurement indicators includes: Convert the user attribute data into a column matrix, and convert the preset metric into a row matrix; The vector inner product of each user attribute data in the column matrix and each preset metric index in the row matrix is ​​calculated to obtain a weight matrix.

4. The method according to claim 2, It is characterized in that The determining the current trust value of the current visit based on the weight matrix and the user attribute data includes: Classifying the user attribute data into levels, and determining an attribute trust value corresponding to each level of the user attribute data; The current trust value of this visit is determined according to the weight values ​​in the weight matrix, the attribute trust value and the weight value of the preset measurement indicator.

5. The method according to claim 1, It is characterized in that Before determining the final trust value corresponding to the user identifier, the method further includes: In response to detecting a dangerous behavior operation of a user, determining a risk factor corresponding to the dangerous behavior operation; The current trust value is updated based on the risk factor.

6. The method according to claim 1, It is characterized in that The determining, according to the current trust value and the historical trust value, a final trust value corresponding to the user identifier includes: Determine each historical moment corresponding to the historical trust value, and determine a weight value of the historical trust value corresponding to each historical moment based on a preset time decay coefficient; Based on the weight value, the historical trust value and the current trust value, a final trust value corresponding to the user identifier is determined.

7. The method according to claim 1, It is characterized in that Before obtaining the inverted index data stored in the blockchain, the method further includes: Acquire data to be shared, and extract keywords from the data to be shared; Converting the extracted keyword into a keyword vector, and encrypting the keyword vector using an encrypted search key to generate an encrypted keyword; Generate a ciphertext address containing the keyword vector, and pair the encrypted keyword with the ciphertext address to generate inverted index data.

8. The method according to claim 1, It is characterized in that The determining a target ciphertext address based on the vector inner product includes: The ciphertext address paired with the encryption keyword corresponding to the vector inner product equal to the preset value is determined as the target ciphertext address.

9. The method according to any one of claims 1 to 8, It is characterized in that The step of extracting a target ciphertext corresponding to the target ciphertext address in a local server through a blockchain and forwarding the target ciphertext to a user corresponding to the user identifier includes: Determine the local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; Extract the corresponding target ciphertext from the local server according to the local storage address corresponding to the target ciphertext address through the blockchain; The target ciphertext is forwarded to the user corresponding to the user identifier.

10. A data access device, It is characterized in that include: an acquisition unit, configured to acquire a corresponding user identifier and a search keyword in response to a data access request; A trust value determination unit is configured to obtain user attribute data according to the user identifier to determine a current trust value of this visit, and determine a final trust value corresponding to the user identifier according to the current trust value and the historical trust value; a trapdoor data generating unit configured to perform access verification based on the final trust value and a preset threshold, and in response to passing the access verification, generate trapdoor data based on the search keyword and the encrypted search key; a target ciphertext address determining unit, configured to obtain inverted index data stored in the blockchain, calculate a vector inner product of the trapdoor data and an encrypted keyword in the inverted index data, and determine a target ciphertext address based on the vector inner product; The forwarding unit is configured to extract the target ciphertext corresponding to the target ciphertext address in the local server through the blockchain and forward the target ciphertext to the user corresponding to the user identifier.

11. The device according to claim 10, It is characterized in that The trust value determination unit is further configured to: Constructing a weight matrix based on the user attribute data and preset measurement indicators; Based on the weight matrix and the user attribute data, a current trust value of this visit is determined.

12. The device according to claim 11, It is characterized in that The trust value determination unit is further configured to: Convert the user attribute data into a column matrix, and convert the preset metric into a row matrix; The vector inner product of each user attribute data in the column matrix and each preset metric index in the row matrix is ​​calculated to obtain a weight matrix.

13. The device according to claim 11, It is characterized in that The trust value determination unit is further configured to: Classifying the user attribute data into levels, and determining an attribute trust value corresponding to each level of the user attribute data; The current trust value of this visit is determined according to the weight values ​​in the weight matrix, the attribute trust value and the weight value of the preset measurement indicator.

14. The device according to claim 10, It is characterized in that The apparatus further comprises an updating unit configured to: In response to detecting a dangerous behavior operation of a user, determining a risk factor corresponding to the dangerous behavior operation; The current trust value is updated based on the risk factor.

15. The device according to claim 10, It is characterized in that The trust value determination unit is further configured to: Determine each historical moment corresponding to the historical trust value, and determine a weight value of the historical trust value corresponding to each historical moment based on a preset time decay coefficient; Based on the weight value, the historical trust value and the current trust value, a final trust value corresponding to the user identifier is determined.

16. The device according to claim 10, It is characterized in that The apparatus further includes an inverted index data generating unit configured to: Acquire data to be shared, and extract keywords from the data to be shared; Converting the extracted keyword into a keyword vector, and encrypting the keyword vector using an encrypted search key to generate an encrypted keyword; Generate a ciphertext address containing the keyword vector, and pair the encrypted keyword with the ciphertext address to generate inverted index data.

17. The device according to claim 10, It is characterized in that The target ciphertext address determination unit is further configured to: The ciphertext address paired with the encryption keyword corresponding to the vector inner product equal to the preset value is determined as the target ciphertext address.

18. The device according to any one of claims 10 to 17, It is characterized in that The forwarding unit is further configured to: Determine the local storage address corresponding to the target ciphertext address according to a preset mapping relationship between the ciphertext address and the local storage address; Extract the corresponding target ciphertext from the local server according to the local storage address corresponding to the target ciphertext address through the blockchain; The target ciphertext is forwarded to the user corresponding to the user identifier.

19. A data access electronic device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.

20. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

21. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Multi-user encrypted search method in cloud storage

    CN104993931A

  • Method for searching multi-domain connection keywords on basis of MDB+ tree under cloud environment

    CN106980796A

  • CPABE-based file ciphertext quick search method

    CN111444140A

  • Medical data searchable encryption privacy protection and system

    CN117521118A

  • Method and device for searching ciphertext data and computer

    CN117668896A