Memory access method based on trusted execution environment and related equipment

By calculating the location of candidate storage units of data items in a trusted execution environment and determining the target storage unit for writing using an inadvertent matching algorithm, the problem of attackers speculating on data content through analysis of access patterns is solved, and data confidentiality and integrity are improved. sex.

CN118916299AActive Publication Date: 2024-11-08BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 17 Cites 0 Cited by

Patent Information

Application Number
CN202411037860.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-08
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

In a trusted execution environment, an attacker can infer data content by analyzing data access patterns, threatening its security.

Method used

By obtaining the data items to be written, calculating the locations of their multiple candidate data storage units and building an association relationship, the target data storage unit is determined using an inadvertent matching algorithm to realize the writing of the data items, thereby hiding the data access mode.

Benefits of technology

Effectively prevent potential attackers from inferring data content through analyzing access patterns, enhancing data confidentiality and integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916299A_ABST
    Figure CN118916299A_ABST
Patent Text Reader

Abstract

The invention provides a memory access method based on a trusted execution environment and related equipment. The method comprises the steps of obtaining at least one to-be-processed data item to be written into a trusted execution environment; for at least part of the to-be-processed data items, calculating positions of a plurality of candidate data storage units corresponding to each to-be-processed data item, and constructing an association relationship between the to-be-processed data items and the plurality of candidate data storage units; wherein the plurality of candidate data storage units are deployed in the trusted execution environment; determining a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset oblivious matching algorithm and the association relationship; and based on the matching relationship, writing the to-be-processed data item into the target data storage unit. According to the memory access method based on the trusted execution environment and the related equipment, the confidentiality and integrity of the data in the processing process can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a memory access method based on a trusted execution environment and related devices. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the disclosure that are recited in the claims. No description herein is admitted to be prior art by inclusion in this section.

[0003] A trusted executive environment (TEE) is an operating environment consisting of independent trusted areas divided in the processor and memory. It provides a high level of security protection by isolating the execution of selected code and data from the execution of the main operating system.

[0004] However, for data stored in a trusted execution environment, attackers can analyze the data content by analyzing the data access pattern, thereby threatening the security of the trusted execution environment. Summary of the invention

[0005] In view of this, the purpose of the present disclosure is to propose a memory access method and related devices based on a trusted execution environment, which at least solves one of the technical problems in the related art to a certain extent.

[0006] Based on the above objectives, the first aspect of the present disclosure provides a memory access method based on a trusted execution environment, comprising:

[0007] Acquire at least one data item to be processed to be written into the trusted execution environment;

[0008] For at least part of the data items to be processed, calculate the positions of multiple candidate data storage units corresponding to each of the data items to be processed, and establish an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment;

[0009] Based on a preset inadvertent matching algorithm and the association relationship, determining a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units;

[0010] Based on the matching relationship, the data item to be processed is written into the target data storage unit.

[0011] In some embodiments, calculating the position of a plurality of candidate data storage units corresponding to each of the data items to be processed includes:

[0012] The placement positions of the candidate data storage units in the index table are calculated based on a preset number of hash functions, and the number of the hash functions is the same as the number of the candidate data storage units.

[0013] In some embodiments, the number of hash functions is 3-6.

[0014] In some embodiments, the determining the matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset inadvertent matching algorithm and the association relationship includes:

[0015] Determine a first vertex set based on at least one of the data items to be processed, determine a second vertex set based on the table entry corresponding to the placement position of the candidate data storage unit in the index table, and determine an edge set based on the association relationship;

[0016] Finding alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set;

[0017] Based on the path matching relationship between each vertex in the first vertex set and each vertex in the second vertex set, a matching relationship between the data item to be processed and a corresponding table entry of the target data storage unit in the index table is determined.

[0018] In some embodiments, searching for alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set, includes:

[0019] Performing a casual first sorting of the edge set based on a preset first priority rule;

[0020] Traversing the edge set after the first sorting, and constructing a first matching relationship between each vertex in the first vertex set and each vertex in the second vertex set;

[0021] Performing a second casual sorting of the edge set based on a preset second priority rule;

[0022] The edge set after the second sorting is traversed, the first matching relationship is adjusted, and the path matching relationship is obtained.

[0023] In some embodiments, the first priority rule includes at least one of the following:

[0024] Set the edges of the first vertex set pointing to the same vertex in one group;

[0025] The edges are first directed from the second vertex set to the first vertex set;

[0026] The free edge is oriented first;

[0027] Edges with smaller counts are directed first.

[0028] In some embodiments, the second priority rule includes at least one of the following:

[0029] Set the edges of the second vertex set pointing to the same vertex in one group;

[0030] The edges are first directed from the second vertex set to the first vertex set;

[0031] Edges with larger counts are directed first.

[0032] In some embodiments, writing the to-be-processed data item into the target data storage unit comprises:

[0033] The index information corresponding to the data item to be processed is written into the table entry corresponding to the target data storage unit in the index table.

[0034] In some embodiments, the method further comprises:

[0035] The table items in the index table are stored hierarchically.

[0036] In some embodiments, the method further comprises:

[0037] Obtaining a query request for a data item to be queried;

[0038] Performing a hierarchical query on the index table based on the query request;

[0039] In response to obtaining index information corresponding to the data to be queried in the target level, obtaining the data item to be queried based on the index information;

[0040] A query based on an oblivious algorithm is performed on at least part of the remaining levels to obtain a first data item, and a query result for the query request is obtained based on the data item to be queried and the first data item.

[0041] A second aspect of the present disclosure provides a memory access device based on a trusted execution environment, comprising:

[0042] An acquisition module is configured to: acquire at least one to-be-processed data item to be written into the trusted execution environment;

[0043] A calculation module is configured to: for at least part of the data items to be processed, calculate the position of multiple candidate data storage units corresponding to each of the data items to be processed, and establish an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment;

[0044] A determination module is configured to: determine a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset inadvertent matching algorithm and the association relationship;

[0045] The writing module is configured to: write the to-be-processed data item into the target data storage unit based on the matching relationship.

