Genetic sequence retrieval method and device, equipment and storage medium

Through the combination of encryption algorithm and coincidence degree algorithm, the balance between fast query and data security of genetic sequence retrieval is achieved, the problems of privacy leakage and low query efficiency in the existing technology are solved, and the computing and communication overhead are reduced.

CN118737277APending Publication Date: 2024-10-01XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410811086.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing online genetic sequence retrieval methods based on data summaries have the risk of privacy leakage, and downloading complete data summaries for local calculations will result in excessive communication volume and query time, making it difficult to find a balance between fast query and data security.

Method used

Using encryption algorithm and overlap algorithm, the bit query vector is compared with the server-side data summary to quickly determine the overlap between the sequence to be retrieved and the library summary data, and the target database is selected based on the overlap ratio, and only the database of interest is downloaded. Ensure data security and efficiency.

Benefits of technology

On the premise of ensuring data security, the server-side computing overhead and communication overhead are reduced, query efficiency and data security are improved, making large-scale genetic data processing have practical application value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118737277A_ABST
    Figure CN118737277A_ABST
Patent Text Reader

Abstract

The invention discloses a genetic sequence retrieval method and device, equipment and a storage medium, and the method comprises the steps: obtaining a plurality of to-be-selected databases, and determining the database infarction data of each database; acquiring encrypted data of the to-be-retrieved sequence from the user equipment, and determining the coincidence degree of the encrypted data and the library probability data according to a preset coincidence degree algorithm; the ratio of the coincidence number of each database to the total number of first Boolean values in the database probability data of the corresponding database serves as the coincidence ratio of the sequence to be retrieved and the corresponding database; and determining the database of which the overlap ratio is higher than a preset overlap ratio threshold in the plurality of databases as a target database, and sending the target database to the user equipment, so that the user equipment acquires the target database. According to the method, the contradiction between quick query of the genetic sequence database and guarantee of data security in related technologies is solved, the query efficiency and the data security are improved, and meanwhile, the storage and calculation overhead is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of genetic data, and specifically relates to a genetic sequence retrieval method, device, electronic device and computer-readable storage medium. Background Art

[0002] Whole genome sequencing is one of the key methods to solve biological problems. By combining sequencing results with bioinformatics theory, researchers can analyze the genome differences between different species and between different individuals of the same species. Researchers obtain the DNA sequence of a certain organism through genome sequencing, and then compare it with the data stored in these DNA servers to determine which archives it exists in.

[0003] At present, in order to reduce storage overhead and computational overhead, the mainstream solution is to create a data summary for each DNA archive. These data summaries store the hash values ​​of all genetic sequences in the corresponding database, thereby compressing the storage space of the DNA archive. When querying, the client generates a bit-based query vector based on the DNA sequence to be queried and sends it to the server. The server only needs to perform a small number of bitwise AND operations to complete a query and return the result to the client, thereby reducing the computational overhead on the server.

[0004] However, existing online data summary-based methods have the risk of privacy leakage. On the other hand, although downloading the data summary of the DNA archive to the local for calculation can avoid the risk of privacy leakage, for large-scale DNA data, downloading the complete data summary to the local will bring a lot of communication overhead and query time, so this method is not feasible in practical applications. Summary of the invention

[0005] The present application aims to provide a genetic sequence retrieval method, device, electronic device and computer-readable storage medium, which at least solves the problem of being unable to ensure data security while quickly querying a genetic sequence database during genetic sequence retrieval.

[0006] In a first aspect, an embodiment of the present application discloses a genetic sequence retrieval method, which is applied to a server and includes:

[0007] Acquire multiple databases to be selected, and respectively determine library summary data of each of the databases; the library summary data includes multiple data bits; the data bits of the library summary data are used to store Boolean values ​​to represent hash values ​​of all genetic sequences in the database;

[0008] Acquire the encrypted data of the sequence to be retrieved from the user device, and determine the degree of overlap between the encrypted data and the library summary data according to a preset overlap algorithm; the overlap algorithm has a corresponding encryption algorithm; the encrypted data is obtained by processing the sequence summary data of the sequence to be retrieved according to the encryption algorithm; the encrypted data, the sequence summary data, and the library summary data have the same number of data bits; the data bits of the sequence summary data are used to store Boolean values ​​to represent the hash value of the sequence to be retrieved; the overlap is used to represent the number of data bits with the same Boolean value between the encrypted data and the library summary data;

[0009] The ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the database summary data of the corresponding database is used as the overlap ratio between the sequence to be searched and the corresponding database; the overlap ratio is used to characterize the matching degree between the sequence to be searched and the corresponding database;

[0010] Among the multiple databases, a database whose overlap ratio is higher than a preset overlap threshold is determined as a target database, and the target database is sent to the user device, so that the user device obtains the target database.

[0011] In a second aspect, the present application also discloses a genetic sequence retrieval method, which is applied to a user device and includes:

[0012] Obtaining a sequence to be retrieved of a genetic sequence to be retrieved, and determining sequence skeleton data of the sequence to be retrieved; data bits of the sequence skeleton data are used to store Boolean values, thereby representing a hash value of the sequence to be retrieved;

[0013] The sequence outline data is encrypted according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved; the encrypted data and the sequence outline data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm;

[0014] The encrypted data is sent to a server so that the server obtains the encrypted data, and determines the overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines the database with the overlap ratio higher than the preset overlap threshold among the multiple databases as the target database, and sends the target database to the user device; the data bits of the library outline data are used to represent the hash value of all genetic sequences in the database by storing Boolean values; the overlap is used to represent the number of data bits with the same Boolean value between the encrypted data and the library outline data; the overlap ratio is used to represent the matching degree between the sequence to be retrieved and the corresponding database; the library outline data and the encrypted data have the same number of data bits;

[0015] The target database sent from the server is acquired.

[0016] In a third aspect, the present application also discloses a genetic sequence retrieval device, which is applied to a server and includes:

[0017] A library summary establishment module, used to obtain multiple databases to be selected, and respectively determine the library summary data of each of the databases; the library summary data includes multiple data bits; the data bits of the library summary data are used to store Boolean values ​​to represent the hash values ​​of all genetic sequences in the database;

[0018] A coincidence calculation module, used for obtaining the encrypted data of the sequence to be retrieved from the user device, and determining the coincidence between the encrypted data and the library summary data according to a preset coincidence algorithm; the coincidence algorithm has a corresponding encryption algorithm; the encrypted data is obtained by processing the sequence summary data of the sequence to be retrieved according to the encryption algorithm; the encrypted data, the sequence summary data, and the library summary data have the same number of data bits; the data bits of the sequence summary data are used to store Boolean values ​​to represent the hash value of the sequence to be retrieved; the coincidence is used to represent the number of data bits with the same Boolean value between the encrypted data and the library summary data;

[0019] An overlap ratio calculation module, used to take the ratio of the overlap number of each database to the total number of first Boolean values ​​in the database summary data of the corresponding database as the overlap ratio between the sequence to be searched and the corresponding database; the overlap ratio is used to characterize the matching degree between the sequence to be searched and the corresponding database;

[0020] The database sending module is used to determine a database whose overlap ratio is higher than a preset overlap threshold among the multiple databases as a target database, and send the target database to the user device so that the user device obtains the target database.

[0021] In a fourth aspect, the present application also discloses a genetic sequence retrieval device, which is applied to a user device and includes:

