Data query method, device and electronic device based on a trusted execution environment

By compressing and hash mapping of query data in a trusted execution environment, the query problem of large-scale data sets under memory constraints is solved, and efficient private data processing and fast positioning is achieved.

CN114861228BActive Publication Date: 2025-08-05HANGZHOU NUOWEI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210580997.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-25
Publication Date
2025-08-05
Estimated Expiration
2042-05-25

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process and query large-scale privacy data sets in trusted execution environments, especially Intel SGX V1 computing environments, due to 256MB of secure memory.

Method used

By compressing and converting the query data in a trusted execution environment, generating hash values, and mapping hash arrays and ordered conflict arrays, reducing memory usage and achieving rapid data positioning.

Benefits of technology

Implementing high-performance privacy query calculations under limited memory conditions reduces the memory usage of trusted execution environments and supports rapid positioning of data to be queried.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114861228B_ABST
    Figure CN114861228B_ABST
Patent Text Reader

Abstract

Embodiments of the present invention relate to a data query method, device, electronic device, and storage medium based on a trusted execution environment. The method comprises: determining query data related to the trusted execution environment; compressing and converting the query data in accordance with data conversion rules in the trusted execution environment to obtain first converted data; determining a first hash value of the first converted data; determining a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determining a query result based on the target hash value; and outputting the query result. The technical solution of the embodiment of the present invention compresses and converts result data of a large amount of data in accordance with the data conversion rules, performs hash mapping and sorting on the compressed data to form a data group for data query, thereby reducing the memory usage of the trusted execution environment by large-scale data, facilitating calculations, and enabling rapid location of data to be queried.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data security, and in particular to a data query method, device, and electronic device based on a trusted execution environment. Background Art

[0002] In the field of privacy-preserving computing, large amounts of data may lead to hardware computing limitations. For example, the secure memory size of a common Trusted Execution Environment (TEE) computing environment in Intel SGXV1 is limited to 256MB. Therefore, using conventional data query methods can easily exceed hardware computing limitations. For example, in the field of genetic privacy query computing, when the dataset is large, directly using common data structures and algorithms can easily exceed 256MB of memory.

[0003] Therefore, how to realize privacy data processing and query for large-scale data sets has become an urgent problem to be solved. Summary of the Invention

[0004] Based on the above-mentioned situation of the prior art, the purpose of the embodiments of the present invention is to provide a data query method, device, electronic device and storage medium based on a trusted execution environment, which can perform high-performance privacy query calculations under limited memory conditions, and is particularly suitable for the field of genetic privacy computing.

[0005] To achieve the above object, according to one aspect of the present invention, a data query method based on a trusted execution environment is provided, comprising:

[0006] Determine query data related to the trusted execution environment;

[0007] In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data;

[0008] In the trusted execution environment, determining a first hash value of the first converted data;

[0009] In a trusted execution environment, determining a target hash value from mapping information stored in a secure memory of the trusted execution environment based on a first hash value, and determining a query result based on the target hash value, wherein the mapping information includes a hash array and an ordered collision array, the hash array includes sorted second hash values, the second hash values are obtained by performing hash mapping on second conversion data, the second conversion data are obtained by performing compression conversion on result data according to a data conversion rule, and the ordered collision array is determined based on repeated hash values in the hash array;

[0010] Output the query results.

[0011] Furthermore, the method further comprises:

[0012] Performing compression conversion on the result data according to the data conversion rule to obtain second converted data;

[0013] Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array;

[0014] Extract the repeated second hash values in the hash array and sort them to form an ordered conflict array;

[0015] Add hash arrays and ordered collision arrays to the trusted execution environment's secure memory.

[0016] Furthermore, the result data includes result data of gene information, and the compression conversion of the result data according to the data conversion rule to obtain the second converted data includes:

[0017] According to data conversion rules, the chromosome information and the position information within the chromosome in the gene information are converted into first target information corresponding to the entire human body;

[0018] According to the data conversion rules, the reference genome and mutant genome in the gene information are converted into the second target information;

[0019] According to the data conversion rules, the gene name in the gene information is converted into the third target information;

[0020] Second conversion data is determined according to the first target information, the second target information, and the third target information.

[0021] Furthermore, the query data related to the trusted execution environment is determined, including:

[0022] Providing an interactive page, wherein the interactive page includes a data input control;

[0023] Based on the triggering of the data input control, query data related to the trusted execution environment is obtained.

[0024] Furthermore, determining the target hash value from mapping information stored in a secure memory of the trusted execution environment according to the first hash value in the trusted execution environment includes:

[0025] Extracting relevant hash values from the sorted second hash values in the hash array according to the size of the first hash value, and performing a first match to determine a target hash value;

[0026] When the first match fails, extracting relevant hash values from the sorted second hash values in the ordered collision array according to the size of the first hash value, and performing a second match to determine the target hash value;

[0027] When the second match fails, the query failure is determined as the query result and fed back.

[0028] Furthermore, determining the query result based on the target hash value includes:

[0029] Determine target result data corresponding to the target hash value in the trusted execution environment;

[0030] The query data is matched with the target result data in the trusted execution environment, and when the match is successful, the target result data is used as the query result.

[0031] According to a second aspect of the present invention, a data query method based on a trusted execution environment is provided, comprising:

[0032] Performing compression conversion on the result data according to the data conversion rule to obtain second converted data;

[0033] Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array;

[0034] Extract the repeated second hash values in the hash array and sort them to form an ordered conflict array;

[0035] Add hash arrays and ordered collision arrays to the secure memory of the trusted execution environment;

[0036] Provides data query services based on the hash array and ordered collision array in the secure memory of the trusted execution environment.

[0037] Furthermore, providing data query services based on the hash array and ordered collision array in the secure memory of the trusted execution environment includes:

[0038] Providing an interactive page to obtain query data related to the trusted execution environment based on the interactive page;

[0039] In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data;

[0040] In the trusted execution environment, determining a first hash value of the first converted data;

[0041] In the trusted execution environment, extracting relevant hash values from the sorted second hash values of the hash array according to the size of the first hash value, and performing a first match to determine a target hash value;

[0042] In the trusted execution environment, determining target result data corresponding to the target hash value;

[0043] In the trusted execution environment, the query data is matched with the target result data, and when the match is successful, the target result data is used as the query result;

[0044] Output the query results to be displayed on the interactive page.

[0045] Furthermore, the method further comprises:

[0046] When the first match fails, in the trusted execution environment, extracting relevant hash values from the sorted second hash values in the ordered collision array according to the size of the first hash value, and performing a second match to determine the target hash value;

[0047] When the second match fails, it is determined that the query fails as a query result.

[0048] According to a third aspect of the present invention, a data query device based on a trusted execution environment is provided, comprising:

[0049] A data conversion module is configured to determine query data related to a trusted execution environment; in the trusted execution environment, compress and convert the query data according to a data conversion rule to obtain first converted data;

[0050] a data query module, configured to determine a first hash value of first converted data in a trusted execution environment; determine, in the trusted execution environment, a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determine a query result based on the target hash value, wherein the mapping information includes a hash array and an ordered collision array, the hash array includes sorted second hash values, the second hash values being obtained by performing hash mapping on second converted data, the second converted data being obtained by performing compression conversion on result data according to a data conversion rule, and the ordered collision array being determined based on repeated hash values in the hash array;

[0051] The query result output module is used to output the query results.

[0052] According to a fourth aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and executable instructions stored in the memory and run on the processor, wherein when the processor executes the program, the query method as described in the first aspect or the second aspect of the present invention is implemented.

[0053] According to a fifth aspect of the present invention, a computer-readable storage medium is provided, on which computer-executable instructions are stored. When the executable instructions are executed by a processor, the query method as described in the first aspect or the second aspect of the present invention is implemented.

[0054] In summary, the embodiments of the present invention provide a data query method, device, electronic device and storage medium based on a trusted execution environment, the method comprising: determining query data related to the trusted execution environment; in the trusted execution environment, compressing and converting the query data according to data conversion rules to obtain first conversion data; in the trusted execution environment, determining a first hash value of the first conversion data; in the trusted execution environment, determining a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determining a query result based on the target hash value; and outputting the query result. The technical solution of the embodiments of the present invention compresses and converts the result data of a large amount of data according to the data conversion rules, performs hash mapping and sorting on the basis of the data compression to form a data group for data query, thereby reducing the memory usage of the trusted execution environment by large-scale data, facilitating calculations, and enabling rapid positioning of data to be queried. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a flow chart of a data query method based on a trusted execution environment provided by an embodiment of the present invention;