[0046] A third aspect of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the memory access method based on a trusted execution environment as described in the first aspect is implemented.

[0047] A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the memory access method based on a trusted execution environment described in the first aspect.

[0048] A fifth aspect of an embodiment of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer executes the memory access method based on a trusted execution environment as described in the first aspect.

[0049] As can be seen from the above, the memory access method and related devices based on the trusted execution environment provided by the present disclosure, after obtaining the data items to be processed to be written into the memory deployed in the trusted execution environment, for at least part of the data items to be processed, first calculate the positions of multiple candidate data storage units of each data item to be processed and construct the association relationship between the data item to be processed and the multiple candidate data storage units deployed in the trusted execution environment, then use the inadvertent matching algorithm to determine the matching relationship between the data item to be processed and the target data storage unit among the multiple candidate data storage units, and then write the data item to be processed into the target data storage unit deployed in the trusted execution environment based on the matching relationship, thereby realizing an inadvertent memory access method for the trusted execution environment; because the positions of the multiple candidate data storage units of the data items to be processed are first determined, and then the target data storage unit is determined from the multiple candidate data storage units using the inadvertent matching algorithm to write the data items to be processed, the data access mode can be effectively hidden to prevent potential attackers from inferring the data content by analyzing the access mode; combined with the trusted execution environment, the confidentiality and integrity of the data during the processing process can be further enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 A flowchart of an exemplary method provided by an embodiment of the present disclosure is shown.

[0052] Figure 2 A schematic diagram showing an exemplary principle according to an embodiment of the present disclosure is shown.

[0053] Figure 3 A schematic diagram showing an exemplary effect provided by an embodiment of the present disclosure.

[0054] Figure 4 A schematic diagram showing an exemplary effect provided by an embodiment of the present disclosure.

[0055] Figure 5 A schematic diagram showing an exemplary effect provided by an embodiment of the present disclosure.

[0056] Figure 6 A schematic diagram of an exemplary device provided by an embodiment of the present disclosure is shown.

[0057] Figure 7A schematic diagram of the hardware structure of an exemplary computer device provided in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0058] In order to make the objectives, technical solutions and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0059] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0060] It is understandable that before using the technical solutions of each embodiment of the present disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner, and the user's authorization will be obtained.

[0061] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly remind the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can independently choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0062] As an optional but non-limiting implementation, in response to receiving the user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0063] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0064] As cloud computing technology becomes more and more popular, the security and confidentiality of cloud service data are rapidly becoming a problem. In this evolving environment, trusted execution environments (TEES, i.e. products that use TEEs) are becoming increasingly prominent because they can provide enhanced security features (e.g., isolation, confidentiality, and integrity) without significantly increasing performance overhead and without relying on trusted third parties or non-colluding servers. Currently, many cloud service providers have included trusted execution environments as part of their infrastructure services.

[0065] The Trusted Execution Environment provides a high level of security protection by isolating the execution of selected code and data from the execution of the main operating system, making them inaccessible even to system administrators. Inside the processor of the Trusted Execution Environment, confidential data can be transparently encrypted and decrypted when the data is transferred between the main memory and the processor through memory encryption keys derived from the root key embedded in the processor. In addition, users can verify the integrity of the application or system running in the Trusted Execution Environment through an authentication process, thereby ensuring that the selected code and data can perform calculations correctly and confidentially in an untrusted cloud environment.

[0066] However, side channel attacks related to memory access patterns and timing may cause data in the trusted execution environment to be disclosed. For example, when accessing the memory in the trusted execution environment, such as sorting the memory, the data of each memory block will be constantly exchanged, and this process is a confidential process in the trusted execution environment. However, outside the trusted execution environment, through the analysis and speculation of the side channel data, it can be inferred that this is a sorting process, and even based on the exchange of memory blocks, the range of the exchanged data can be roughly determined.

[0067] In view of this, an embodiment of the present disclosure provides a memory access method based on a trusted execution environment to solve the above problems.

[0068] like Figure 1 As shown, the memory access method based on the trusted execution environment includes:

[0069] Step S101, obtaining at least one data item to be processed to be written into the trusted execution environment.

[0070] In this embodiment, when data needs to be written to a memory deployed in a trusted execution environment, one or more data items to be processed can be generated based on the data to be written, and then each data item to be processed can be written into different data storage units of the memory respectively; wherein each data item to be processed can be a data block of the data to be written.

[0071] In this embodiment, the data items to be processed to be written into the trusted execution environment can be obtained.

[0072] Step S103, for at least part of the data items to be processed, calculate the positions of multiple candidate data storage units corresponding to each of the data items to be processed, and construct an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment.

[0073] In this embodiment, for at least some of the data items to be processed, the positions of multiple candidate data storage units corresponding to each data item to be processed can be calculated, and an association relationship between the data item to be processed and its multiple candidate data storage units can be established. In this embodiment, the multiple candidate data storage units are deployed in the trusted execution environment.

[0074] Step S105 : determining a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset inadvertent matching algorithm and the association relationship.

[0075] In this embodiment, an inadvertent matching algorithm is used to match the association relationship between the data item to be processed and its corresponding multiple candidate data storage units, thereby determining the matching relationship between the data item to be processed and the target data storage unit among the multiple candidate data storage units, and realizing an inadvertent match between the data item to be processed and the target data storage unit.

[0076] Step S107: based on the matching relationship, write the data item to be processed into the target data storage unit.

[0077] After obtaining the matching relationship between the data item to be processed and the target data storage unit, the data item to be processed can be written into the target data storage unit to complete the writing of the data item to be processed into the memory deployed in the trusted execution environment.

[0078] In this embodiment, after obtaining the data items to be processed that are to be written into the memory deployed in the trusted execution environment, for at least part of the data items to be processed, the positions of multiple candidate data storage units of each data item to be processed are first calculated and the association relationship between the data item to be processed and the multiple candidate data storage units deployed in the trusted execution environment is constructed, and then the matching relationship between the data item to be processed and the target data storage unit among the multiple candidate data storage units is determined by using an inadvertent matching algorithm, and then the data item to be processed is written into the target data storage unit deployed in the trusted execution environment based on the matching relationship, thereby realizing an inadvertent memory access method for the trusted execution environment; since the positions of the multiple candidate data storage units of the data items to be processed are first determined, and then the target data storage unit is determined from the multiple candidate data storage units by using an inadvertent matching algorithm to write the data items to be processed, the data access pattern can be effectively hidden to prevent potential attackers from inferring the data content by analyzing the access pattern; combined with the trusted execution environment, the confidentiality and integrity of the data during the processing process can be further enhanced.