[0022] A sequence skeleton building module is used to obtain a sequence to be retrieved of a genetic sequence to be retrieved, and determine sequence skeleton data of the sequence to be retrieved; the data bits of the sequence skeleton data are used to store Boolean values ​​to represent the hash value of the sequence to be retrieved;

[0023] An encryption module, used for encrypting the sequence outline data according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved; the encrypted data and the sequence outline data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm;

[0024] A ciphertext sending module, used to send the encrypted data to a server so that the server obtains the encrypted data, and determines the overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines a database with a overlap ratio higher than a preset overlap threshold among multiple databases as a target database, and sends the target database to the user device; the data bits of the library outline data are used to store Boolean values ​​to represent the hash value of all genetic sequences in the database; the overlap is used to represent the number of data bits with the same Boolean value between the encrypted data and the library outline data; the overlap ratio is used to represent the matching degree between the sequence to be retrieved and the corresponding database; the library outline data and the encrypted data have the same number of data bits;

[0025] The database acquisition module is used to acquire the target database sent from the server.

[0026] In a fifth aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0027] In a sixth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0028] In summary, in the embodiment of the present application, through the coincidence algorithm matched with the encryption algorithm, it is possible to compare the query vector based on the bit position with the data outline of the server side under the premise of ensuring data security, so that only a small amount of bitwise and operation is required to quickly determine the coincidence of the sequence to be retrieved and the library outline data, which greatly reduces the calculation overhead of the server side; and then the coincidence ratio determined according to the coincidence reflects the matching degree of the sequence to be retrieved and the database to select the target database, so that only the database of interest needs to be downloaded, and the purpose of saving communication overhead and query time is achieved, so that the solution of downloading the database to the local is feasible in practical applications. Therefore, based on the method of the embodiment of the present application, when performing genetic sequence retrieval, there is no need to download all databases to the local, and there is no need to upload the genetic information that needs to be kept confidential, which solves the contradiction between fast query of genetic sequence database and ensuring data security in the related technology, improves query efficiency and data security, and reduces the storage and calculation overhead at the same time, so that the technology has practical application value in large-scale genetic data processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In the attached picture:

[0030] Figure 1 is a flow chart of the steps of a genetic sequence retrieval method provided in this embodiment;

[0031] Figure 2 A schematic diagram of the comparison process between the encrypted information and the library data outline provided in the application embodiment;

[0032] Figure 3 A flowchart of another genetic sequence retrieval method provided in an embodiment of the application;

[0033] Figure 4 It is a schematic diagram of the process of generating a library data outline under the genetic sequence retrieval method provided in the embodiment of the present application;

[0034] Figure 5 It is a schematic diagram of the process of generating a sequence data outline under the genetic sequence retrieval method provided in the embodiment of the present application;

[0035] Figure 6 It is a schematic diagram of a genetic sequence retrieval method in a multi-server mode provided in an embodiment of the present application;

[0036] Figure 7 It is a data flow process diagram of the genetic sequence retrieval method provided in the embodiment of the present application;

[0037] Figure 8 It is a schematic diagram of the generation process of the library data outline provided in the embodiment of the present application;

[0038] Fig. 9 It is a schematic diagram of the operation logic of the user equipment provided in the embodiment of the present application;

[0039] Fig.10 It is a block diagram of a genetic sequence retrieval device provided in an embodiment of the present application;

[0040] Fig.11 It is a block diagram of another genetic sequence retrieval device provided in an embodiment of the present application;

[0041] Fig.12 is a block diagram of an electronic device according to an embodiment of the present application;

[0042] Fig.13 It is a block diagram of an electronic device of another embodiment provided by the embodiments of the present application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0045] Figure 1 This is a genetic sequence retrieval method provided by this embodiment, wherein step 101, step 105, step 106, and step 107 are steps applied to the server; step 102, step 103, step 104, and step 108 are steps applied to the user device.

[0046] The method may include the following steps:

[0047] Step 101, obtain multiple databases to be selected, and determine the database outline data of each database respectively.

[0048] The library summary data includes a plurality of data bits; the data bits of the library summary data are used to store Boolean values, thereby representing the hash values ​​of all genetic sequences in the database.

[0049] In some embodiments of the present application, the server first needs to obtain multiple databases to be selected. These databases contain a large amount of genetic sequence data, and each database has a corresponding library summary data. The library summary data is a collection of data bits, each data bit stores a Boolean value, and these Boolean values ​​represent the hash values ​​of all genetic sequences in the database. Such a design allows the server to quickly retrieve and compare genetic sequences through the library summary data without accessing the specific genetic sequence data in the database, thereby improving retrieval efficiency and protecting data privacy.

[0050] For example, suppose there are three genetic sequence databases, named B1, B2, and B3. The server creates a library summary data for each database. For example, the library summary data of B1 may be a bit array of length 1000, where each bit represents the hash value of a genetic sequence in B1. If there is a genetic sequence in the database with a hash value of 10, the corresponding tenth bit in the library summary data will be set to 1. In this way, the server can quickly determine whether a given genetic sequence is likely to be in B1 without having to check each genetic sequence in B1 one by one. This method not only improves the query speed, but also reduces the risk of privacy leakage that may be caused by direct access to genetic sequence data.

[0051] Step 102, obtaining a sequence to be retrieved of a genetic sequence to be retrieved, and determining sequence skeleton data of the sequence to be retrieved.

[0052] The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved.

[0053] In some embodiments of the present application, the user device first needs to obtain the genetic sequence to be retrieved. This sequence is a specific DNA sequence that the user wants to find in the database. Once this sequence is obtained, the user device will calculate its sequence summary data. The sequence summary data is a data bit set consisting of Boolean values, which are converted by a hash function to characterize the characteristics of the original genetic sequence. This method allows the user device to compare with the library summary data on the server without revealing the specific genetic sequence, thereby protecting the privacy of the genetic sequence.

[0054] For example, suppose the genetic sequence that the user wants to retrieve is "AGCT". The user's device will use a predefined hash function to process the sequence and generate a sequence summary data, such as a Boolean value array "1010" of length 4. This array is the sequence summary data of "AGCT", which will be used to compare with the library summary data on the server after encryption to determine whether "AGCT" exists in the database without uploading the actual genetic sequence to the server.

[0055] Step 103: encrypt the sequence summary data according to a preset encryption algorithm to obtain encrypted data of the sequence to be retrieved.

[0056] The encrypted data and the sequence summary data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm.

[0057] In some embodiments of the present application, the user device will encrypt the sequence summary data using a preset encryption algorithm. The purpose of this step is to ensure the privacy of the sequence to be retrieved, while allowing the server to perform a coincidence algorithm on the encrypted data to determine the degree of match between the sequence to be retrieved and the genetic sequence in the database. The encrypted data will maintain the same number of data bits as the sequence summary data, ensuring that no information is lost during the encryption process and that it can be effectively compared with the library summary data on the server side.

[0058] For example, suppose the sequence summary data on the user's device is "1010", corresponding to the genetic sequence that the user wishes to retrieve. Using a preset encryption algorithm, this sequence summary data may be converted into encrypted data "1100". Although the encrypted data is different from the original sequence summary data, they have the same number of data bits and can be decrypted by the coincidence algorithm on the server to determine how well it matches the genetic sequence in the database. In this way, even if it is intercepted during data transmission, the encrypted data will not leak the user's genetic information.