[0056] Figure 2 is a flow chart of a data query method based on a trusted execution environment provided by another embodiment of the present invention;

[0057] Figure 3 This is a block diagram of a data query device based on a trusted execution environment provided by an embodiment of the present invention;

[0058] Figure 4 is a block diagram of a data query device based on a trusted execution environment provided by another embodiment of the present invention;

[0059] Figure 5 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0060] To make the objectives, technical solutions, and advantages of the present invention more clearly understood, the present invention will be further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present invention.

[0061] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the usual meanings understood by people with ordinary skills in the field to which this disclosure belongs. The words "first", "second" and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Words such as "include" or "comprising" mean that the elements or objects preceding the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects.

[0062] The technical solution of the present invention is described in detail below with reference to the accompanying drawings. In an embodiment of the present invention, a data query method based on a trusted execution environment is provided. Figure 1 The flowchart of the method is shown in FIG. 1 , and the data query method 100 based on the trusted execution environment includes the following steps:

[0063] S102: Determine query data related to the trusted execution environment; and compress and convert the query data in the trusted execution environment according to data conversion rules to obtain first converted data. Determine the query data related to the trusted execution environment by providing a user with an interactive page having data input controls, allowing the user to trigger corresponding query data input on the interactive page. The query data related to the trusted execution environment is obtained based on the triggering of the data input controls.

[0064] S104. In the trusted execution environment, determine a first hash value of the first converted data, determine a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determine a query result based on the target hash value.

[0065] In step S104, a target hash value is determined in the mapping information based on the first hash value converted from the query data to determine the query result. The mapping information includes a hash array and an ordered collision array. The hash array includes sorted second hash values, which are obtained by hash mapping the second converted data. The second converted data is obtained by compressing and converting the result data according to the data conversion rules. The ordered collision array is determined based on repeated hash values in the hash array. The hash array and ordered collision array can be generated by the following steps:

[0066] S1041. Compress and convert the result data according to the data conversion rules to obtain the second conversion data. Wherein, the result data, for example, includes the result data of genetic information. The embodiment of the present invention is particularly aimed at application scenarios with large data sets in the field of genetic privacy computing. The result data (i.e., control data with results) is, for example, a specific data type in the genetic field, including chromosome information data in the genetic information, position data within the chromosome, reference genome data, mutation genome data, and gene name data. Wherein, the chromosome information data (CHROM) and the position data within the chromosome (POS) indicate the position of the mutation site relative to the reference genome data (REF), such as the base number of the chromosome; the reference genome data (REF) includes A, T, C, and G character strings, a single string; the mutation genome data (ALT) is similar to the reference genome data (REF), indicating information about gene mutations. The steps of the compression conversion include:

[0067] S10411. Convert the chromosome information and the positional information within the chromosome in the genetic information into first target information corresponding to the entire human body according to data conversion rules. Convert the chromosome information and the positional data within the chromosome into the global position of the human body (the human body has 23 pairs of chromosomes and 46 chromosomes) according to mapping rules, thereby forming the first target information, which is, for example, a 32-bit value.

[0068] S10412: Convert the reference genome and mutant genome in the gene information into second target information according to data conversion rules. Convert the reference genome data and mutant information data into second target information according to mapping rules, where the second target information is, for example, a 16-bit value.

[0069] S10413: Convert the gene name in the gene information into third target information according to the data conversion rule. Convert the gene name into the third target information according to the mapping rule, where the third target information is, for example, a 15-bit value.