[0079] In some embodiments, the calculation of the positions of multiple candidate data storage units corresponding to each of the data items to be processed in step S103 includes: calculating the placement positions of the candidate data storage units in the index table based on a preset number of hash functions, and the number of the hash functions is the same as the number of the candidate data storage units.

[0080] The index table includes multiple table entries, which are used to store index information of the data items to be processed. The specific storage location of the data items to be processed in the memory can be queried through the index information in the index table. In some embodiments, the index table can be a hash table.

[0081] In this embodiment, a preset number of hash functions are used to calculate the placement positions of multiple candidate data storage units in the index table, that is, the positions of the table items stored in the index table of the index information of multiple candidate data storage units are calculated by the hash function. At the same time, the number of hash functions is the same as the number of candidate data storage units, and each hash function corresponds to the placement position of the candidate data storage unit in the index table one by one, that is, the position of the table item stored in the index table of the index information of the candidate data storage unit is processed separately by each hash function.

[0082] In this embodiment, the placement positions of multiple candidate data storage units in the index table are calculated by multiple hash functions, and each hash function independently processes the positions of table entries stored in different candidate data storage units in the index table, thereby eliminating the need to use additional storage space (stash). Compared with the traditional cuckoo hash algorithm, the need for additional storage space (stash) is eliminated, so that there is no need to read the stash when reading the memory, thereby reducing memory usage and improving operational efficiency.

[0083] In some embodiments, the number of hash functions is 3-6.

[0084] In the related art, when the cuckoo hash algorithm is used to determine the storage location of the data item to be processed in the index table, two non-intersecting vertex sets are composed of entries of two hash subtables, and the connection of each data item is defined by (h1(x), h2(x)), where h represents a pseudo-random function. This approach requires a stash to achieve a negligible overflow probability, but the minimum size requirement of the stash significantly slows down the overall search speed of the cuckoo hash table. Even if all stashes are merged into a single stash of size logn, there is no substantial efficiency improvement. Specifically, the existing cuckoo hash design requires linear scanning of hundreds or thousands of data blocks for a single operation, which seriously affects its actual performance. For data with no more than 256 items, both the standard balls-into-bins hash and the cuckoo hash with stash require nearly 50 inadvertent selections for each search. Similarly, path-based ORAM (Oblivious random access memory, which hides which data blocks the client operates on and whether these operations are reads or writes by accessing additional virtual blocks, shuffling data periodically, and continuously writing back data after each read) requires the same number of selections, but with a higher construction complexity. This discovery puts Cuckoo Hash in an awkward position when dealing with medium-sized data block collections, because it must linearly scan its stash, resulting in hundreds or even thousands of additional oblivious selections throughout the ORAM. At the same time, merging stashes does not alleviate the problem, because the merged stash is still small and therefore cannot meet the needs of medium-sized (2 16 ~2 20 blocks or tens to hundreds of megabytes).

[0085] Among them, oblivious random access memory (ORAM) hides which data blocks the client operates on and whether these operations are reads or writes by accessing additional virtual blocks, shuffling data periodically, and continuously writing back data after each read.

[0086] In path-based ORAM, n data blocks are randomly assigned to a binary tree with n / 2 leaf nodes. The client uses a location map to track the leaf node corresponding to each data block. At each access, it selects the path from the root to the leaf containing the target data and another randomly selected path based on the map. Then, it operates the data and shuffles the blocks along the two paths and writes them back, a process called eviction. The optimal complexity of this approach is insufficient.

[0087] In this embodiment, by setting 3-6 hash functions, and each hash function independently processes different table items, the overflow probability can be ignored, so there is no need to use stash, thereby reducing memory usage and improving hash table search efficiency, that is, improving memory access efficiency.

[0088] In some embodiments, the hash function is generated based on a pseudo-random function. In this embodiment, a plurality of keys may be generated using a pseudo-random function, and each hash function uses a different key to calculate the placement position of the candidate data storage unit in the index table.

[0089] In some embodiments, the step S105 of determining the matching relationship between the data item to be processed and the target data storage unit in the plurality of candidate data storage units based on the preset inadvertent matching algorithm and the association relationship includes:

[0090] Step S201, determining a first vertex set based on at least one of the data items to be processed, determining a second vertex set based on the table entry corresponding to the placement position of the candidate data storage unit in the index table, and determining an edge set based on the association relationship.

[0091] In some embodiments, the oblivious matching algorithm may include an oblivious bipartite graph matching algorithm. In this embodiment, the first vertex set of the oblivious bipartite graph matching algorithm, i.e., the left vertex set, includes the data items to be processed, the second vertex set of the oblivious bipartite graph matching algorithm, i.e., the right vertex set, includes the table items corresponding to the placement positions of the candidate data storage units in the index table, and multiple edges are determined based on the association relationship between each data item to be processed and the table items corresponding to the placement positions of the multiple candidate data storage units in the index table.

[0092] In some embodiments, the second vertex set, ie, the right vertex set, may include hash buckets corresponding to the placement positions of the candidate data storage units in the index table, which is not limited in this embodiment.

[0093] In some embodiments, the number of vertices in the second vertex set is greater than the number of vertices in the first vertex set, that is, the number of table entries corresponding to the placement positions of the candidate data storage units in the index table is greater than the number of data items to be processed.

[0094] In some embodiments, the number of vertices in the second vertex set is a multiple of the number of vertices in the first vertex set, that is, the number of table entries corresponding to the placement positions of the candidate data storage units in the index table is a multiple of the number of data items to be processed. For example, the number of vertices in the first vertex set, that is, the number of data items to be processed, is n, and the number of vertices in the second vertex set, that is, the number of table entries corresponding to the placement positions of the candidate data storage units in the index table, is 2n.