[0059] Step 104, sending the encrypted data to the server so that the server obtains the encrypted data, and determines the degree of overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines a database among multiple databases whose overlap ratio is higher than a preset overlap threshold as a target database, and sends the target database to the user device.

[0060] The overlap degree is used to characterize the number of data bits with the same Boolean value between the encrypted data and the database summary data; the overlap ratio is used to characterize the matching degree between the sequence to be retrieved and the corresponding database.

[0061] In some embodiments of the present application, the user device sends the previously encrypted sequence summary data to the server. After receiving the encrypted data, the server uses a preset coincidence algorithm to determine the coincidence between the encrypted data and the library summary data of each database. The coincidence is determined by comparing the number of data bits with the same Boolean value in the encrypted data and the library summary data. Then, the server calculates the ratio of the number of coincidences in each database to the total number of first Boolean values ​​in the library summary data of the corresponding database, and this ratio is used to represent the coincidence ratio between the sequence to be retrieved and the corresponding database. If the coincidence ratio of a database is higher than the preset coincidence threshold, then this database will be determined as the target database. Finally, the server sends all the target databases back to the user device, and the user device can obtain these databases.

[0062] For example, suppose the encrypted sequence outline data of the user device is "1100", and the server has three library outline data, namely "1010", "1101" and "1001". The server uses the coincidence algorithm to compare the encrypted data with the library outline data, and finds that the number of coincidences in the first database is 2 (because "1100" and "1010" are consistent in the first and third digits), the number of coincidences in the second database is 3, and the number of coincidences in the third database is 2. If the set coincidence threshold is 0.5, then the second database (with a coincidence ratio of 0.75) will be determined as the target database and sent back to the user device. In this way, the user device can only download and focus on this database instead of all databases, thereby saving communication volume and query time.

[0063] Step 105: Obtain the encrypted data of the sequence to be retrieved from the user device, and determine the degree of coincidence between the encrypted data and the library outline data according to a preset coincidence algorithm.

[0064] The encrypted data, the sequence summary data, and the library summary data have the same number of data bits.

[0065] In some embodiments of the present application, the server will receive encrypted data of the sequence to be retrieved from the user device. These encrypted data are generated by the user device according to a preset encryption algorithm to protect the privacy of the sequence to be retrieved. The server will use a coincidence algorithm that matches the encryption algorithm to determine the coincidence between the encrypted data and the library summary data. The encrypted data, sequence summary data, and library summary data all have the same number of data bits, which is to ensure the integrity and consistency of the information during the encryption and comparison process.

[0066] For example, suppose the user device generates an encrypted sequence summary data "1100" and sends it to the server. The library summary data on the server may be "1010". The server will apply the coincidence algorithm to compare each bit of the encrypted data and the library summary data to determine the number of data bits with the same Boolean value between them. If the encrypted data and the library summary data match at multiple positions, this indicates that the sequence to be retrieved may have a corresponding genetic sequence in the database. The server will further process the query request based on these matching results.

[0067] Step 106, such as Figure 2 As shown, the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library summary data of the corresponding database is taken as the overlap ratio between the sequence to be retrieved and the corresponding database.

[0068] In some embodiments of the present application, the server will calculate the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library summary data of the corresponding database. This ratio is determined by comparing the number of identical Boolean values ​​in the encrypted data and the library summary data, and it represents the degree of match between the sequence to be retrieved and the genetic sequence in the database. This overlap ratio is a key indicator for determining whether the sequence to be retrieved exists in the database.

[0069] For example, if the total number of first Boolean values ​​in the database outline data of a database is 100, and the number of overlaps between the encrypted data of the sequence to be retrieved and the database outline data is 50, then the overlap ratio is 50 / 100=0.5. If the preset overlap threshold is 0.4, then this database will be considered to have a high match with the sequence to be retrieved and may be selected as the target database. This process ensures that only databases with a high match with the sequence to be retrieved will be further considered, thereby improving the efficiency and accuracy of the search.

[0070] Step 107, such as Figure 2 As shown, among multiple databases, a database whose overlap ratio is higher than a preset overlap threshold is determined as a target database, and the target database is sent to a user device so that the user device acquires the target database.

[0071] In some embodiments of the present application, the server will determine the target database based on the previously calculated coincidence ratio. This step is performed after confirming the degree of match between the sequence to be retrieved and the genetic sequence in the database. If the coincidence ratio of a database is higher than a preset threshold, this means that the sequence to be retrieved has a higher degree of match with the genetic sequence in the database, so the database will be selected as the target database. Then, the server will send the information of these target databases to the user device, and the user device can obtain these databases for further analysis or operation.

[0072] For example, suppose the server has three databases, and their overlap ratios are S1=0.7 and S2=0.5, respectively, and the preset overlap threshold is 0.6. Then, the overlap ratio of the first database (with an overlap ratio of 0.7) is higher than the threshold, so it will be identified as the target database. The server will then send the information of these two databases to the user device. After receiving this information, the user device can only focus on these two databases instead of all databases, which can save resources and improve efficiency. This process not only speeds up retrieval, but also reduces unnecessary data transmission and protects user privacy.

[0073] Step 108, obtaining the target database sent from the server.

[0074] In some embodiments of the present application, the task of the user device is to receive the target database information sent by the server. This step is performed after the server has determined the target database according to the coincidence ratio. The target database information obtained by the user device through this process can be used for further genetic sequence analysis or other related operations. In this way, the user can only focus on the database with a high degree of match with the sequence to be retrieved, which improves the efficiency and accuracy of the retrieval and also protects the privacy of the user.

[0075] For example, suppose the user device previously sent an encrypted sequence summary data to the server, and the server processed it and identified two target databases. The server sends the information of these two databases to the user device. After receiving this information, the user device can directly use these received databases to find and analyze the genetic sequence of interest without downloading the entire database collection, thus saving time and resources. This process ensures that users can quickly and securely obtain the information they need.

[0076] In summary, in the embodiment of the present application, through the coincidence algorithm matched with the encryption algorithm, it is possible to compare the query vector based on the bit position with the data outline of the server side under the premise of ensuring data security, so that only a small amount of bitwise and operation is required to quickly determine the coincidence of the sequence to be retrieved and the library outline data, which greatly reduces the calculation overhead of the server side; and then the coincidence ratio determined according to the coincidence reflects the matching degree of the sequence to be retrieved and the database to select the target database, so that only the database of interest needs to be downloaded, and the purpose of saving communication overhead and query time is achieved, so that the solution of downloading the database to the local is feasible in practical applications. Therefore, based on the method of the embodiment of the present application, when performing genetic sequence retrieval, there is no need to download all databases to the local, and there is no need to upload the genetic information that needs to be kept confidential, which solves the contradiction between fast query of genetic sequence database and ensuring data security in the related technology, improves query efficiency and data security, and reduces the storage and calculation overhead at the same time, so that the technology has practical application value in large-scale genetic data processing.

[0077] Figure 3 This is a genetic sequence retrieval method provided by this embodiment, wherein step 201, step 205, step 206, and step 207 are steps applied to the server; step 202, step 203, step 204, and step 208 are steps applied to the user device.

[0078] The method may include the following steps:

[0079] Step 201, obtain multiple databases to be selected, and determine the database outline data of each database respectively.

[0080] The library summary data includes a plurality of data bits; the data bits of the library summary data are used to store Boolean values, thereby representing the hash values ​​of all genetic sequences in the database.