[0070] S10414, based on the first target information, the second target information and the third target information, determine the second conversion data. In this step, the first target information, the second target information and the third target information can also be compressed and converted to determine the second conversion data. According to the above conversion steps, when determining the mapping information, complex information can be converted into numerical values, and the data conversion rules can include the correspondence between genetic information and target information. The genetic information is chromosome information, chromosome position, etc. The target information can be a string of numerical values (32 bits, 15 bits, 14 bits, etc.). The numerical values (target information) corresponding to different chromosomes and different chromosome positions can be determined by exhaustive enumeration. The reference genome is similar to the mutant genome, and the larger data can be compressed into 8 bytes, 8 bits per byte, for a total of 64 bits, of which the last bit can be 0 or 1 to represent that the hash value has no conflict or the hash value has a conflict. The technical solution of this embodiment of the present invention converts and compresses the data, and each set of data only takes up 8 bytes (8 bits per byte, for a total of 64 bytes, the first 32 bytes, the middle 16 bytes, and the last 15 plus 1 byte), thereby reducing the memory usage and improving the query efficiency. The above 8-byte solution is only an example, and other similar solutions should also fall within the scope of the embodiments of the present invention.

[0071] S1042. Determine a second hash value of the second converted data through hash mapping, map it to the secure memory of the trusted execution environment, and sort it according to the second hash value to form a hash array. Hash value conversion can be performed using existing hash function methods, such as adding the chromosome position data and the mutation information data and taking the remainder, or other existing hash function methods can be used. After determining the hash value, the data can be sorted from small to large to form a hash array. By sorting the hash values to obtain the hash array, data queries can be directly located in the hash array according to size, without having to match them one by one, thereby improving processing efficiency.

[0072] S1043: Extract repeated second hash values from the hash array and sort them to form an ordered conflict array. The ordered conflict array is also obtained by sorting.

[0073] S1044: Add the hash array and the ordered collision array to the secure memory of the trusted execution environment. The hash array and the ordered collision array may be established in the secure memory of the trusted execution environment. At this point, the hash array and the ordered collision array contain no hash values. After determining the second hash value through hash mapping, the second hash value may be added to the hash array. A determination is made as to whether the second hash value is duplicated with other second hash values in the hash array. If so, the duplicated second hash values are extracted from the hash array and added to the ordered collision array, which are then sorted to obtain a sorted hash array and a sorted ordered collision array.

[0074] The above-mentioned step S104 may also include, in the trusted execution environment, determining a target hash value from mapping information stored in the secure memory of the trusted execution environment based on the first hash value. Specifically, the steps may be: extracting relevant hash values from the sorted second hash values of the hash array according to the size of the first hash value, and performing a first match to determine the target hash value; when the first match fails, extracting relevant hash values from the sorted second hash values of the ordered collision array according to the size of the first hash value, and performing a second match to determine the target hash value; when the second match fails, determining a query failure as a query result and feeding it back. Determining the query result based on the target hash value includes: determining target result data corresponding to the target hash value in the trusted execution environment; matching the query data with the target result data in the trusted execution environment, and using the target result data as the query result if the match succeeds.

[0075] The following example illustrates the formation process of the hash array and the ordered conflict array: all data are formed into a uint64 ordered record array with a length of 2.6M, and sorted from small to large according to the value of the hash function; an array with a specific length (for example, 3*2*20) is created based on the ordered record array, the basic storage unit is uint64, and the initialization value is 0, which is the hash array, and an empty uint64 array is created at the same time, which is the ordered conflict array, with a capacity of, for example, 128*2*10 (i.e., 128k); then the ordered record array is traversed, and for each record in the ordered record array, the hash value is calculated according to the hash function. If the position of the hash value in the hash array is 0 and there is no conflict record for the current record, the current record is stored in the position of the hash value corresponding to the hash array, where the last bit is 1; if the current record has a conflict, the continuous conflict record is stored in the ordered conflict record, and the index and the number of continuous conflict records in the corresponding ordered conflict array are stored in the corresponding position of the hash array (the upper 32 bits are the storage index, the next 8 bits are the storage conflict number, the last bit is 1, and the rest are 0). Finally, the ordered record array is released, and the redundant memory in the ordered conflict array is released. S106: Output the query result.

[0076] In an embodiment of the present invention, a data query method based on a trusted execution environment is also provided. Figure 2 The flowchart of the method is shown in FIG. 2 , and the data query method 200 based on a trusted environment includes the following steps:

[0077] S202: Compress and convert the result data according to the data conversion rule to obtain second converted data.

[0078] S204: Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array.

[0079] S206: Extract repeated second hash values from the hash array, sort them, and form an ordered collision array. Add the hash array and the ordered collision array to the secure memory of the trusted execution environment.