[0095] In some embodiments, the number of hash functions, that is, the number of positions of multiple candidate data storage units corresponding to each data item to be processed is k, and the number of sides of each data item to be processed is k.

[0096] Step S203: searching for alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set.

[0097] In this embodiment, the path matching relationship between each vertices in the first vertex set and each vertices in the second vertex set is determined by finding the alternating paths between each vertices in the first vertex set and each vertices in the second vertex set, that is, the path matching relationship between each data item to be processed in the first vertex set and each table item in the second vertex set.

[0098] Among them, all edges in the matching are oriented from right to left, while edges not in the matching are oriented from left to right; a pair of edges sharing the same vertex, exactly one of which is included in the matching is an alternating path, and the edges in the matching are alternating edges.

[0099] Step S205 , determining a matching relationship between the data item to be processed and a corresponding table entry of the target data storage unit in the index table based on a path matching relationship between each vertex in the first vertex set and each vertex in the second vertex set.

[0100] In this embodiment, after obtaining the path matching relationship between each vertex of the first vertex set and each vertex of the second vertex set, the matching relationship between each data item to be processed and the corresponding table entry of the target data storage unit in the index table can be determined based on the path matching relationship.

[0101] In some embodiments, the step S203 of searching for alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set to determine the path matching relationship between vertices in the first vertex set and vertices in the second vertex set includes:

[0102] Step S301 : performing a casual first sorting on the edge set based on a preset first priority rule.

[0103] In this embodiment, the edge set may be randomly sorted in the first order based on the first priority rule. When sorting, the edges may be better selected based on the short points, directions, states or counters of the edges to construct the matching.

[0104] The first priority rule includes at least one of the following: setting the edges pointing to the same vertex from the first vertex set in one group; orienting the edges from the second vertex set to the first vertex set first; orienting the free edges first; orienting the edges with smaller counts first.

[0105] Step S303: traverse the edge set after the first sorting, and construct a first matching relationship between each vertex in the first vertex set and each vertex in the second vertex set.

[0106] In this embodiment, the edge set after the first sorting is traversed to try to build a match.

[0107] If the current edge is the first edge whose left endpoint is in the first sorted edge set, and the state of the previous edge is unmatched, the state may be updated and the current edge may be added to the match. If the current edge is a free edge and the previous edge is matched, the directions of the current edge and the previous edge may be swapped, and their states and matching relationships may be updated.

[0108] Step S305 : performing a second random sorting on the edge set based on a preset second priority rule.

[0109] After the matching is constructed, a casual second ordering of the edge sets is performed according to a second priority rule to further adjust the matching.

[0110] The second priority rule includes at least one of the following: arranging the edges of the second vertex set pointing to the same vertex in one group; directing the edges from the second vertex set to the first vertex set first; directing the edges with larger counts first.

[0111] Step S307, traverse the edge set after the second sorting, adjust the first matching relationship, and obtain the path matching relationship.

[0112] In this embodiment, the edge set after the second sorting is traversed, and the state of each edge is updated. The new state of the edge can be determined according to the current state, direction, and whether the edge is included in the matching.

[0113] Finally, a path matching relationship is output, based on which a matching relationship between the data item to be processed and the table item corresponding to the target data storage unit in the index table can be determined.

[0114] In some embodiments, writing the data item to be processed into the target data storage unit in step S107 includes: writing index information corresponding to the data item to be processed into a table entry in an index table corresponding to the target data storage unit.

[0115] In this embodiment, after obtaining the matching relationship between the data item to be processed and the table entry corresponding to the target data storage unit in the index table, the index information corresponding to the data item to be processed can be written into the table entry corresponding to the target data storage unit in the index table, thereby completing the writing of the data item to be processed in the trusted execution environment.

[0116] In some embodiments, the method further includes: hierarchically storing the entries in the index table.

[0117] In this embodiment, each table item in the index table is stored hierarchically. In this embodiment, the initial layer of the hash table stored hierarchically is a linear scan layer with a capacity of 256 to 1024, and is determined based on the data block size of each candidate data item. In each level, the data items are continuously aligned at each level, which helps to better utilize the chip cache and bandwidth; at the same time, hierarchical storage is more suitable for parallel processing.

[0118] In this embodiment, by hierarchically storing the table items in the index table, the performance of processing large-scale data is effectively improved, which can be applied to scenarios with large data volumes and the need for efficient processing.

[0119] In some embodiments, the method further comprises:

[0120] Step S401: obtaining a query request for a data item to be queried.

[0121] Step S403: perform a hierarchical query on the index table based on the query request.

[0122] Step S405 , in response to obtaining the index information corresponding to the data to be queried in the target level, obtaining the data item to be queried based on the index information.

[0123] Step S407 , performing an oblivious algorithm-based query on at least part of the remaining levels to obtain a first data item, and obtaining a query result for the query request based on the data item to be queried and the first data item.

[0124] The first data item is a data item obtained when querying the memory through the oblivious algorithm, and is a data item that does not match the query request for the data item to be queried. The first data item may be a data item that has been stored in the memory, for example, it may be a data item stored in the memory before the query request. The data item may include a real data item corresponding to the storage request, and may also include a virtual data item that does not correspond to the storage request and is randomly generated by the oblivious algorithm when executing the storage request.

[0125] In this embodiment, when it is necessary to query the data items to be queried stored in the trusted execution environment, a hierarchical query can be performed based on the index table; when the index information corresponding to the data to be queried is obtained in the target level, the data items to be queried can be obtained based on the index information; and after obtaining the index information corresponding to the data to be queried, the query will not be stopped, but the query will continue to be performed on at least part of the remaining levels to obtain the first data item, and the data item to be queried and the first data item are combined together as the query result for the query request, thereby hiding the user's actual query content and improving the confidentiality of the data processing process.