[0081] The method shown in this step has been explained in step 101 and will not be repeated here.

[0082] Optionally, in order to determine the database summary data of the database, step 201 includes the following sub-steps:

[0083] Sub-step 2011, such as Figure 3 As shown, all genetic sequences stored in the database are truncated according to a preset fragment length to obtain all sequence fragments in the database, and duplicate sequence fragments are deleted.

[0084] In some embodiments of the present application, it is necessary to extract genetic sequences from a database and segment them into sequence segments of a preset length. This step is to simplify subsequent processing because sequence segments of a fixed length are easier to hash and store. In addition, by deleting repeated sequence segments, data redundancy can be reduced and the use of storage space can be optimized.

[0085] For example, suppose there is a database B1 containing genetic sequences, one of which is "AGCTACTAGG...". If the preset fragment length is 4, this sequence can be divided into fragments such as "AGCT" and "GCTA". Then, check whether these fragments are repeated. If so, only one copy is retained. In this way, a collection of unique sequence fragments is obtained, which is ready for the next step of hashing. If "CTAC" appears twice in this example, it is judged as a repeated fragment, and only one "CTAC" will be retained, and the other "CTAC" will be deleted in subsequent steps.

[0086] Sub-step 2012, such as Figure 4 As shown, after deleting repeated sequence segments according to the preset hash function, each remaining sequence segment is used to obtain a segment hash value of each sequence segment.

[0087] In some embodiments of the present application, a preset hash function is used to process each remaining sequence segment after deleting duplicate sequence segments to obtain a segment hash value of each sequence segment. The hash function maps these sequence segments to a hash value of a fixed length so that each segment can be represented by a unique identifier.

[0088] For example, suppose there are the following two sequence fragments: "ATAG" and "AGAG", then a hash function can be used to map them to hash values. Assume that the hash function is a simple hash function that maps each base to a number. For example: "A": 1, "C": 2, "G": 3, "T": 4; then for the sequence fragment "ATAG", assume that its hash value can be calculated as: 2. For the sequence fragment "AGAG", assume that its hash value is calculated as: 6. Then, the two sequence fragments will be mapped to hash values ​​2 and 6 respectively. Each hash value can be used as their unique identifier for subsequent processing and storage.

[0089] Note that real-world hash functions are often more complex, but this simple example illustrates the basic idea of ​​this substep.

[0090] Sub-step 2013, such as Figure 4 As shown, all fragment hash values ​​are stored in the same hash sequence to obtain library summary data.

[0091] In some embodiments of the present application, the hash values ​​of all fragments are stored in the same hash sequence to obtain the library summary data. This hash sequence will be used as the summary information of the database for fast retrieval and comparison.

[0092] For example, assuming that there are the following three sequence fragments with hash values: "ATAG": 2, "AGAG": 6, then these hash values ​​can be stored in a hash sequence to obtain a hash sequence {2,6}, which contains the hash values ​​of all genetic sequences in the database, through which the library summary data can be obtained, and the library summary data D1 can be recorded as [0,1,0,0,0,0,1,0,…]. In subsequent genetic sequence retrieval, this library summary data can be used to quickly determine which sequence fragments in the database match the sequence to be retrieved.

[0093] Step 202, obtaining a sequence to be retrieved of a genetic sequence to be retrieved, and determining sequence skeleton data of the sequence to be retrieved.

[0094] The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved.

[0095] The method shown in this step has been explained in step 102 and will not be repeated here.

[0096] Optionally, in order to determine the sequence summary data of the sequence to be retrieved, step 202 includes the following sub-steps:

[0097] Step 2021, as Figure 5 As shown, the sequence to be retrieved is truncated according to a preset segment length to obtain all sequence segments of the sequence to be retrieved, and repeated sequence segments are deleted.

[0098] In some embodiments of the present application, it is necessary to process the DNA sequence to be retrieved and divide it into sequence fragments of a preset length. This step is crucial for the subsequent generation of sequence summary data because it ensures that each sequence fragment has a uniform length, thereby facilitating hash processing. At the same time, deleting duplicate sequence fragments can reduce unnecessary data duplication and improve storage and processing efficiency.

[0099] For example, suppose there is a DNA sequence to be retrieved called "AGCTACTAGG...". If the preset fragment length is 4, the sequence can be segmented into fragments such as "AGCT" and "GCTA". Then, check whether these fragments are repeated. If so, only one copy is retained. In this way, a set of unique sequence fragments is obtained, which is ready for the next step of hash processing. If "CTAC" appears twice in this example, it is judged as a repeated fragment, and only one "CTAC" will be retained, and the other "CTAC" will be deleted in subsequent steps.

[0100] Step 2022, as Figure 5 As shown, after deleting repeated sequence segments according to the preset hash function, each remaining sequence segment is used to obtain a segment hash value of each sequence segment.

[0101] In some embodiments of the present application, a preset hash function is used to process each remaining sequence segment after deleting duplicate sequence segments to obtain a segment hash value of each sequence segment. The hash function maps these sequence segments to a hash value of a fixed length so that each segment can be represented by a unique identifier.

[0102] For example, assuming there are the following two sequence fragments: "AGCT" and "GCTA", a hash function can be used to map them to hash values. Assume that the hash function is a simple hash function that maps each base to a number. For example: "A": 1, "C": 2, "G": 3, "T": 4; then for the sequence fragment "AGCT", its hash value can be calculated as: 1+3+2+4=10. For the sequence fragment "GCAA", its hash value can be calculated as: 3+2+1+1=7. Therefore, the two sequence fragments will be mapped to hash values ​​10 and 7 respectively. Each hash value can be used as their unique identifier for subsequent processing and storage.

[0103] Step 2023, as Figure 5 As shown, all fragment hash values ​​are stored in the same hash sequence to obtain sequence summary data.

[0104] In some embodiments of the present application, the hash values ​​of all fragments are stored in the same hash sequence to obtain sequence summary data. This hash sequence will be used as summary information of the sequence to be retrieved for fast retrieval and comparison.

[0105] For example, suppose the sequence X to be detected has two sequence fragments with hash values: "ATAG": 2, "AGAG": 6, then these hash values ​​can be stored in a hash sequence to obtain a hash sequence {2,6}, which contains the hash values ​​of all genetic sequences in the sequence to be retrieved, through which the sequence skeleton data can be obtained, and the sequence skeleton data can be recorded as C [0,1,0,0,0,1,0,…]. In the subsequent genetic sequence search, this sequence skeleton data can be used to quickly determine which sequence fragments in the database match the sequence to be retrieved.

[0106] Step 203: encrypt the sequence summary data according to a preset encryption algorithm to obtain encrypted data of the sequence to be retrieved.

[0107] The encrypted data and the sequence summary data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm.

[0108] The method shown in this step has been explained in step 103 and will not be repeated here.

[0109] Optionally, when multiple library summary data are stored in a single server, step 203 includes the following sub-steps:

[0110] Sub-step 2031, encrypting the sequence outline data according to homomorphic encryption to obtain encrypted data of the sequence to be retrieved.

[0111] In some embodiments of the present application, when multiple library summary data are stored in a single server, homomorphic encryption technology is used to encrypt the sequence summary data. Homomorphic encryption is a special encryption method that allows certain types of calculations to be performed directly on encrypted data without decryption. This means that the server can perform operations on encrypted data without knowing the content of the original data, thereby protecting the privacy of the data.