[0080] The establishment of the hash array and the ordered conflict array in the above steps of this embodiment of the present invention is the same as the process in the above embodiment of the present invention, so its repeated description will be omitted here.

[0081] S208: Provide data query services based on the hash array and ordered collision array in the secure memory of the trusted execution environment. The data query service process may include the following steps:

[0082] S2081: Provide an interactive page to obtain query data related to the trusted execution environment based on the interactive page. The interactive page can be provided so that the user can output query data based on the interactive page.

[0083] S2082. In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data, and determine a first hash value of the first converted data in the trusted execution environment.

[0084] S2083. In the trusted execution environment, extract relevant hash values from the sorted second hash values of the hash array according to the magnitude of the first hash value, and perform a first match to determine the target hash value. If the first match fails, in the trusted execution environment, extract relevant hash values from the sorted second hash values of the ordered collision array according to the magnitude of the first hash value, and perform a second match to determine the target hash value. In the trusted execution environment, determine target result data corresponding to the target hash value.

[0085] S2084. In the trusted execution environment, match the query data with the target result data, and when the first match or the second match succeeds, use the target result data as the query result; when the second match fails, determine query failure as the query result.

[0086] S2085. Output the query results to display on the interactive page.

[0087] In the above query process, the hash value of the genetic information to be queried can be calculated, and then the hash value can be matched with the hash value in the hash array to quickly locate the gene. If the hash value of the genetic information to be queried does not match the hash data, it is matched with the data in the ordered collision array. It should be noted that after the hash value of the genetic information to be queried is matched with the hash value in the hash array or the ordered collision array, the genetic information to be queried is matched with the original genetic information to finally obtain the analysis result. The use of hash values in the above process can achieve rapid location query.

[0088] The above data query step is illustrated by an example. The query information of chromosome information data (CHROM), position data within chromosome (POS), reference genome data (REF), and reference genome data (REF) is encoded as a 64-bit unsigned integer q and first sent to the hash array j = f(q,H) through the hash function. If the flag bit M(j) = 0, it indicates that such information does not exist in the hash array. The flag bit M(j) is set to the last bit of the above 64-bit unsigned integer. The flag bit uses 1 and 0 to represent two different types, 0 represents no and 1 represents yes, for identification. If the flag bit M(j) ≠ 0, the remaining 63 bits M(j) will be compared with the query information. If and only if all query information (i.e., chromosome information data (CHROM), position data within chromosome (POS), reference genome data (REF), and reference genome data (REF)) match, the mapped gene mapping will be returned. Otherwise, such query information does not exist in the hash array. If the flag bit M(j) is 1, the search starts at position k. j and search length L j The remaining 63 bits are extracted and M(j) is used to search the ordered index matrix C(k j ,k j +L j ) column. If a match is found, the mapped gene name information will be returned, otherwise there is no such query information in the hash array. In order to process VCF files with massive information, set H = 3*2 20 ≈3 million, reducing the number of hash collisions. Therefore, storing the index array and C requires approximately 36MB of memory M, which meets the secure memory limit of Intel SGX V1.

[0089] The embodiment of the present invention further provides a data query device based on a trusted execution environment, Figure 3 , which shows a block diagram of the data query device based on a trusted execution environment, the device 300 includes:

[0090] The data conversion module 301 is used to determine query data related to the trusted execution environment; in the trusted execution environment, the query data is compressed and converted according to the data conversion rules to obtain first converted data;

[0091] A data query module 302 is configured to determine, in a trusted execution environment, a first hash value of first converted data; determine, in the trusted execution environment, a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determine a query result based on the target hash value, wherein the mapping information includes a hash array and an ordered collision array, the hash array including sorted second hash values, the second hash values being obtained by performing hash mapping on second converted data, the second converted data being obtained by performing compression conversion on result data according to a data conversion rule, and the ordered collision array being determined based on repeated hash values in the hash array;

[0092] The query result output module 303 is used to output the query result.

[0093] The specific functions and operations of each module in the above-mentioned data query device 300 based on a trusted execution environment have been described in detail in the data query method based on a trusted execution environment in the above-mentioned embodiment, so their repeated description will be omitted here.

[0094] The embodiment of the present invention further provides a data query device based on a trusted execution environment, Figure 4 , which shows a block diagram of the data query device based on a trusted execution environment, the device 400 includes:

[0095] The data conversion module 401 is configured to perform compression conversion on the result data according to data conversion rules to obtain second converted data.

[0096] An array generation module 402 is configured to determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array; extract duplicate second hash values from the hash array, sort the values to form an ordered collision array, and add the hash array and the ordered collision array to the secure memory of the trusted execution environment.

[0097] The data query providing module 403 is used to provide data query services based on the hash array and the ordered collision array in the secure memory of the trusted execution environment.

[0098] The specific functions and operations of each module in the above-mentioned data query device 400 based on a trusted execution environment have been described in detail in the data query method based on a trusted execution environment in the above-mentioned embodiment, so their repeated description will be omitted here.

[0099] In an embodiment of the present invention, an electronic device is also provided, including a memory, a processor, and executable instructions stored in the memory and run on the processor. When the processor executes the program, the data query method as described in the above embodiment of the present invention is implemented. Figure 5 FIG. 5 is a schematic diagram of the structure of the electronic device 500 provided in this embodiment of the present application. Figure 5 As shown, the electronic device 500 includes: one or more processors 501 and a memory 502; and computer-executable instructions stored in the memory 502. When executed by the processor 501, the executable instructions cause the processor 501 to perform the data query method of the above-mentioned embodiment. The processor 501 can be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and can control other components in the electronic device to perform desired functions. The memory 502 can include one or more computer program products, which can include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory can include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory can include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions can be stored on the computer-readable storage medium, and the processor 501 can execute the program instructions to implement the steps of the data query method of the above-mentioned embodiment of the present invention and / or other desired functions.

[0100] Embodiments of the present invention further provide a computer-readable storage medium having computer-executable instructions stored thereon. When the executable instructions are executed by a processor, the data query method described in the above embodiments is implemented. The computer-readable storage medium can be any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable 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. It should be understood that the processor in the embodiment of the present invention can be a central processing unit (CPU), and the processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0101] In summary, the present invention relates to a data query method, device, electronic device and storage medium based on a trusted execution environment, the method comprising: determining query data related to the trusted execution environment; in the trusted execution environment, compressing and converting the query data according to data conversion rules to obtain first conversion data; in the trusted execution environment, determining a first hash value of the first conversion data; in the trusted execution environment, determining a target hash value from mapping information stored in a secure memory of the trusted execution environment based on the first hash value, and determining a query result based on the target hash value; and outputting the query result. The technical solution of the embodiment of the present invention compresses and converts the result data of a large amount of data according to the data conversion rules, performs hash mapping and sorting on the basis of the data compression to form a data group for data query, thereby reducing the memory usage of the trusted execution environment by large-scale data, facilitating calculations, and enabling rapid positioning of data to be queried.

[0102] It should be understood that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present invention (including the claims) is limited to these examples; under the thinking of the present invention, the technical features in the above embodiments or different embodiments may also be combined, the steps may be implemented in any order, and there are many other variations of different aspects of one or more embodiments of the present invention as described above, which are not provided in detail for the sake of simplicity. The above specific embodiments of the present invention are merely used to illustrate or explain the principles of the present invention and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the scope of protection of the present invention. In addition, the claims appended to the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.

Claims

1. A data query method based on a trusted execution environment, characterized in that: include: Determine query data related to the trusted execution environment; In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data; In the trusted execution environment, determining a first hash value of the first converted data; In a trusted execution environment, a target hash value is determined from mapping information stored in a secure memory of the trusted execution environment based on a first hash value, and a query result is determined based on the target hash value, wherein the mapping information includes a hash array and an ordered collision array, the hash array includes sorted second hash values, the second hash values are obtained by performing hash mapping on second conversion data, the second conversion data are obtained by performing compression conversion on result data according to a data conversion rule, the ordered collision array is determined based on repeated hash values in the hash array, and the hash array is generated according to the following steps: Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array; The ordered conflict array is generated according to the following steps: Extract the repeated second hash values in the hash array and sort them to form an ordered conflict array; Output the query results.

2. The method according to claim 1, characterized in that The method further comprises: Performing compression conversion on the result data according to the data conversion rule to obtain second converted data; Add hash arrays and ordered collision arrays to the trusted execution environment's secure memory.