[0126] After obtaining the query result, since the query result is still in the trusted execution environment of the memory, and the data item to be queried is obtained based on the index information, and the first data item is obtained based on the oblivious algorithm query, the user who makes the query request can distinguish between the data item to be queried and the first data item, while the user outside the trusted execution environment cannot distinguish between the data item to be queried and the first data item, thereby ensuring the security of data when retrieving data in the trusted execution environment of the memory.

[0127] In some embodiments, a method for placing a data item to be processed and to be written into a trusted execution environment in a hash table includes:

[0128] Step S501, determine the size of the hash bucket.

[0129] In this embodiment, the size b of the hash bucket (ie, the number of elements that each bucket in the hash table can accommodate) is calculated according to the number n of data items to be processed and the number k of hash functions to be written into the trusted execution environment. Generally, b=2n / k.

[0130] Step S503: Generate a pseudo-random function (PRF) and a key.

[0131] In this embodiment, a pseudo-random function (PRF) is selected, whose output range is {1, ..., b}. K PRF keys ski (i ranges from 1 to k) are randomly generated.

[0132] Step S505, initialization.

[0133] In this embodiment, a first vertex set L (including indexes of all data items to be processed), a second vertex set R (including all possible hash bucket indexes), and E (edge ​​set, used for subsequent graph matching process) are initialized.

[0134] Step S507, establishing an edge.

[0135] In this embodiment, for each data item to be processed, k hash functions (each function uses a different key) are used to calculate k candidate bucket positions, and an edge is established between each data item to be processed and the candidate bucket position.

[0136] Step S509, searching for a match.

[0137] In this embodiment, an oblivious matching algorithm is used to find a match on the graph composed of L, R, and E. This match represents a bucket placement scheme P, that is, the placement position of the data item to be processed in the hash table.

[0138] Among them, the steps of the oblivious matching algorithm include:

[0139] Step S601, initialization.

[0140] In this embodiment, each edge e = (u, v) (where u∈L and v∈R) in the bipartite graph G = (L∪R, E) is initialized, and its direction dir (the default is r, indicating the direction from L to R), state st (including unknown, free.alter (unmatched), alternat_bk (matched), the default is unknown), and counter ctr (indicating the number of times included in the match, the default is 0) are set.

[0141] Among them, a leftward edge indicates that it is included or tends to be included in the match.

[0142] Among them, the left vertex set of the bipartite graph G, namely the first vertex set, consists of n data items to be processed; the right vertex set of the bipartite graph G, namely the second vertex set, consists of 2n table items in the hash table.

[0143] Step S603, outer loop.

[0144] In this embodiment, a better match is found through multiple iterations, wherein the loop variable t traverses from 0 to r, indicating that the maximum number of loops or attempts allowed is r, that is, the maximum allowable length of the alternating path.

[0145] Step S605, first sorting.

[0146] In this embodiment, the edge set E is sorted according to the first priority rule. The first priority rule is based on the endpoint, direction, state or counter of the edge, and the edges can be better selected to build a match through sorting, thereby achieving casual sorting.

[0147] The first priority rule includes: setting the edges of the first vertex set pointing to the same vertex in one group; orienting the edges from the second vertex set to the first vertex set first; orienting the free edges first; orienting the edges with smaller counts first.

[0148] In this embodiment, in each iteration, the edges are sorted according to the first priority rule. It will group the edges by left vertex, then group the free edges to the left, and then group the free edges to the right. A counter is used in this process to ensure that in each iteration, the edges that were previously at the back are moved to the front.

[0149] Step S607, building a match.

[0150] In this embodiment, the sorted edge set is traversed and an attempt is made to construct a match.

[0151] If the current edge e is the first edge in the first sorted edge group whose left endpoint u is in the first sorted edge group, and the previous edge e o If the state of (if any) is unmatched (such as alternate_bk), it may update the state and try to add e to the match M.

[0152] If e is free and e o is matched (alternat), then e and e may be swapped o direction, and update their status and matching relationship.

[0153] In this embodiment, an attempt is made to include the first edge of each group in the matching M, and if the first edge tends to alternate (ie, reverse) and there is indeed a free edge, an augmented path is obtained and the states of the two edges are updated to unknown.

[0154] Step S609, second sorting.

[0155] In this embodiment, after the matching is constructed, the edge set E is sorted according to the second priority rule to further adjust the matching, thereby achieving inadvertent sorting.

[0156] The second priority rule includes: arranging the edges of the second vertex set pointing to the same vertex in one group; directing the edges from the second vertex set to the first vertex set first; and directing the edges with larger counts first.

[0157] In this embodiment, the edge states are propagated through the vertices in R, which requires explicitly regrouping the edges based on their related vertices in R. In each group, the edges that frequently go left and back are prioritized and then scanned linearly.

[0158] Step S611, status update.

[0159] Iterate over the sorted set of edges and update the state of each edge. This may involve deciding the new state based on the edge's current state, direction, and whether it is already included in a matching.

[0160] Step S613, output.

[0161] Finally, a path matching relationship is output, based on which a matching relationship between the data item to be processed and the table item corresponding to the target data storage unit in the index table can be determined.

[0162] In the inadvertent matching algorithm described in this embodiment, all edges in the match are oriented from right to left, while the edges not in the match are oriented from left to right; a pair of edges sharing the same vertex, exactly one of which is included in the match, is an alternating path, and the edges in the match are alternating edges. When adding a new data item to be processed (i.e., a new vertex in L), it is equivalent to recursively finding an alternating path from the new vertex to any currently idle right vertex. For an idle vertex in R, the edge that touches it is regarded as a free edge.

[0163] In this embodiment, Figure 2 As shown in Figure 1, the recursive process is transformed into a propagation-based one. That is, a vertex in L propagates its available free edges and alternating edges to other vertices through the vertices in R.

[0164] In this embodiment, efficient data matching and sorting operations can be achieved without revealing the data matching mode. It is particularly suitable for data processing tasks that require high privacy protection, such as oblivious computing, private data merging, etc. Compared with traditional matching bipartite graph algorithms, oblivious bipartite graph matching provides higher security.

[0165] Step S511, placing an item.

[0166] In this embodiment, the index information of the data item A to be processed is placed at the corresponding position of the hash table T according to the match P found.

[0167] Step S513, initializing the counter.

