Query method, device and system for similar patient diagnosis records based on block edit distance
The gene sequences are preprocessed and indexed using the block edit distance algorithm to generate a block negative database, which solves the problem of high computational and storage costs in querying patients with similar genetic data and achieves efficient privacy protection and fast query.
Patent Information
- Application Number
- CN202211344267.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Existing technologies have problems with high computational cost and communication overhead in querying similar patients with genetic data. Especially when processing large-scale genetic sequence data, traditional edit distance calculation and negative database generation methods are inefficient.
The block edit distance algorithm is used to segment the gene sequence into non-repeating blocks through preprocessing and establish indexes to generate a block negative database. The server side calculates the block edit distance to estimate the similarity, reducing the computational complexity and optimizing the storage cost.
It significantly reduces the negative database generation time overhead and server storage costs, improves query response speed and efficiency, and achieves efficient privacy protection and similar patient queries.
Smart Images

Figure CN115602278B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of privacy protection and security technology, and in particular to a query method, device and system for similar patient diagnostic records based on block edit distance. Background Art
[0002] With the continuous advancement of biotechnology, the cost of gene sequencing is becoming increasingly affordable. Individuals can easily extract important fragments of genomic data through sequencing services provided by biotech companies. However, this process generates a large amount of genomic data that is collected and stored by third-party institutions. Simultaneously, the research and application of genomic data are becoming increasingly widespread. This research contributes to improving the quality of human healthcare, promoting the reuse and secondary analysis of genomic data, and plays a key role in biomedical research and development. Similar patient queries based on genomic data have become a new research hotspot in Western countries in recent years. Similar patient queries involve doctors using health exchange systems to search for electronic medical records of other patients with similar genomic sequences to their own patients, using these records to provide better diagnoses for their patients. Genomic data contains a wealth of personal and private information, the disclosure of which can have serious consequences for users' future lives. Therefore, effective privacy protection is crucial when performing similar patient queries on genomic data to prevent the leakage of sensitive patient information within genomic databases.
[0003] Negative databases are a novel privacy protection method and one of the main models for negative information representation. While conventional databases store the original data itself, negative databases store the complement of the original data, thereby protecting the security of the original data. Inverting a negative database and recovering the original data has been proven to be an NP-hard problem, and algorithms for generating negative databases have been extensively studied. Due to their rigorous formal proofs and strong privacy protection, negative databases have been applied in numerous scenarios. However, to date, genetic data privacy protection based on negative databases has not been effectively promoted and applied.
[0004] When querying similar patients using genetic data, the metric used to compare gene sequences for similarity is typically the edit distance. Existing research directly converts gene sequences into a negative database, then uploads the converted negative database information to a server, and finally estimates the edit distance between two gene sequences on the server. This approach, however, incurs unacceptable time overhead in converting the negative database and calculating the edit distance on the negative database, as well as server-side storage costs, for large datasets or long gene sequences. Summary of the Invention
[0005] The present invention provides a method, device and system for querying similar patient diagnostic records based on block edit distance, which are used to solve or at least partially solve the technical problems of high computational cost and communication overhead in the methods of the prior art.
[0006] In order to solve the above technical problems, the first aspect of the present invention provides a query method for similar patient diagnosis records based on block edit distance, comprising:
[0007] Receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed by the data provider's preprocessing method to obtain the corresponding block, index, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence returned.
[0008] The block edit distance between the preprocessed query sequence and the gene sequence pre-stored on the server is calculated, and based on the calculated block edit distance and control parameters, the identifiers of the k gene sequences most similar to the preprocessed query sequence are obtained and sent to the data provider, and the corresponding diagnostic record is returned to the user, wherein the block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the preprocessing method of the data provider and uploaded to the server. The preprocessing method of the data provider specifically includes: segmenting all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and establishing a corresponding index for each segmented block, then splicing all blocks to obtain the preprocessed gene sequence and encoding it into binary form; then using the K-hidden algorithm to generate a negative database for the encoded gene sequence, and segmenting it to obtain block negative database information corresponding to each index, and then uploading the block negative database information corresponding to the index and the corresponding index to the server for storage.
[0009] In one embodiment, the data provider's preprocessing method segments all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and creates a corresponding index for each segmented block, including:
[0010] Select any gene sequence from the dataset D as the reference sequence r;
[0011] According to the gene sequence i The editing matrix between the reference sequence (used to record the state of the dynamic transfer equation when calculating the editing distance between two sequences, recorded as PTR) and the preset segmentation parameters are used to treat the gene sequence s i Perform segmentation to obtain a series of non-repeated blocks, create an index for each block, and add it to the segmentation set.
[0012] In one embodiment, the data provider's preprocessing method includes concatenating all blocks to obtain a preprocessed gene sequence and encoding it into a binary form, including:
[0013] The blocks corresponding to each gene sequence in the segmentation set are spliced together to obtain a gene sequence representing the entire data set as the preprocessed gene sequence;
[0014] The bases of the preprocessed gene sequence are replaced by binary characters and encoded into a binary string.
[0015] In one embodiment, the data provider's preprocessing method uses a K-hidden algorithm to generate a negative database for the encoded gene sequence and performs segmentation to obtain block negative database information corresponding to each index, including:
[0016] The K-hidden algorithm is used to generate a negative database NDB of genetic sequences encoded in binary form. bs ;
[0017] The negative database is segmented according to the length information of the original block corresponding to the index in the segmentation set to obtain the block negative database information corresponding to each index, where the block negative database information represents the negative database information corresponding to a block.
[0018] In one embodiment, the block edit distance between the pre-processed query sequence and the gene sequence pre-stored on the server is calculated by the following formula:
[0019]
[0020] Where N represents the total number of blocks obtained by segmenting the query sequence q using the data provider's preprocessing method, NDB q [block l ]and Represent the query sequence q and gene sequence s respectively i NDB_ED is a function for estimating the edit distance between two gene sequences on the negative database. It is the edit distance estimation function on the negative database, used to estimate the query sequence q and gene sequence s i The edit distance between .
[0021] In one embodiment, based on the calculated block edit distance and control parameters, the identifiers of the k gene sequences most similar to the pre-processed query sequence are obtained and sent to the data provider, and the corresponding diagnostic records are returned to the user, including:
[0022] The calculated block edit distances are sorted in ascending order, and the identifiers of the first k gene sequences are selected and sent to the data provider. The data provider obtains the corresponding gene sequence and diagnosis record based on the gene sequence identifier and returns them to the server.
[0023] The obtained diagnostic record is returned to the user.
[0024] Based on the same inventive concept, a second aspect of the present invention provides a query device for similar patient diagnosis records based on block edit distance, wherein the device is a server, comprising:
[0025] A query request receiving module is used to receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed using the same preprocessing method as the data provider to obtain the corresponding block, index, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence that are returned;
[0026] The query module is used to calculate the block edit distance between the preprocessed query sequence and the gene sequence pre-stored on the server, and obtain the identifiers of the k gene sequences most similar to the preprocessed query sequence based on the calculated block edit distance and control parameters, and send them to the data provider, and return the corresponding diagnostic record to the user. The block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the preprocessing method of the data provider and uploaded to the server. The preprocessing method of the data provider specifically includes: dividing all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and establishing a corresponding index for each segmented block, then splicing all blocks to obtain the preprocessed gene sequence and encoding it into binary form; then using the K-hidden algorithm to generate a negative database for the encoded gene sequence, and segmenting it to obtain block negative database information corresponding to each index, and then uploading the block negative database information corresponding to the index and the corresponding index to the server for storage.
[0027] Based on the same inventive concept, the third aspect of the present invention provides a query system for similar patient diagnostic records based on block edit distance, including the similar patient query device based on block edit distance described in the second aspect, a client and a data provider, wherein the client is used to send a query request to the server, and the data provider is used to pre-process the gene sequences in the data set using a preprocessing method to obtain corresponding blocks, indexes and block negative database information, and send them to the server for storage.
[0028] Based on the same inventive concept, the fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the method described in the first aspect when the program is executed.
[0029] Based on the same inventive concept, the fourth and fifth aspects of the present invention provide a computer device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0030] Compared with the prior art, the advantages and beneficial technical effects of the present invention are as follows:
[0031] The present invention proposes a query method for similar patient diagnostic records based on block-based edit distance. The data provider pre-processes the gene sequences in the dataset using a preprocessing method to obtain corresponding blocks, indexes, and block negative database information, which are then sent to a server for storage. A special "gene sequence" (the pre-processed gene sequence) can be used to represent the entire gene dataset. Because this "gene sequence" already contains all the information for every gene sequence in the dataset, a negative database can be generated only for this sequence, significantly reducing the time overhead of generating the negative database and the server-side storage cost. The server (server) uses the block-based edit distance based on the negative database to estimate the edit distance between the query sequence and the gene sequence, further reducing the time complexity of calculating the distance between the two gene sequences from O(m*n) to O(m+n) (where m and n represent the lengths of the two gene sequences, respectively), significantly improving the response speed of user queries. Therefore, the similar patient query solution based on the negative database proposed in the present invention has good performance in both query efficiency and storage cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 1 is a schematic diagram of the overall process of a method for querying similar patient diagnosis records based on block edit distance provided by an embodiment of the present invention;
[0034] Figure 2 This is a flow chart of the implementation of the gene sequence preprocessing method provided by an embodiment of the present invention;
[0035] Figure 3 This is a flowchart of the technical solution implementation in the query phase provided by an embodiment of the present invention;
[0036] Figure 4 A schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present invention;
[0037] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention belongs to the field of privacy protection and security, and specifically relates to a block edit distance algorithm based on a negative database, which is used to efficiently solve the privacy protection problem of similar patient queries in genetic data application scenarios.
[0039] Specifically, the solution consists of two phases: preprocessing and querying. During the preprocessing phase (offline, completed in advance), the data provider must first segment all gene sequences in the dataset into a series of non-repeating blocks based on the parameter bk. Each block is assigned an index idx, converting the gene sequence representation from bases to a series of indices. All blocks are then concatenated to form a "gene sequence" representing the entire dataset. This is encoded in binary form, and a negative database for this sequence is generated using the K-hidden algorithm. This database, along with the index information, is uploaded to the server. During the query phase (online), the user submits a preprocessed gene sequence to the server to query the diagnostic records for the k most similar gene sequences. The server calculates the block-wise edit distance between the query sequence and each gene sequence in the dataset (represented by a series of indices), sorts them in ascending order, and then requests the diagnostic records corresponding to the top k gene sequences from the data provider. The results are returned to the user.
[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0041] Example 1
[0042] An embodiment of the present invention provides a method for querying similar patient diagnosis records based on block edit distance, comprising:
[0043] Receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed using the same preprocessing method as the data provider to obtain corresponding blocks, indexes, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence that are returned;
[0044] The block edit distance between the preprocessed query sequence and the gene sequence pre-stored on the server is calculated, and based on the calculated block edit distance and control parameters, the identifiers of the k gene sequences most similar to the preprocessed query sequence are obtained and sent to the data provider, and the corresponding diagnostic record is returned to the user, wherein the block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the preprocessing method of the data provider and uploaded to the server. The preprocessing method of the data provider specifically includes: segmenting all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and establishing a corresponding index for each segmented block, then splicing all blocks to obtain the preprocessed gene sequence and encoding it into binary form; then using the K-hidden algorithm to generate a negative database for the encoded gene sequence, and segmenting it to obtain block negative database information corresponding to each index, and then uploading the block negative database information corresponding to the index and the corresponding index to the server for storage.
[0045] Through extensive research and practice, the inventors of this application have discovered that current methods for protecting genetic data privacy have drawbacks in similar patient query scenarios, primarily including the enormous computational and communication overhead associated with encryption methods, and the inability to efficiently and quickly respond to user queries. Specifically, they are as follows:
[0046] 1. Encryption is used to provide privacy protection, but this method only applies to final processed genetic sequence data. In the presence of an untrusted third party, the plaintext obtained after decryption will result in insufficient data protection. Furthermore, encryption and decryption of genetic data are time-consuming and expensive. Furthermore, due to computational and communication overhead bottlenecks in secure multi-party computing and cryptography, long genetic sequences cannot be retrieved in real time. This significantly increases query time and reduces the user experience in similar patient query systems.
[0047] 2. When estimating the edit distance, the edit distance algorithm based on the negative database requires a bit-by-bit comparison of one gene sequence with another to obtain the final edit distance. This has a time complexity of O(n×m), where n and m are the lengths of the two gene sequences. When the gene sequences are long, estimating the edit distance between the query string and each gene sequence in the database results in a significant query time overhead. Furthermore, this method requires converting each gene sequence into a separate negative database, which is ultimately uploaded to a third-party trusted server for similar patient queries. This entire process incurs significant computational and communication overhead.
[0048] See Figure 1 , is a schematic diagram of the overall process of a query method for similar patient diagnosis records based on block edit distance disclosed in an embodiment of the present invention.
[0049] Specifically, in the above method provided by the present invention, the execution subject is the server, and the other two parties involved in the method include the data provider and the user (client). The data provider uses a preprocessing method to process the gene sequence in the data set, divides it into non-repeating blocks, builds an index for each block, and then splices and encodes the divided blocks to regenerate negative database information. The user is mainly used to send a query request to the server. The server calculates the edit distance between the query sequence and the gene sequence of the stored data set according to the query request sent by the user, and returns the gene sequence of the corresponding entry based on the calculation result and control parameters.
[0050] The implementation method of the preprocessing method (stage) includes the steps of segmenting the gene sequences in the data set, splicing the segmented sets, encoding the data, generating a negative database, segmenting the negative database and uploading the information to the server.
[0051] During the query phase, the user uploads the preprocessed query sequence q and parameter k (a parameter that controls the number of gene sequences most similar to q) to the server to obtain the diagnostic records of the k gene sequences most similar to the query sequence.
[0052] In one embodiment, the data provider's preprocessing method segments all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and creates a corresponding index for each segmented block, including:
[0053] Select any gene sequence from the dataset D as the reference sequence r;
[0054] According to the gene sequence i The editing matrix and preset segmentation parameters between the reference sequence and the gene sequence to be processed i Perform segmentation to obtain a series of non-repeated blocks, create an index for each block, and add it to the segmentation set.
[0055] In the specific implementation process, the dynamic programming algorithm can be used to calculate the gene sequence s i (s i ∈D) and the edit distance between the reference sequence r, a two-dimensional matrix (denoted as PTR matrix) needs to be opened to save the state of the dynamic transfer process, where the element PTR[raw][col] in the raw row and col column of the matrix represents the gene sequence s i The edit distance between the first raw elements of the reference sequence r and the first col elements of the reference sequence r, so the lower right corner of the matrix is the gene sequence s i The final edit distance between the reference sequence r and the gene sequence s can be obtained by continuously moving the pointer from the lower right corner to the upper left corner of the PTR matrix. i and r (which records the minimum editing path between s i How is the state of dynamic programming transferred during the conversion to r, that is, whether the current state PTR[i][j] is transferred by replacing PTR[i-1][j-1], deleting PTR[i][j-1], or inserting PTR[i-1][j]? In the backtracking process, the pointer moves bk rows (a parameter used to control the size of the segmentation block. Experiments show that when bk, that is, the block size, is about 5, it has a good segmentation effect) to the gene sequence s. i Perform a split. When a split block first appears, create an index idx for it and add it to the split set MapD. At the same time, convert the representation of this gene sequence into a series of indices. Use this method to split the remaining gene sequences in the dataset, and create indexes for all non-repeating blocks generated by the split and add them to the split set MapD.
[0056] It should be noted that moving one row corresponds to one base (A, T, G, C) in the gene sequence s, and each bk row movement is equivalent to scanning bk bases in the gene sequence s. bk is a parameter used to control the block size of the segmented gene sequence s. Because gene sequences only contain four bases, A, T, G, and C, a large bk value reduces the probability of forming duplicate blocks, increases the length of the spliced string, and increases the time overhead of generating the negative database. Extensive experimental results show that a bk value of around 5 works best.
[0057] In one embodiment, the data provider's preprocessing method includes concatenating all blocks to obtain a preprocessed gene sequence and encoding it into a binary form, including:
[0058] The blocks corresponding to each gene sequence in the segmentation set are spliced together to obtain a gene sequence representing the entire data set as the preprocessed gene sequence;
[0059] The bases of the preprocessed gene sequence are replaced by binary characters and encoded into a binary string.
[0060] Through the preprocessing method of the data provider, all blocks are spliced together to obtain a "sequence" that can represent the entire gene sequence data set. The bases of the sequence are replaced by binary characters and encoded as a binary string bs.
[0061] In a specific implementation, the bases 'A', 'T', 'G', and 'C' are replaced by '00', '01', '10', and '11', respectively, to form a binary string bs.
[0062] See Figure 2 , is a flow chart for implementing the gene sequence preprocessing method disclosed in an embodiment of the present invention.
[0063] In one embodiment, the data provider's preprocessing method uses a K-hidden algorithm to generate a negative database for the encoded gene sequence and performs segmentation to obtain block negative database information corresponding to each index, including:
[0064] The K-hidden algorithm is used to generate a negative database NDB of genetic sequences encoded in binary form. bs ;
[0065] The negative database is segmented according to the length information of the original block corresponding to the index in the segmentation set to obtain the block negative database information corresponding to each index, where the block negative database information represents the negative database information corresponding to a block.
[0066] In the specific implementation process, the K-hidden algorithm is used to generate the negative database NDB of the binary string bs. bs This can be achieved in the following way. The algorithm parameter K (the exact number of bits in the generated negative database) is set to 4, and the parameter R (which controls the size of the negative database) and the probability parameter Q are changed to 5, 10, 15, 20, and 25 respectively. The probability parameter Q refers to Table 1, where the parameters p1, p2, p3 and (1-p3-p2-p3) represent the probabilities of generating different types of negative database records, respectively. The parameter p diff represents the probability that the negative database is different from the original string at the current position, |p diff -0.5| represents the parameter p i For the utility of generating negative database, i.e. |p diff -0.5|The larger the value, the stronger the effectiveness of the negative database). See Table 1 for details.
[0067] Table 1 K - Hidden algorithm parameter settings
[0068]
[0069] Negative database NDB generated according to the above parameters bs , the original block length information (number of bases) corresponding to the index in the segmentation set is obtained, and the negative database is segmented to obtain the block negative database information corresponding to each index. Finally, the block negative data information corresponding to the index and the index set (used to represent each gene sequence) are uploaded to the server. The parameter controlling the segmentation block size should not be too large (since gene sequences only contain four nucleotides, a large value will result in poor final alignment results). A value of around 5 is generally reasonable.
[0070] In one embodiment, the block edit distance between the pre-processed query sequence and the gene sequence pre-stored on the server is calculated by the following formula:
[0071]
[0072] Where N represents the total number of blocks obtained by segmenting the query sequence q using the data provider's preprocessing method, NDB q [block l ]and Represent the query sequence q and gene sequence s respectively i NDB_ED is a function for estimating the edit distance between two gene sequences on the negative database. It is the edit distance estimation function on the negative database, by estimating the query sequence q and gene sequence s i The edit distance between two gene sequences is represented by the sum of the edit distances between the corresponding blocks.
[0073] See Figure 3 , is a flowchart of the technical solution implementation of the query stage provided by an embodiment of the present invention.
[0074] In the specific implementation process, the user sends a pre-processed query gene sequence q to the server, and the server estimates the query sequence q and the gene sequence s. i The edit distance between blocks (i.e., block edit distance) is used to approximate the query string q and the gene sequence s i The edit distance between .
[0075] In one embodiment, based on the calculated block edit distance and control parameters, the identifiers of the k gene sequences most similar to the pre-processed query sequence are obtained and sent to the data provider, and the corresponding diagnostic records are returned to the user, including:
[0076] The calculated block edit distances are sorted in ascending order, and the identifiers of the first k gene sequences are selected and sent to the data provider. The data provider obtains the corresponding gene sequence and diagnosis record based on the gene sequence identifier and returns them to the server.
[0077] The obtained diagnostic record is returned to the user.
[0078] This solution uses the iDASH-2016 dataset for performance evaluation. The dataset contains 501 gene sequences, 500 gene sequences, and 1 query gene sequence, where each gene sequence contains approximately 3,500 bases. To verify the effectiveness of the privacy-preserving similar patient query solution proposed in this paper, the following formula is used as the accuracy calculation method:
[0079]
[0080] where N TP 、N FN They represent the number of correct identifications and the number of false negatives, respectively. For example, if a user requests the return of 10 diagnostic records with the most similar gene sequences, and 8 are correctly identified, the accuracy is 80%. In actual experiments, multiple repeated experiments are performed and the average accuracy is used as the final result.
[0081] The performance evaluation also includes an assessment of time overhead, which can be divided into two parts: the offline preprocessing phase and the online query phase. The preprocessing phase's time overhead is primarily due to segmenting the gene sequences in the dataset, encoding the data, generating the negative database, and uploading relevant information to the server. The online query phase's time overhead primarily involves the user preprocessing the query sequence, uploading the query information and parameters to the server, the server calculating the block edit distance between the query sequence and the gene sequence, and returning the diagnostic records for the k gene sequences most similar to the query sequence.
[0082] In summary, this paper proposes a block-wise edit distance algorithm based on a negative database and constructs an effective solution for efficiently solving the privacy protection problem of similar patient queries in genetic data. This paper has the following advantages:
[0083] 1. After preprocessing the dataset, a special "gene sequence" can be used to represent the entire gene dataset. Since this "gene sequence" already contains all the information of each gene sequence in the dataset, a negative database can be generated only for this sequence, greatly reducing the time overhead of generating the negative database and the storage cost on the server side;
[0084] 2. The server uses a block-wise edit distance based on a negative database to estimate the edit distance between the query sequence and the gene sequence, further reducing the time complexity of calculating the edit distance between two gene sequences from O(m*n) to O(m+n) (where m and n represent the lengths of the two gene sequences, respectively), greatly improving the response speed of user queries.
[0085] 3. The similar patient query solution based on the negative database proposed in the present invention has good performance in terms of query accuracy and time overhead.
[0086] Example 2
[0087] Based on the same inventive concept, this embodiment provides a query device for similar patient diagnosis records based on block edit distance. The device is a server, comprising:
[0088] A query request receiving module is used to receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed using the same preprocessing method as the data provider to obtain the corresponding block, index, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence that are returned;
[0089] The query module is used to calculate the block edit distance between the preprocessed query sequence and the gene sequence pre-stored on the server, and obtain the identifiers of the k gene sequences most similar to the preprocessed query sequence based on the calculated block edit distance and control parameters, and send them to the data provider, and return the corresponding diagnostic record to the user. The block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the preprocessing method of the data provider and uploaded to the server. The preprocessing method of the data provider specifically includes: dividing all gene sequences in the data set into a series of non-repeating blocks according to preset segmentation parameters, and establishing a corresponding index for each segmented block, then splicing all blocks to obtain the preprocessed gene sequence and encoding it into binary form; then using the K-hidden algorithm to generate a negative database for the encoded gene sequence, and segmenting it to obtain block negative database information corresponding to each index, and then uploading the block negative database information corresponding to the index and the corresponding index to the server for storage.
[0090] Since the apparatus described in Example 2 of the present invention is used to implement the block edit distance-based query of similar patient diagnostic records in Example 1 of the present invention, the specific structure and variations of the apparatus are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. All apparatuses used in the method of Example 1 of the present invention are within the scope of protection of the present invention.
[0091] Example 3
[0092] Based on the same inventive concept, this embodiment provides a query system for similar patient diagnostic records based on block edit distance, including the similar patient query device based on block edit distance described in Example 2, a client, and a data provider, wherein the client is used to send a query request to the server, and the data provider is used to pre-process the gene sequences in the data set using a preprocessing method to obtain corresponding blocks, indexes, and block negative database information, and send them to the server for storage.
[0093] Since the system described in Example 3 of the present invention includes the block-edit-distance-based similar patient query device described in Example 2 of the present invention, those skilled in the art will be able to understand the specific structure and variations of this system based on the device described in Example 2 of the present invention, and therefore will not be described in detail here. Any system that includes the device described in Example 2 of the present invention falls within the scope of protection of the present invention.
[0094] Example 4
[0095] Based on the same inventive concept, see Figure 4 The present invention further provides a computer-readable storage medium 300 on which a computer program 311 is stored. When the program is executed, the method described in the first embodiment is implemented.
[0096] Since the computer-readable storage medium described in Example 4 of the present invention is used to implement the method for querying similar patient diagnostic records based on block edit distance in Example 1 of the present invention, the specific structure and variations of the computer-readable storage medium are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. All computer-readable storage media used in the method of Example 1 of the present invention fall within the scope of protection of the present invention.
[0097] Example 5
[0098] Based on the same inventive concept, the present application also provides a computer device, such as Figure 5 As shown, it includes a memory 401, a processor 402 and a computer program 403 stored in the memory and executable on the processor. When the processor executes the above program, the method in the first embodiment is implemented.
[0099] Since the computer device described in Example 5 of the present invention is used to implement the method for querying similar patient diagnostic records based on block edit distance in Example 1 of the present invention, the specific structure and variations of the computer device are readily apparent to those skilled in the art based on the method described in Example 1 of the present invention, and thus will not be further described here. All computer devices used in the method described in Example 1 of the present invention fall within the scope of protection of the present invention.
[0100] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0103] Obviously, those skilled in the art may make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if such changes and modifications of the embodiments of the present invention fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A query method for similar patient diagnosis records based on block edit distance, characterized in that: include: Receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed using the same preprocessing method as the data provider to obtain corresponding blocks, indexes, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence that are returned; Calculate the block edit distance between the pre-processed query sequence and the gene sequence pre-stored on the server, and obtain the identifiers of the k gene sequences most similar to the pre-processed query sequence based on the calculated block edit distance and control parameters, and send them to the data provider, and return the corresponding diagnosis record to the user, wherein the block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the pre-processing method of the data provider and uploaded to the server. The pre-processing method of the data provider specifically includes: dividing all gene sequences in the data set according to the preset segmentation parameters. The data is divided into a series of non-repeating blocks, and a corresponding index is established for each block obtained by the segmentation. Then all the blocks are spliced to obtain the pre-processed gene sequence and encoded into binary form. Then, the K-Hidden algorithm is used to generate a negative database for the encoded gene sequence and segment it to obtain the block negative database information corresponding to each index. The block negative database information corresponding to the index and the corresponding index are uploaded to the server for storage. Among them, in the pre-processing method of the data provider, all gene sequences in the data set are segmented into a series of non-repeating blocks according to the preset segmentation parameters, and a corresponding index is established for each segmented block, including: From the dataset D Select any gene sequence as the reference sequence r ; According to gene sequence The editing matrix and preset segmentation parameters between the reference sequence and the gene sequence to be processed Perform segmentation to obtain a series of non-repeated blocks, create an index for each block, and add it to the segmentation set.
2. The query method for similar patient diagnosis records based on block edit distance according to claim 1, characterized in that: In the data provider's preprocessing method, all blocks are concatenated to obtain the preprocessed gene sequence and encoded into binary form, including: The blocks corresponding to each gene sequence in the segmentation set are spliced together to obtain a gene sequence representing the entire data set as the preprocessed gene sequence; The bases of the preprocessed gene sequence are replaced by binary characters and encoded into a binary string.
3. The query method for similar patient diagnosis records based on block edit distance according to claim 1, characterized in that: In the data provider's preprocessing method, the K-hidden algorithm is used to generate a negative database for the encoded gene sequence and segment it to obtain the block negative database information corresponding to each index, including: The K-hidden algorithm is used to generate a negative database of genetic sequences encoded in binary form. ; The negative database is segmented according to the length information of the original block corresponding to the index in the segmentation set to obtain the block negative database information corresponding to each index, where the block negative database information represents the negative database information corresponding to a block.
4. The query method for similar patient diagnosis records based on block edit distance according to claim 1, characterized in that: The block edit distance between the pre-processed query sequence and the gene sequence pre-stored on the server is calculated using the following formula: in, N Represents a query sequence q The total number of blocks obtained by the preprocessing method of the data provider, Represents the query sequence q and gene sequences No. l Negative database information of the block, is a function used to estimate the edit distance between two gene sequences on the negative database, is the edit distance estimation function on the negative database, used to estimate the query sequence q and gene sequences The edit distance between .
5. The query method for similar patient diagnosis records based on block edit distance according to claim 1, characterized in that: Based on the calculated block edit distance and control parameters, the identifiers of the k gene sequences most similar to the pre-processed query sequence are obtained and sent to the data provider. The corresponding diagnostic records are returned to the user, including: Sort the calculated block edit distances in ascending order and select the first k The identifier of the gene sequence is sent to the data provider, and the data provider obtains the corresponding gene sequence and diagnosis record based on the gene sequence identifier and returns them to the server; The obtained diagnostic record is returned to the user.
6. A query device for similar patient diagnosis records based on block edit distance, characterized in that: The device is a server, comprising: A query request receiving module is used to receive a query request submitted by a user, wherein the query request includes a preprocessed query sequence and control parameters. The preprocessed query sequence is processed using the same preprocessing method as the data provider to obtain the corresponding block, index, and block negative database information. The control parameters are used to control the number of gene sequences most similar to the query sequence that are returned; The query module is used to calculate the block edit distance between the pre-processed query sequence and the gene sequence pre-stored on the server, and obtain the identifiers of the k gene sequences that are most similar to the pre-processed query sequence based on the calculated block edit distance and control parameters, and send them to the data provider, and return the corresponding diagnosis record to the user, wherein the block edit distance is the edit distance between the query sequence and the corresponding blocks of the gene sequence stored in the server. The gene sequence pre-stored on the server is obtained by the pre-processing method of the data provider and then uploaded to the server. The pre-processing method of the data provider specifically includes: all gene sequences in the data set are processed according to the pre-processing method. Assume that the segmentation parameter is used to segment the data into a series of non-repeating blocks, and a corresponding index is established for each segmented block. Then, all the blocks are spliced to obtain the pre-processed gene sequence and encoded into binary form. Then, the K-hidden algorithm is used to generate a negative database for the encoded gene sequence and segment it to obtain the block negative database information corresponding to each index. The block negative database information corresponding to the index and the corresponding index are uploaded to the server for storage. In the pre-processing method of the data provider, all gene sequences in the data set are segmented into a series of non-repeating blocks according to the preset segmentation parameter, and a corresponding index is established for each segmented block, including: From the dataset D Select any gene sequence as the reference sequence r ; According to gene sequence The editing matrix and preset segmentation parameters between the reference sequence and the gene sequence to be processed Perform segmentation to obtain a series of non-repeated blocks, create an index for each block, and add it to the segmentation set.
7. A query system for similar patient diagnosis records based on block edit distance, characterized in that: The method comprises the similar patient query device based on block edit distance as described in claim 6, a client, and a data provider, wherein the client is used to send a query request to the server, and the data provider is used to pre-process the gene sequences in the data set using a pre-processing method to obtain corresponding blocks, indexes, and block negative database information, and send them to the server for storage.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 5 is implemented.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Immune repertoire biological information analysis process based on molecular markers
CN108804874A
Set similarity query algorithm based on length partition
CN110334191A