3. The method according to claim 2, characterized in that The result data includes result data of gene information, and the result data is compressed and converted according to the data conversion rule to obtain second converted data, including: According to data conversion rules, the chromosome information and the position information within the chromosome in the gene information are converted into first target information corresponding to the entire human body; According to the data conversion rules, the reference genome and mutant genome in the gene information are converted into the second target information; According to the data conversion rules, the gene name in the gene information is converted into the third target information; Second conversion data is determined according to the first target information, the second target information, and the third target information.

4. The method according to claim 1, wherein The query data related to the trusted execution environment is determined, including: Providing an interactive page, wherein the interactive page includes a data input control; Based on the triggering of the data input control, query data related to the trusted execution environment is obtained.

5. The method according to claim 1, wherein The step of determining, in the trusted execution environment, a target hash value from mapping information stored in a secure memory of the trusted execution environment according to the first hash value includes: Extracting relevant hash values from the sorted second hash values in the hash array according to the size of the first hash value, and performing a first match to determine a target hash value; When the first match fails, extracting relevant hash values from the sorted second hash values in the ordered collision array according to the size of the first hash value, and performing a second match to determine the target hash value; When the second match fails, the query failure is determined as the query result and fed back.

6. The method according to claim 1, characterized in that Determining the query result based on the target hash value includes: Determine target result data corresponding to the target hash value in the trusted execution environment; The query data is matched with the target result data in the trusted execution environment, and when the match is successful, the target result data is used as the query result.

7. A data query method based on a trusted execution environment, characterized in that: include: Performing compression conversion on the result data according to the data conversion rule to obtain second converted data; Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array; Extract the repeated second hash values in the hash array and sort them to form an ordered conflict array; Add hash arrays and ordered collision arrays to the secure memory of the trusted execution environment; Provides data query services based on hash arrays and ordered collision arrays in the secure memory of the trusted execution environment, including: In the trusted execution environment, determining a first hash value of the first converted data; In the trusted execution environment, relevant hash values are extracted from the sorted second hash values of the hash array according to the size of the first hash value, and a first match is performed to determine a target hash value.

8. The method according to claim 7, characterized in that The providing of data query services based on the hash array and ordered collision array in the secure memory of the trusted execution environment also includes: Providing an interactive page to obtain query data related to the trusted execution environment based on the interactive page; In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data; in the trusted execution environment, determine the target result data corresponding to the target hash value; In the trusted execution environment, the query data is matched with the target result data, and when the match is successful, the target result data is used as the query result; Output the query results to be displayed on the interactive page.

9. The method according to claim 8, characterized in that The method further comprises: When the first match fails, in the trusted execution environment, extracting relevant hash values from the sorted second hash values in the ordered collision array according to the size of the first hash value, and performing a second match to determine the target hash value; When the second match fails, it is determined that the query fails as a query result.

10. A data query device based on a trusted execution environment, characterized in that: include: A data conversion module, used to determine query data related to the trusted execution environment; In the trusted execution environment, compress and convert the query data according to the data conversion rule to obtain first converted data; A data query module, configured to determine a first hash value of the first converted data in a trusted execution environment; In a trusted execution environment, a target hash value is determined from mapping information stored in a secure memory of the trusted execution environment based on a first hash value, and a query result is determined based on the target hash value, wherein the mapping information includes a hash array and an ordered collision array, the hash array includes sorted second hash values, the second hash values are obtained by performing hash mapping on second conversion data, the second conversion data are obtained by performing compression conversion on result data according to a data conversion rule, the ordered collision array is determined based on repeated hash values in the hash array, and the hash array is generated according to the following steps: Determine a second hash value of the second converted data through hash mapping, map the second hash value to the secure memory of the trusted execution environment, and sort the data according to the second hash value to form a hash array; The ordered conflict array is generated according to the following steps: Extract the repeated second hash values in the hash array and sort them to form an ordered conflict array; The query result output module is used to output the query results.

11. An electronic device comprising a memory, a processor, and executable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the query method according to any one of claims 1 to 6 or claims 7 to 9 is implemented.

12. A computer-readable storage medium having computer-executable instructions stored thereon, characterized in that: When the executable instructions are executed by a processor, the query method according to any one of claims 1 to 6 or claims 7 to 9 is implemented.