[0168] In this embodiment, a counter ctr is set for virtual search.

[0169] Step S515, return the table and counter.

[0170] In this embodiment, the filled hash table T and counter ctr are returned.

[0171] Step S517, search, includes steps S5171 to S5177.

[0172] Step S5171, set the return value.

[0173] In this embodiment, if the query key q is empty (⊥), the return value is set to a dummy item (dummy_item) and the counter ctr is updated; otherwise, q is used as the query key.

[0174] Step S5173, calculate the bucket index.

[0175] In this embodiment, k hash functions and updated query keys (or counter values) are used to calculate k bucket indexes.

[0176] Step S5175, scan and select.

[0177] In this embodiment, the hash table entries corresponding to these bucket indexes are scanned, and an attempt is made to find an entry that matches the query key. If a matching entry is found, it is marked as a virtual entry (indicating that it has been accessed).

[0178] Step S5177, return the result.

[0179] In this embodiment, the previously set virtual item (for an empty query) or the actual query result (if found) is returned.

[0180] Step S519, extraction, includes steps S5191 to S5193.

[0181] Step S5191, compress and truncate the table.

[0182] In this embodiment, the items in the hash table T are compressed inadvertently and their size is truncated to half to generate a new table T'.

[0183] Step S5193, return to the table.

[0184] In this embodiment, a new table T' is returned which is inadvertently out of order.

[0185] In this embodiment, when constructing the hash table, the number of iterations r of the oblivious matching algorithm is bound, that is, the maximum allowable length of the alternating path. For a larger n, for example, when n is greater than or equal to a preset value, the maximum allowable length of the alternating path is set to logn; for a smaller n, for example, when n is less than a preset value, the maximum allowable length of the alternating path is set to a preset value, for example, 30.

[0186] In this embodiment, the data to be written into the trusted execution environment is divided into at least one data item to be processed, each of which is compressed inadvertently, and then they are collectively compressed through a non-inadvertent stage, thereby achieving secure access to the memory in the trusted execution environment. Among them, for an array consisting of n data items to be processed, each of which is independently and uniformly randomly labeled, the total number of possible permutations is 2 n To prevent an adversary from distinguishing any particular permutation, all permutations should occur with equal probability, so the entropy is n bits.

[0187] Among them, inadvertent compression methods include:

[0188] Output: A compressed array B'.

[0189] Step S701, selecting a common parameter Z.

[0190] In this embodiment, a common parameter Z is selected, which is a divisor of n and is used to divide the data items to be processed into multiple sub-arrays.

[0191] Step S703, divide array B.

[0192] In this embodiment, for an array B containing n data blocks, the array B is divided into n / Z sub-arrays B_i, where each sub-array contains Z consecutive data blocks. For each i from 1 to n / Z, the sub-array B_i consists of B[1+(i-1)Z] to B[iZ].

[0193] Step S705, inadvertently compress each sub-array B_i.

[0194] In this embodiment, for each sub-array B_i, an oblivious compression method is used to compress it into a compact sub-array B'_i. This step may include rearranging non-empty data blocks to consecutive positions in the sub-array while retaining enough space to simulate the layout of the original sub-array (even if these spaces are empty). It is important that the compression process should be oblivious, that is, it does not depend on the specific content of the data blocks in the sub-array B_i.

[0195] Oblivious compaction can use a pseudo-random function (PRF) to generate a permutation that is used to rearrange data blocks while retaining enough "gaps" to mimic the original layout.

[0196] Step S707, non-inadvertently combining sub-arrays B'_i.

[0197] In this embodiment, after oblivious compaction, all compressed sub-arrays B'_i are non-obliviously (i.e., depending on their contents) combined into a complete array B'. This step usually only requires concatenating the sub-arrays in order, since they are already compacted during the oblivious compaction stage.

[0198] Step S709, returning the compressed array B'.

[0199] In this embodiment, the compressed array B' is returned.

[0200] In this embodiment, the h(n)-bit can be inadvertently relaxed to prevent the adversary from distinguishing between the two h Instead of all possible permutations, this produces h(n)-bits of entropy. As long as h(n) is close to n, effective protection is provided.

[0201] In this embodiment, the relaxation can be achieved by using page-level inattention and cache-level inattention.

[0202] In some embodiments, for most TEEs encrypting data at page granularity, the chip will fetch / flush and encrypt / decrypt the entire page into cache / memory, so some adversaries cannot distinguish specific data accesses within the page. Therefore, when multiple pending data items are located in the same memory page of the trusted execution environment, the pending data items are not inadvertently sorted, thereby achieving page-level inadvertence relaxation.

[0203] In some embodiments, for example, when a local cache maintained by a client cannot be exploited by an adversary, writes and queries to the local cache do not need to be inadvertently ordered to protect access patterns.

[0204] like Figure 3 As shown in the figure, when there are 3 hash functions, the failure probability is as low as 2-64, which can be applied to hash tables larger than 32768. When there are 4-6 hash functions, the utility is better (i.e., it can be applied to smaller hash tables) and the security is higher (i.e., lower failure probability). At this time, the failure probability is less than or equal to 2 -128 .

[0205] like Figure 4 As shown, in the oblivious compression experiment, n data blocks with random values ​​and n uniformly random marker bits are generated, half of which are 1 and half are 0. Figure 4Comparisons of computational time of the relaxed oblivious compaction algorithm are shown with (orcompact) which runs in 0(nlogn) time and (0CompactByHalf}) which has been adapted to be doubly oblivious and runs in 0(nlogZ) time.

[0206] exist Figure 4 In Table (a), it is observed that the h-bit careless compression of the embodiment of the present application achieves a significant performance improvement from 7.9 times to 43 times compared with the completely careless method, at the cost of about 1% bit carelessness loss. At the same time, it shows that the improved method described in the embodiment of the present application outperforms the completely careless method orcompact in performance, with an improvement factor ranging from 1.1 times to 6.9 times, thanks to the additional input assumptions and the acceptance of a negligible probability of failure.