[0112] For example, suppose there is a sequence summary data s = {1010, 1101, 1001}, which represents the hash value of the sequence to be retrieved. Then you can choose a homomorphic encryption algorithm, such as the Paillier encryption algorithm, to encrypt the sequence summary data. After encryption, you can get the encrypted data C = {E(1010), E(1101), E(1001)}, where E(x) represents the encryption result of x. This encrypted data can be securely sent to the server for subsequent processing, and the server cannot know what the original sequence summary data is, ensuring the privacy of the data. On the server side, you can directly compare and calculate on these encrypted data without decryption, thus achieving the purpose of both protecting privacy and performing effective retrieval.

[0113] Optionally, when the plurality of library summary data are stored in at least two servers and there is no data interaction between any two servers, step 203 includes the following sub-steps:

[0114] Sub-step 2032, such as Figure 6 As shown, one of the multiple servers is randomly selected as the first server, and the remaining servers are used as second servers, and the second library summary data of each second server is obtained.

[0115] In some embodiments of the present application, it is necessary to select a server in a distributed server environment to process the library summary data. This step ensures that in a multi-server architecture, there can be one server as the main encrypted data processing point, while other servers process the encrypted data related to it. This setting helps to distribute the computing load and enhance the security of data processing.

[0116] For example, suppose there are three servers: server A, B, and C. In this embodiment, a server (assuming A) needs to be randomly selected as the first server. Server A will be responsible for processing the first encrypted data. Then, server B and server C are used as second servers, and they will process the second encrypted data related to the first server. In this way, data can be processed separately on different servers while ensuring that there is no direct data interaction between them, thereby protecting the security and privacy of the data. In actual operation, this can be achieved by using a random number generator to randomly select a server and assigning tasks to the selected server through a secure communication protocol.

[0117] Sub-step 2033, determining the first encrypted data corresponding to the first server based on the sequence outline data and a randomly generated initial prime number.

[0118] In some embodiments of the present application, it is necessary to determine the first encrypted data corresponding to the first server based on the sequence outline data and the randomly generated initial prime number. This step involves a homomorphic encryption algorithm, in which an initial prime number can be used to encrypt the sequence outline data.

[0119] For example, assuming the following sequence outline data: {1010, 1101, 1001}, an initial prime number p can be randomly generated (for example, prime number p=17 can be selected), and then each sequence outline data can be encrypted using a homomorphic encryption algorithm (such as the Paillier encryption algorithm). Assume that the encrypted result is: {E(1010), E(1101), E(1001)}, where E(x) represents the encryption result of x. These encrypted data will be associated with the first server for subsequent processing and comparison. It should be noted that the homomorphic encryption algorithm in actual applications may be more complex, and this example is only used to illustrate the basic idea of ​​this sub-step.

[0120] Sub-step 2034, such as Figure 6 As shown, the second encrypted data Z2 corresponding to the corresponding second server is determined based on the first encrypted data Z1 and the corresponding second library summary data.

[0121] In some embodiments of the present application, the second encrypted data related to the second server needs to be determined based on the first encrypted data and the corresponding second library summary data. This step is to ensure that in a distributed server environment, data processing between different servers is independent of each other, thereby enhancing data privacy and security.

[0122] For example, suppose there is the following data: first encrypted data Z1: {E(1010), E(1101), E(1001)}, second library summary data: {1110, 1101, 1011}; then a homomorphic encryption algorithm, such as the Paillier encryption algorithm, can be used to compare the first encrypted data with the second library summary data. The specific steps are as follows: For each encrypted data E(x), the original sequence summary data x is obtained by decryption. Compare the decrypted sequence summary data with the second library summary data to find the matching part. For example, the decrypted data is {1010, 1101, 1001}, then the part that matches the second library summary data {1110, 1101, 1011} is {1101}. Then use the homomorphic encryption algorithm to re-encrypt the matching part to obtain the second encrypted data Z2 related to the second server. For example, the encrypted second encrypted data is {E(1101)}. This ensures that the data processing between the first server and the second server is independent of each other, while protecting the privacy of the data.

[0123] Step 204, sending the encrypted data to the server so that the server obtains the encrypted data, and determines the degree of overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines a database among multiple databases whose overlap ratio is higher than a preset overlap threshold as a target database, and sends the target database to the user device.

[0124] The overlap degree is used to characterize the number of data bits with the same Boolean value between the encrypted data and the database summary data; the overlap ratio is used to characterize the matching degree between the sequence to be retrieved and the corresponding database.

[0125] The method shown in this step has been explained in step 104 and will not be repeated here.

[0126] Step 205: Obtain the encrypted data of the sequence to be retrieved from the user device, and determine the degree of coincidence between the encrypted data and the library outline data according to a preset coincidence algorithm.

[0127] The encrypted data, the sequence summary data, and the library summary data have the same number of data bits.

[0128] The method shown in this step has been explained in step 105 and will not be repeated here.

[0129] Optionally, corresponding to the process of sub-step 2031, when multiple library summary data are stored in a single server, the overlap between the encrypted data and the library summary data is determined according to a preset overlap algorithm, specifically including the following sub-steps:

[0130] Step 2051, calculate the first intermediate variable O[i] according to the following formula:

[0131]

[0132] Among them, c represents encrypted data, B represents library summary data, and m represents the length of the library summary data.

[0133] In some embodiments of the present application, it is necessary to calculate a first intermediate variable O[i] between the encrypted data and the library summary data. This variable is calculated by summing the values ​​of the encrypted data corresponding to each 1 bit in the library summary data. This step is to determine the degree of overlap between the sequence to be retrieved and the sequence fragment in the database, which is a key step because it directly affects the subsequent matching degree calculation.

[0134] For example, suppose there are the following encrypted data and library summary data: encrypted data C: {2,5,3,7}, library summary data B: {1,0,1,1}, and the length m of the library summary data is 4. Then, according to the formula, only the values ​​of the encrypted data corresponding to the bits that are 1 in the library summary data are summed. Therefore, it can be calculated that: O[i] = c[1] + c[3] + c[4] = 2 + 3 + 7 = 12. This result is the first intermediate variable O[i], which will be used for subsequent coincidence calculations. This example is only used to show how to calculate the first intermediate variable based on encrypted data and library summary data. In actual applications, this process may involve more complex data and calculations, but the basic principles are the same.

[0135] Step 2052, calculate the overlap degree according to the following formula:

[0136]

[0137] Among them, s x ∩s d represents the degree of overlap, b drepresents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

[0138] In some embodiments of the present application, it is necessary to calculate the overlap between the sequence to be retrieved and the sequence fragments in the database. This overlap is calculated by a formula, which reflects the number of common elements between the two sequence fragment sets. This calculation process is crucial for determining whether the sequence to be retrieved exists in a specific archive in the database.

[0139] For example, suppose the sequence to be retrieved is s x and sequence fragments of the database d , then we need to calculate their overlap. At this time, we need the following data: Assume that the number of sequence fragments in the database is b d is 100, the number of sequence fragments to be retrieved is b x is 80, the number of first Boolean values ​​in the library summary data a d is 60, the number of the first Boolean value in the sequence to be retrieved a x is 50, and the intermediate variable O[d] is 120, then the overlap degree s can be calculated according to the formula x ∩s d is 184. This means that the sequence to be retrieved s x and sequence fragments in the database d There are 184 common sequence fragments in the database. This example is only used to show how to calculate the coincidence based on the given data. In actual applications, this process may involve more complex data and calculations, but the basic principle is the same. This calculation method can quickly determine whether the sequence to be retrieved exists in a specific archive in the database, thereby improving retrieval efficiency and data security.