[0207] Figure 4 Table (b) shows the execution time of the three algorithms at different data block sizes. This further emphasizes the overall performance improvement provided by the method described in the embodiment of the present application. An inflection point is observed in the execution time of all three algorithms at about 2 8 , which may be due to CPU cache size, since the entire data blocks need to be accessed for oblivious operations, rather than just checking their mark bits.

[0208] Figure 4 Table (c) shows the real-time performance of these algorithms under increased number of threads. It shows that all three algorithms demonstrate effective parallelization capabilities. Specifically, as the number of threads increases, the performance improvement of the method described in the embodiment of the present application decreases from 12.6 times to 7.7 times. This shows that the method described in the embodiment of the present application has a stronger performance advantage in a single-threaded environment.

[0209] Figure 4 Table (d) shows that the running time of the method described in the embodiment of the present application grows logarithmically with the subarray size Z, which is expected due to its asymptotic time complexity O(nlogz). It also shows the ratio of security loss to bit carelessness under different Z. It can be observed that as Z increases, the security loss decreases rapidly, and its absolute value is also quite low, ranging from 0.01% to 1%.

[0210] like Figure 5 As shown, the performance of the method described in the embodiment of the present application is compared with that of Oblix. Among them, n data blocks with keys and random bit values ​​from 0 to n-1 are generated. These blocks are then randomly shuffled to replace the data, and then the method described in the embodiment of the present application is constructed based on this data, and the construction time is amortized over n data accesses.

[0211] like Figure 5As shown, the amortized access time of the method described in the embodiment of the present application grows logarithmically with its capacity n, ranging from 59 microseconds to 212.8 microseconds for 216216 to 226226 data blocks. At the same time, simple relaxation measures at the page level and cache level bring performance improvements of about 5.5% to 20% and 7.4% to 28%, respectively, assuming that the memory page size is 4KB and the private cache size is 128KB.

[0212] Figure 5 Table (b) shows that the method described in the embodiment of the present application is about 3.1 times to 6.8 times faster than Oblix. Specifically, the access time of the method described in the embodiment of the present application when processing 216216 data blocks is 59 microseconds, while the access time of Oblix is ​​382.3 microseconds. The access time of the method described in the embodiment of the present application when processing 226226 data blocks is 212.8 microseconds, while Oblix requires more than 650 microseconds.

[0213] Figure 5 Table (c) illustrates that parallelization effectively improves the access efficiency of the method described in the embodiment of the present application, and can support up to 8 threads.

[0214] Figure 5 In Table (d), it is observed that the access time increases slowly with the expansion of the data block size (note that the x-axis is a logarithmic scale), that is, the method described in the embodiment of the present application can maintain its efficiency even when processing large data blocks. At the same time, the two relaxed implementations show better performance improvement speed when processing small data blocks, because they are less effective when processing large blocks of data.

[0215] It should be noted that the method of the embodiment of the present disclosure can be performed by a single device, such as a computer or a server. The method of the present embodiment can also be applied in a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present disclosure, and the multiple devices will interact with each other to complete the described method.

[0216] It should be noted that the above describes some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0217] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a memory access device based on a trusted execution environment.

[0218] refer to Figure 6 , the memory access device based on the trusted execution environment comprises:

[0219] The acquisition module 11 is configured to: acquire at least one to-be-processed data item to be written into the trusted execution environment;

[0220] The calculation module 13 is configured to: for at least part of the data items to be processed, calculate the position of multiple candidate data storage units corresponding to each of the data items to be processed, and establish an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment;

[0221] The determination module 15 is configured to: determine the matching relationship between the to-be-processed data item and the target data storage unit in the plurality of the candidate data storage units based on a preset inadvertent matching algorithm and the association relationship;

[0222] The writing module 17 is configured to: write the to-be-processed data item into the target data storage unit based on the matching relationship.

[0223] For the convenience of description, the above device is described by dividing it into various modules according to its functions. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0224] The device of the above embodiment is used to implement the corresponding memory access method based on a trusted execution environment in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0225] In some embodiments, calculating the position of a plurality of candidate data storage units corresponding to each of the data items to be processed includes:

[0226] The placement positions of the candidate data storage units in the index table are calculated based on a preset number of hash functions, and the number of the hash functions is the same as the number of the candidate data storage units.

[0227] In some embodiments, the number of hash functions is 3-6.

[0228] In some embodiments, the determining the matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset inadvertent matching algorithm and the association relationship includes:

[0229] Determine a first vertex set based on at least one of the data items to be processed, determine a second vertex set based on the table entry corresponding to the placement position of the candidate data storage unit in the index table, and determine an edge set based on the association relationship;

[0230] Finding alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set;

[0231] Based on the path matching relationship between each vertex in the first vertex set and each vertex in the second vertex set, a matching relationship between the data item to be processed and a corresponding table entry of the target data storage unit in the index table is determined.

[0232] In some embodiments, searching for alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set, includes:

[0233] Performing a casual first sorting of the edge set based on a preset first priority rule;

[0234] Traversing the edge set after the first sorting, and constructing a first matching relationship between each vertex in the first vertex set and each vertex in the second vertex set;

[0235] Performing a second casual sorting of the edge set based on a preset second priority rule;

[0236] The edge set after the second sorting is traversed, the first matching relationship is adjusted, and the path matching relationship is obtained.

[0237] In some embodiments, the first priority rule includes at least one of the following:

[0238] Set the edges of the first vertex set pointing to the same vertex in one group;

[0239] The edges are first directed from the second vertex set to the first vertex set;

[0240] The free edge is oriented first;

[0241] Edges with smaller counts are directed first.

[0242] In some embodiments, the second priority rule includes at least one of the following:

[0243] Set the edges of the second vertex set pointing to the same vertex in one group;

[0244] The edges are first directed from the second vertex set to the first vertex set;

[0245] Edges with larger counts are directed first.

[0246] In some embodiments, writing the to-be-processed data item into the target data storage unit comprises:

[0247] The index information corresponding to the data item to be processed is written into the table entry corresponding to the target data storage unit in the index table.

[0248] In some embodiments, the method further comprises:

[0249] The table items in the index table are stored hierarchically.

[0250] In some embodiments, the method further comprises:

[0251] Obtaining a query request for a data item to be queried;

[0252] Performing a hierarchical query on the index table based on the query request;

[0253] In response to obtaining index information corresponding to the data to be queried in the target level, obtaining the data item to be queried based on the index information;

[0254] A query based on an oblivious algorithm is performed on at least part of the remaining levels to obtain a first data item, and a query result for the query request is obtained based on the data item to be queried and the first data item.

[0255] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the memory access method based on a trusted execution environment described in any of the above embodiments is implemented.

[0256] Figure 7 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.

[0257] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0258] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0259] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0260] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0261] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0262] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0263] The electronic device of the above-mentioned embodiment is used to implement the corresponding memory access method based on a trusted execution environment in any of the above-mentioned embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0264] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the memory access method based on a trusted execution environment as described in any of the above embodiments.

[0265] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0266] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the memory access method based on the trusted execution environment as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0267] Based on the same inventive concept, corresponding to the method described in any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer so that the computer and / or the processor execute the memory access method based on a trusted execution environment. Corresponding to the execution subject corresponding to each step in each embodiment of the method, the processor that executes the corresponding step can belong to the corresponding execution subject.

[0268] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the memory access method based on the trusted execution environment as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0269] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples. Based on the concept of the present disclosure, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of simplicity.

[0270] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present disclosure difficult to understand, the known power / ground connections to the integrated circuit (IC) chips and other components may or may not be shown in the provided figures. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). Where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it is apparent to those skilled in the art that the embodiments of the present disclosure can be implemented without these specific details or with changes in these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0271] Although the present disclosure has been described in conjunction with specific embodiments of the present disclosure, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.

[0272] The embodiments of the present disclosure are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure should be included in the scope of protection of the present disclosure.

Claims

1. A memory access method based on a trusted execution environment, comprising: Acquire at least one data item to be processed to be written into the trusted execution environment; For at least part of the data items to be processed, calculate the positions of multiple candidate data storage units corresponding to each of the data items to be processed, and establish an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment; Based on a preset inadvertent matching algorithm and the association relationship, determining a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units; Based on the matching relationship, the data item to be processed is written into the target data storage unit.

2. The method according to claim 1, wherein: The calculating the position of a plurality of candidate data storage units corresponding to each of the data items to be processed comprises: The placement positions of the candidate data storage units in the index table are calculated based on a preset number of hash functions, and the number of the hash functions is the same as the number of the candidate data storage units.

3. The method according to claim 2, wherein: The number of the hash functions is 3-6.

4. The method according to claim 2, wherein: The determining, based on a preset inadvertent matching algorithm and the association relationship, a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units comprises: Determine a first vertex set based on at least one of the data items to be processed, determine a second vertex set based on the table entry corresponding to the placement position of the candidate data storage unit in the index table, and determine an edge set based on the association relationship; Finding alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set; Based on the path matching relationship between each vertex in the first vertex set and each vertex in the second vertex set, a matching relationship between the data item to be processed and a corresponding table entry of the target data storage unit in the index table is determined.

5. The method according to claim 4, wherein: The step of searching for alternating paths between vertices in the first vertex set and vertices in the second vertex set based on the edge set, and determining path matching relationships between vertices in the first vertex set and vertices in the second vertex set, includes: Performing a casual first sorting of the edge set based on a preset first priority rule; Traversing the edge set after the first sorting, and constructing a first matching relationship between each vertex in the first vertex set and each vertex in the second vertex set; Performing a second casual sorting of the edge set based on a preset second priority rule; The edge set after the second sorting is traversed, the first matching relationship is adjusted, and the path matching relationship is obtained.

6. The method according to claim 5, wherein: The first priority rule includes at least one of the following: Set the edges of the first vertex set pointing to the same vertex in one group; The edges are first directed from the second vertex set to the first vertex set; The free edge is oriented first; Edges with smaller counts are directed first.

7. The method according to claim 5, wherein: The second priority rule includes at least one of the following: Set the edges of the second vertex set pointing to the same vertex in one group; The edges are first directed from the second vertex set to the first vertex set; Edges with larger counts are directed first.

8. The method according to claim 4, wherein: Writing the to-be-processed data item into the target data storage unit comprises: The index information corresponding to the data item to be processed is written into the table entry corresponding to the target data storage unit in the index table.

9. The method according to claim 8, further comprising: The table items in the index table are stored hierarchically.

10. The method according to claim 9, further comprising: Obtaining a query request for a data item to be queried; Performing a hierarchical query on the index table based on the query request; In response to obtaining index information corresponding to the data to be queried in the target level, obtaining the data item to be queried based on the index information; A query based on an oblivious algorithm is performed on at least part of the remaining levels to obtain a first data item, and a query result for the query request is obtained based on the data item to be queried and the first data item.

11. A memory access device based on a trusted execution environment, comprising: An acquisition module is configured to: acquire at least one to-be-processed data item to be written into the trusted execution environment; A calculation module is configured to: for at least part of the data items to be processed, calculate the position of multiple candidate data storage units corresponding to each of the data items to be processed, and establish an association relationship between the data items to be processed and the multiple candidate data storage units; wherein the multiple candidate data storage units are deployed in the trusted execution environment; A determination module is configured to: determine a matching relationship between the to-be-processed data item and a target data storage unit in the plurality of candidate data storage units based on a preset inadvertent matching algorithm and the association relationship; The writing module is configured to: write the to-be-processed data item into the target data storage unit based on the matching relationship.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the memory access method based on a trusted execution environment as described in any one of claims 1 to 10 is implemented.

13. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the memory access method based on a trusted execution environment as described in any one of claims 1 to 10.

14. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, enable the computer to execute the memory access method based on a trusted execution environment as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data access method and device for credible storage equipment

    CN108345803A

  • Techniques for secure-chip memory for trusted execution environments

    CN108959932A

  • Increasing effective cache associativity

    CN110045921A

  • Index independent Cuckoo filter, consistency Cuckoo filter and operation method

    CN110046164A

  • Data processing method, firewall generation method, computing device and storage medium

    CN114268501A