[0140] Optionally, corresponding to the process from sub-step 2032 to sub-step 2034, when multiple library outline data are stored in at least two servers, it is necessary to consider dividing the server into a first server and the remaining servers into second servers, and make the first server have corresponding first encrypted data, each second server has corresponding second encrypted data, and the first encrypted data has a corresponding initial prime number, and ensure that there is no data interaction between any two servers, and determine the overlap between the encrypted data and the library outline data according to a preset overlap algorithm, which specifically includes the following sub-steps:

[0141] Sub-step 2053, calculate the second intermediate variable O of each server according to the following formula: k[i], the calculation formula is:

[0142]

[0143] When k = 1, v k represents the first encrypted data, when k=2, v k represents the second encrypted data, B represents the library summary data, N represents the number of servers, and m represents the length of the library summary data.

[0144] In some embodiments of the present application, it is necessary to calculate the second intermediate variable O of each server in a distributed server environment. k [i]. This variable is calculated by summing the values ​​of the encrypted data corresponding to each 1 bit in the repository summary data. This step is to ensure that each server can independently calculate the data related to it in a multi-server architecture, thereby maintaining data privacy and security between different servers.

[0145] For example, suppose there are two servers (the first server and the second server) and the following data: the first encrypted data v1: {2,5,3,7}, the second encrypted data v2: {4,1,6,2}, the library summary data B: {1,0,1,1}, the length m of the library summary data is 4, and the number of servers N is 2. Then, the first server and the second server can be calculated separately according to the formula:

[0146] For the first server: O1[i]=v1[1]+v1[3]+v1[4]=2+3+7=12,

[0147] For the second server: O2[i]=v2[1]+v2[3]+v2[4]=4+6+2=12,

[0148] In this way, the second intermediate variable O of each server is obtained. k [i] is 12. This example is only used to show how to calculate the second intermediate variable in a distributed server environment. In actual applications, this process may involve more complex data and calculations, but the basic principle is the same.

[0149] Sub-step 2054, calculating the first intermediate variable O[i] according to the second intermediate variable, the calculation formula is:

[0150] O[i]=(O1[i]+O2[i])modp;

[0151] Wherein, p represents the initial prime number.

[0152] In some embodiments of the present application, the first intermediate variable O[i] needs to be calculated based on the second intermediate variable. This calculation is to ensure that data processing between different servers is independent of each other in a distributed server environment, while protecting the privacy of the data.

[0153] For example, assuming that there are two servers, with the following data: O1[i] = 12, O2[i] = 10, and assuming that the initial prime number p is 17, then the formula can be used to calculate

[0154] O[i]=(12+10)mod 17=22mod 17=5.

[0155] This result will be used for subsequent coincidence calculations. In actual applications, more complex data and calculations will be used. This example is only used to show how to calculate the first intermediate variable based on the given data. This calculation method helps ensure that data processing between different servers is independent of each other in a distributed server environment, while protecting the privacy of the data.

[0156] Sub-step 2055, calculate the overlap degree according to the following formula:

[0157]

[0158] Among them, |s x ∩s d | represents the degree of overlap, b d represents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

[0159] The method shown in this step has been explained in step 2052 and will not be repeated here.

[0160] Step 206: The ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the database summary data of the corresponding database is used as the overlap ratio between the sequence to be searched and the corresponding database.

[0161] The method shown in this step has been described in step 106 and will not be repeated here.

[0162] Step 207 : Determine, among the multiple databases, a database whose overlap ratio is higher than a preset overlap threshold as a target database, and send the target database to the user device so that the user device acquires the target database.

[0163] The method shown in this step has been described in step 107 and will not be repeated here.

[0164] Step 208, obtaining the target database sent from the server.

[0165] The method shown in this step has been explained in step 108 and will not be repeated here.

[0166] In summary, in the embodiment of the present application, through the coincidence algorithm matched with the encryption algorithm, it is possible to compare the query vector based on the bit position with the data outline of the server side under the premise of ensuring data security, so that only a small amount of bitwise and operation is required to quickly determine the coincidence of the sequence to be retrieved and the library outline data, which greatly reduces the calculation overhead of the server side; and then the coincidence ratio determined according to the coincidence reflects the matching degree of the sequence to be retrieved and the database to select the target database, so that only the database of interest needs to be downloaded, and the purpose of saving communication overhead and query time is achieved, so that the solution of downloading the database to the local is feasible in practical applications. Therefore, based on the method of the embodiment of the present application, when performing genetic sequence retrieval, there is no need to download all databases to the local, and there is no need to upload the genetic information that needs to be kept confidential, which solves the contradiction between fast query of genetic sequence database and ensuring data security in the related technology, improves query efficiency and data security, and reduces the storage and calculation overhead at the same time, so that the technology has practical application value in large-scale genetic data processing.

[0167] refer to Figure 7 , is a server device architecture under a genetic sequence retrieval method provided by the present application, and a data flow process under the corresponding architecture: Figure 7 As shown, the device architecture can be designed as a preprocessing subsystem, a skeleton building subsystem, and a database query subsystem. Under this architecture, the specific data flow process is as follows:

[0168] Step M1: The genetic sequence database is processed by the preprocessing subsystem to obtain a data set of library sequence fragments of each database;

[0169] Step M2: the summary establishment subsystem establishes a library data summary based on the data set of library sequence fragments;

[0170] Step M3: The database query subsystem obtains the library data outline and the encrypted data comparison of the sequence to be queried to finally obtain the target database.

[0171] Specifically, refer to Figure 8 In step M1, the data is converted in the following steps:

[0172] Step M11: splitting the sequences in the genetic sequence database into sequence fragments;

[0173] Step M12: Map the sequence fragment to the library data summary through the hash value.

[0174] refer to Fig. 9 , is the program execution logic of the user device under a genetic sequence retrieval method provided in the present application, and is specifically executed according to the following steps:

[0175] Step S1: Generate a sequence data outline according to the sequence to be detected;

[0176] Step S2: confirm the number of servers on the server side and execute steps S3 and S4 when the server side is a single server, and execute steps S5 and S6 when the server side is multiple servers;

[0177] Step S3: homomorphically encrypt the sequence data summary;

[0178] Step S4: Send the encrypted data after homomorphic encryption;

[0179] Step S5: performing shared encryption processing on the sequence data summary;

[0180] Step S6: Send the encrypted data after sharing encryption;

[0181] Step S7: confirm the target database according to the information on the server side;

[0182] Step S8: Receive the target database sent from the server.

[0183] refer to Fig.10 , which shows a genetic sequence retrieval device 30 provided in an embodiment of the present application, applied to a server, comprising:

[0184] The library summary establishment module 301 is used to obtain multiple databases to be selected and determine the library summary data of each database respectively; the library summary data includes multiple data bits; the data bits of the library summary data are used to store Boolean values ​​to represent the hash values ​​of all genetic sequences in the database;

[0185] The coincidence calculation module 302 is used to obtain the encrypted data of the sequence to be retrieved from the user device, and determine the coincidence between the encrypted data and the library summary data according to a preset coincidence algorithm; the coincidence algorithm has a corresponding encryption algorithm; the encrypted data is obtained by processing the sequence summary data of the sequence to be retrieved according to the encryption algorithm; the encrypted data, the sequence summary data, and the library summary data have the same number of data bits; the data bits of the sequence summary data are used to store Boolean values ​​to represent the hash value of the sequence to be retrieved; the coincidence is used to represent the number of data bits with the same Boolean value between the encrypted data and the library summary data;

[0186] The overlap ratio calculation module 303 is used to use the ratio of the overlap number of each database to the total number of first Boolean values ​​in the database summary data of the corresponding database as the overlap ratio between the sequence to be searched and the corresponding database; the overlap ratio is used to represent the matching degree between the sequence to be searched and the corresponding database;

[0187] The database sending module 304 is used to determine a database with a coincidence ratio higher than a preset coincidence threshold among multiple databases as a target database, and send the target database to the user device so that the user device obtains the target database.

[0188] Optionally, the library outline building module 301 includes:

[0189] The library truncation submodule is used to truncate all genetic sequences stored in the database according to a preset fragment length to obtain all sequence fragments in the database and delete duplicate sequence fragments;

[0190] The library sorting submodule is used to process and delete the duplicate sequence fragments according to a preset hash function, and then obtain the fragment hash value of each sequence fragment;

[0191] The library summary submodule is used to store all fragment hash values ​​into the same hash sequence to obtain library summary data.

[0192] Optionally, multiple library summary data are stored in a single server, and the overlap calculation module 302 includes:

[0193] The first intermediate variable submodule is used to calculate the first intermediate variable O[i] according to the following formula:

[0194]

[0195] Wherein, c represents the encrypted data, B represents the library summary data, and m represents the length of the library summary data;

[0196] The first overlap submodule is used to calculate the overlap according to the following formula:

[0197]

[0198] Among them, s x ∩s d represents the degree of overlap, b d represents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

[0199] Optionally, the plurality of library summary data are stored in at least two servers, the servers include a first server and the remaining second servers, the first server has corresponding first encrypted data, each second server has corresponding second encrypted data, the first encrypted data has a corresponding initial prime number, and there is no data interaction between any two servers, and the coincidence calculation module 302 includes:

[0200] The second intermediate variable submodule is used to calculate the second intermediate variable of each server according to the following formula: k [i], the calculation formula is:

[0201]

[0202] When k = 1, v k represents the first encrypted data, when k=2, v k represents the second encrypted data, B represents the database summary data, N represents the number of servers, and m represents the length of the database summary data;

[0203] The third intermediate variable submodule is used to calculate the first intermediate variable O[i] according to the second intermediate variable, and the calculation formula is:

[0204] O[i]=(O1[i]+O2[i])modp;

[0205] Where p represents the initial prime number;

[0206] The second coincidence degree submodule is used to calculate the coincidence degree according to the following formula:

[0207]

[0208] Among them, |s x ∩s d | represents the degree of overlap, b d represents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

[0209] refer to Fig.11 , which shows a genetic sequence retrieval device 40 provided in an embodiment of the present application, applied to a user device, including:

[0210] The sequence skeleton building module 401 is used to obtain a sequence to be retrieved of a genetic sequence to be retrieved, and determine sequence skeleton data of the sequence to be retrieved; the data bits of the sequence skeleton data are used to store Boolean values ​​to represent the hash value of the sequence to be retrieved;

[0211] The encryption module 402 is used to encrypt the sequence summary data according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved; the encrypted data and the sequence summary data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm;

[0212] The ciphertext sending module 403 is used to send the encrypted data to the server so that the server obtains the encrypted data, and determines the overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the overlap number of each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines the database with the overlap ratio higher than the preset overlap threshold among multiple databases as the target database, and sends the target database to the user device; the data bits of the library outline data are used to store Boolean values ​​to represent the hash value of all genetic sequences in the database; the overlap is used to represent the number of data bits with the same Boolean value between the encrypted data and the library outline data; the overlap ratio is used to represent the matching degree between the sequence to be retrieved and the corresponding database; the library outline data and the encrypted data have the same number of data bits;

[0213] The database acquisition module 404 is used to acquire the target database sent from the server.

[0214] Optionally, the sequence outline building module 401 includes:

[0215] The sequence truncation submodule is used to truncate the sequence to be retrieved according to a preset fragment length to obtain all sequence fragments of the sequence to be retrieved and delete repeated sequence fragments;

[0216] A sequence arrangement submodule, used for processing each remaining sequence fragment according to a preset hash function to obtain a fragment hash value of each sequence fragment;

[0217] The sequence summary submodule is used to store all fragment hash values ​​into the same hash sequence to obtain sequence summary data.

[0218] Optionally, in the case where multiple library summary data are stored in a single server, the encryption module 402 includes:

[0219] The homomorphic encryption submodule is used to encrypt the sequence outline data according to homomorphic encryption to obtain the encrypted data of the sequence to be retrieved.

[0220] Optionally, when multiple library summary data are stored in at least two servers and there is no data interaction between any two servers, the encryption module 402 includes:

[0221] A server division submodule, used to randomly select one of the multiple servers as a first server, and the remaining servers as second servers, and obtain the second library summary data of each second server;

[0222] A first encryption submodule, used to determine first encrypted data corresponding to the first server according to the sequence outline data and a randomly generated initial prime number;

[0223] The second encryption submodule is used to determine the second encrypted data corresponding to the corresponding second server according to the first encrypted data and the corresponding second library summary data.

[0224] In summary, in the embodiment of the present application, through the coincidence algorithm matched with the encryption algorithm, it is possible to compare the query vector based on the bit position with the data outline of the server side under the premise of ensuring data security, so that only a small amount of bitwise and operation is required to quickly determine the coincidence of the sequence to be retrieved and the library outline data, which greatly reduces the calculation overhead of the server side; and then the coincidence ratio determined according to the coincidence reflects the matching degree of the sequence to be retrieved and the database to select the target database, so that only the database of interest needs to be downloaded, and the purpose of saving communication overhead and query time is achieved, so that the solution of downloading the database to the local is feasible in practical applications. Therefore, based on the method of the embodiment of the present application, when performing genetic sequence retrieval, there is no need to download all databases to the local, and there is no need to upload the genetic information that needs to be kept confidential, which solves the contradiction between fast query of genetic sequence database and ensuring data security in the related technology, improves query efficiency and data security, and reduces the storage and calculation overhead at the same time, so that the technology has practical application value in large-scale genetic data processing.

[0225] Reference Fig.12 , the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0226] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0227] The memory 504 is used to store various types of data to support the operation of the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, multimedia, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0228] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0229] The multimedia component 508 includes an interface that provides an output interface between the electronic device 500 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0230] The audio component 510 is used to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0231] The input / output I / O interface 512 provides an interface between the processing component 502 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0232] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0233] The communication component 516 is used to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0234] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to implement a display control method provided in an embodiment of the present application.

[0235] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0236] Fig.13600 is a block diagram of an electronic device 600 according to another embodiment of the present invention. For example, the electronic device 600 may be provided as a server. Fig.13 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632, for storing instructions that can be executed by the processing component 622, such as an application. The application stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform a display control method provided in an embodiment of the present application.

[0237] The electronic device 600 may also include a power supply component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input / output (I / O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0238] It should be noted that the genetic information involved in this application is all genetic information that has been fully authorized by all parties, and the collection, use and processing of relevant genetic information must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0239] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0240] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A genetic sequence retrieval method, applied to a server, characterized in that: include: Acquire multiple databases to be selected, and respectively determine the database outline data of each of the databases; The library summary data includes a plurality of data bits; The data bits of the library summary data are used to represent the hash values ​​of all genetic sequences in the database by storing Boolean values; Acquire the encrypted data of the sequence to be retrieved from the user device, and determine the degree of coincidence between the encrypted data and the library summary data according to a preset coincidence algorithm; the coincidence algorithm has a corresponding encryption algorithm; the encrypted data is obtained by processing the sequence summary data of the sequence to be retrieved according to the encryption algorithm; the encrypted data, the sequence summary data, and the library summary data have the same number of data bits; The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved; The overlap degree is used to represent the number of data bits with the same Boolean value between the encrypted data and the library summary data; The ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the database summary data of the corresponding database is used as the overlap ratio between the sequence to be searched and the corresponding database; the overlap ratio is used to characterize the matching degree between the sequence to be searched and the corresponding database; Among the multiple databases, a database whose overlap ratio is higher than a preset overlap threshold is determined as a target database, and the target database is sent to the user device, so that the user device obtains the target database.

2. The method according to claim 1, characterized in that A plurality of the library summary data are stored in a single server, and the determining the degree of overlap between the encrypted data and the library summary data according to a preset overlap algorithm includes: The first intermediate variable O[i] is calculated according to the following formula: Wherein, c represents the encrypted data, B represents the library summary data, and m represents the length of the library summary data; The overlap is calculated according to the following formula: Among them, |s x ∩s d | represents the degree of overlap, b d represents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

3. The method according to claim 1, characterized in that A plurality of the library summary data are stored in at least two servers, the servers include a first server and the remaining second servers, the first server has corresponding first encrypted data, each of the second servers has corresponding second encrypted data, the first encrypted data has a corresponding initial prime number, and there is no data interaction between any two of the servers, and the determining the degree of overlap between the encrypted data and the library summary data according to a preset overlap algorithm includes: The second intermediate variable O of each server is calculated according to the following formula k [i], the calculation formula is: When k = 1, v k represents the first encrypted data, when k=2, v k represents the second encrypted data, B represents the database summary data, N represents the number of servers, and m represents the length of the database summary data; The first intermediate variable O[i] is calculated according to the second intermediate variable, and the calculation formula is: O[i]=(O1[i]+O2[i])modp; Where p represents the initial prime number; The overlap is calculated according to the following formula: Among them, |s x ∩s d | represents the degree of overlap, b d represents the number of sequence fragments in the database, b x Indicates the number of sequence fragments to be retrieved, a d Indicates the number of first Boolean values ​​in the library summary data, a x Represents the number of the first Boolean value in the sequence to be retrieved.

4. A genetic sequence retrieval method, applied to a user device, characterized in that: include: Obtaining a sequence to be retrieved of a genetic sequence to be retrieved, and determining sequence summary data of the sequence to be retrieved; The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved; The sequence outline data is encrypted according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved; the encrypted data and the sequence outline data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm; The encrypted data is sent to a server so that the server obtains the encrypted data, and determines the overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps in each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines a database among the multiple databases whose overlap ratio is higher than a preset overlap threshold as a target database, and sends the target database to the user device; the data bits of the library outline data are used to store Boolean values ​​to represent the hash values ​​of all genetic sequences in the database; The overlap degree is used to characterize the number of data bits with the same Boolean value between the encrypted data and the library summary data; the overlap ratio is used to characterize the matching degree between the sequence to be retrieved and the corresponding database; the library summary data and the encrypted data have the same number of data bits; The target database sent from the server is acquired.

5. The method according to claim 4, characterized in that In the case where a plurality of library summary data are stored in a single server, encrypting the sequence summary data according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved includes: The sequence summary data is encrypted according to homomorphic encryption to obtain encrypted data of the sequence to be retrieved.

6. The method according to claim 4, characterized in that In the case where a plurality of library summary data are stored in at least two servers and there is no data interaction between any two of the servers, encrypting the sequence summary data according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved includes: Randomly select one of the multiple servers as the first server, and the remaining servers as the second servers, and obtain the second library summary data of each of the second servers; Determining first encrypted data corresponding to the first server according to the sequence outline data and a randomly generated initial prime number; The second encrypted data corresponding to the corresponding second server is determined according to the first encrypted data and the corresponding second library summary data.

7. A genetic sequence retrieval device, applied to a server, characterized in that: include: A library outline building module, used to obtain a plurality of databases to be selected, and respectively determine the library outline data of each of the databases; The library summary data includes a plurality of data bits; The data bits of the library summary data are used to represent the hash values ​​of all genetic sequences in the database by storing Boolean values; A coincidence calculation module, used for obtaining the encrypted data of the sequence to be retrieved from the user device, and determining the coincidence between the encrypted data and the library summary data according to a preset coincidence algorithm; the coincidence algorithm has a corresponding encryption algorithm; the encrypted data is obtained by processing the sequence summary data of the sequence to be retrieved according to the encryption algorithm; the encrypted data, the sequence summary data, and the library summary data have the same number of data bits; The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved; The overlap degree is used to represent the number of data bits with the same Boolean value between the encrypted data and the library summary data; An overlap ratio calculation module, used to take the ratio of the overlap number of each database to the total number of first Boolean values ​​in the database summary data of the corresponding database as the overlap ratio between the sequence to be searched and the corresponding database; the overlap ratio is used to characterize the matching degree between the sequence to be searched and the corresponding database; The database sending module is used to determine a database whose overlap ratio is higher than a preset overlap threshold among the multiple databases as a target database, and send the target database to the user device so that the user device obtains the target database.

8. A genetic sequence retrieval device, applied to a user device, characterized in that: include: A sequence skeleton building module is used to obtain a sequence to be retrieved of a genetic sequence to be retrieved, and determine sequence skeleton data of the sequence to be retrieved; The data bits of the sequence summary data are used to store Boolean values, thereby representing the hash value of the sequence to be retrieved; An encryption module, used for encrypting the sequence outline data according to a preset encryption algorithm to obtain the encrypted data of the sequence to be retrieved; the encrypted data and the sequence outline data have the same number of data bits; the encryption algorithm has a corresponding coincidence algorithm; A ciphertext sending module, used to send the encrypted data to a server so that the server obtains the encrypted data, and determines the overlap between the encrypted data and the library outline data of each database according to the overlap algorithm, and uses the ratio of the number of overlaps of each database to the total number of first Boolean values ​​in the library outline data of the corresponding database as the overlap ratio between the sequence to be retrieved and the corresponding database, and determines a database among the multiple databases whose overlap ratio is higher than a preset overlap threshold as a target database, and sends the target database to the user device; the data bits of the library outline data are used to store Boolean values ​​to represent the hash values ​​of all genetic sequences in the database; The overlap degree is used to characterize the number of data bits with the same Boolean value between the encrypted data and the library summary data; the overlap ratio is used to characterize the matching degree between the sequence to be retrieved and the corresponding database; the library summary data and the encrypted data have the same number of data bits; The database acquisition module is used to acquire the target database sent from the server.

9. An electronic device, characterized in that: include: A processor, a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 6.