Efficient DNA storage method and system based on hybrid encoding strategy
By employing a hybrid coding strategy to perform statistical analysis and encoding of DNA data, and combining redundant coding and pseudo-randomization construction, the problem of base errors in DNA storage is solved, achieving efficient and stable storage across multiple data types.
Patent Information
- Application Number
- CN202411610104.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-11-12
AI Technical Summary
Existing DNA data storage methods are prone to base errors during synthesis, storage, retrieval, and sequencing, leading to unstable and inefficient storage. Furthermore, existing methods designed for specific purposes have limited performance when handling diverse and complex data.
A hybrid coding strategy is adopted. By statistically analyzing the data to be stored, the coding algorithm and parameter settings of low-density parity coding or polarization coding are determined. Combined with the mapping of binary data to four bases, primers and markers are added to perform redundant coding and pseudo-randomization construction to ensure the stability and reliability of DNA sequences.
It achieves optimal coding performance in complex data of various types, improves error correction capabilities and data robustness, and ensures the stability and efficiency of DNA storage.
Smart Images

Figure CN119476423B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of DNA data storage, and in particular to an efficient DNA storage method and system based on a hybrid coding strategy. Background Art
[0002] With the rapid development of information technology, the gap between the exponential growth of data and the limited capacity of current mainstream storage media is becoming increasingly apparent. Faced with this pressure, there is an urgent need to develop more efficient storage media. DNA storage is seen as a new data storage medium with enormous potential. DNA data storage uses synthesis technology to write data into DNA and sequencing technology to read data from DNA. The main process of conventional DNA data storage includes encoding, synthesis, storage, retrieval, sequencing, and decoding.
[0003] Existing DNA data storage suffers from inefficiency and instability due to potential base errors such as deletions, insertions, and substitutions during synthesis, DNA storage, retrieval, and sequencing. To improve storage performance, current DNA data storage systems are often designed for specific purposes. While achieving high performance under certain circumstances, this limits overall performance when processing complex, diverse data types. Therefore, stably and efficiently storing data in DNA sequences is a pressing technical challenge. Summary of the Invention
[0004] In view of the above problems, the embodiments of the present application provide an efficient DNA storage method and system based on a hybrid coding strategy to overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect of the embodiments of the present application, an efficient DNA storage method based on a hybrid encoding strategy is disclosed, the method comprising:
[0006] Performing statistical analysis on the raw data to be stored to obtain data attributes, including: data type, data size, and data distribution;
[0007] Determining a coding algorithm and parameter settings of a hybrid encoder according to the data attributes and coding requirements, wherein the coding algorithm is low-density parity-check coding or polar coding;
[0008] Converting the raw data into binary data, and dividing and block-encoding the binary data according to a preset DNA sequence length, an encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy;
[0009] According to the mapping relationship between binary data and four bases, the redundant codeword sequence is converted to obtain a data storage DNA sequence;
[0010] According to the original data and the hybrid encoder, primers and markers are added to the data storage DNA sequence to obtain a final data storage DNA sequence, wherein the primers are used to record information of the DNA sequence storing the original data, and the markers are used to record at least parameter settings of the hybrid encoder.
[0011] Optionally, according to the mapping relationship between binary data and four bases, the codeword sequence with redundancy is converted to obtain a data storage DNA sequence, including:
[0012] Converting the redundant codeword sequence into an initial DNA sequence according to the mapping relationship between the binary data and the four-bit base;
[0013] Determining whether the initial DNA sequence satisfies constraint conditions, wherein the constraint conditions include: whether the total content of cytosine bases and guanine bases in the initial DNA sequence is within a preset range, and whether the length of a long homopolymer in the initial DNA sequence is less than a length threshold;
[0014] When the constraints are not met, the initial DNA sequence is pseudo-randomly constructed to obtain a data storage DNA sequence that meets the constraints. The pseudo-random construction refers to recursively calling a pseudo-random library to perform sum-product operations on the initial DNA sequence.
[0015] Optionally, adding primers and markers to the data storage DNA sequence according to the original data and the hybrid encoder to obtain a final data storage DNA sequence includes:
[0016] Primers are added to the data storage DNA sequence according to the original data, and marker bits are added to the data storage DNA sequence according to the pseudo-randomization structure and the hybrid encoder to obtain a final data storage DNA sequence.
[0017] Optionally, the binary data is divided and block-encoded according to a preset DNA sequence length, an encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy, including:
[0018] dividing the binary data according to a first number of characters input by the hybrid encoder to obtain a plurality of binary sequences having a length of the first number;
[0019] Encoding the multiple binary sequences according to the encoding algorithm to obtain encoding sequences having a second length, where the second length is the number of characters output by the hybrid encoder;
[0020] The coding sequence is divided according to the preset DNA sequence length to obtain a codeword sequence with redundancy.
[0021] Optionally, encoding the multiple binary sequences according to the encoding algorithm to obtain an encoding sequence having a length of the second number includes:
[0022] When the coding algorithm is low-density parity check coding, sequentially multiplying the multiple binary sequences with a generator matrix of the low-density parity check coding to generate redundant bits, and obtaining a coding sequence of a second length based on the generated redundant bits;
[0023] When the coding algorithm is polar coding, the multiple binary sequences are recursively polarized to generate a series of composite channels according to a generator matrix of the polar coding. The most reliable channel is selected and filled with redundant bits according to frozen bits of the polar coding to obtain a coded sequence of a second length.
[0024] Optionally, the method further includes:
[0025] Sequencing the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence;
[0026] Obtaining an encoding algorithm and parameter settings of a hybrid encoder according to a marker bit in the target data storage DNA sequence;
[0027] Converting the target data storage DNA sequence according to the mapping relationship from the four bases to binary data to obtain a plurality of binary codeword sequences;
[0028] Decoding the plurality of binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data;
[0029] Convert the binary data into raw data.
[0030] Optionally, obtaining a plurality of data storage DNA sequences, and obtaining an encoding algorithm and parameter settings of a hybrid encoder, include:
[0031] Sequencing the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence;
[0032] According to the marker bits in the target data storage DNA sequence, an encoding algorithm and parameter settings of the hybrid encoder are obtained.
[0033] Optionally, when the target data storage DNA sequence is pseudo-randomly constructed, the target data storage DNA sequence is converted according to the mapping relationship between the four bases and binary data to obtain multiple binary codeword sequences, including:
[0034] According to the mapping relationship between the four bases and the binary data, the codeword region in the target data storage DNA sequence is converted into a plurality of pseudo-random binary sequences;
[0035] According to the pseudo-randomization construction, the plurality of pseudo-random binary sequences are converted into a plurality of binary codeword sequences.
[0036] Optionally, decoding the multiple binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data includes:
[0037] When the coding algorithm is low-density parity check coding, converting the multiple binary codeword sequences into a first codeword sequence according to the number of output characters of the low-density parity check coding, and performing iterative decoding according to the first codeword sequence and a check matrix of the low-density parity check coding to obtain a binary sequence;
[0038] When the coding algorithm is polar coding, the multiple binary codeword sequences are converted into second codeword sequences based on the number of output symbols of the polar coding, and the second codeword sequences are sequentially decoded based on a generator matrix and frozen bits of the polar coding to obtain multiple binary sequences.
[0039] A second aspect of the embodiments of the present application discloses an efficient DNA storage system based on a hybrid encoding strategy, the system comprising:
[0040] An encoding module is configured to perform statistical analysis on the raw data to be stored to obtain data attributes, including data type, data size, and data distribution; determine an encoding algorithm and parameter settings for a hybrid encoder based on the data attributes and encoding requirements, wherein the encoding algorithm is low-density parity-check encoding or polarization encoding; convert the raw data into binary data, and divide and block-encode the binary data based on a preset DNA sequence length, the encoding algorithm, and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy; convert the codeword sequence with redundancy based on a mapping relationship between binary data and four-bit bases to obtain a data storage DNA sequence; and add primers and marker bits to the data storage DNA sequence based on the raw data and the hybrid encoder to obtain a final data storage DNA sequence, wherein the primers are used to record information about the DNA sequence storing the raw data, and the marker bits are used to record at least the parameter settings of the hybrid encoder;
[0041] The decoding module is used to sequence the data storage DNA sequence according to the primer of the original data to obtain a target data storage DNA sequence; obtain the encoding algorithm and parameter settings of the hybrid encoder according to the mark bit in the target data storage DNA sequence; convert the target data storage DNA sequence according to the mapping relationship between the four bases and binary data to obtain multiple binary codeword sequences; decode the multiple binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, remove redundant characters in the codewords, and obtain binary data; and convert the binary data into original data.
[0042] The third aspect of the embodiments of the present application discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the steps of the efficient DNA storage method based on the hybrid coding strategy described in the first aspect of the embodiments of the present application are implemented.
[0043] The fourth aspect of the embodiments of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the efficient DNA storage method based on the hybrid coding strategy described in the first aspect of the embodiments of the present application are implemented.
[0044] In a fifth aspect of the embodiments of the present application, a computer program product is disclosed, including a computer program, which, when executed by a processor, implements the steps of the efficient DNA storage method based on the hybrid coding strategy described in the first aspect of the embodiments of the present application.
[0045] The embodiments of the present application include the following advantages:
[0046] In the embodiments of the present application, the encoding algorithm and parameter settings used in the hybrid encoding process are determined based on the data attributes and encoding requirements of the original data. Different encoding algorithms (for example, low-density parity-check (LDPC) and polar codes) have different encoding performance for different data types, thereby achieving optimal encoding performance for a wide range of complex data types. Furthermore, the encoding algorithm can be either a LDPC code or a polar code. The performance differences between LDPC and polar codes under different codewords improve the efficiency of the hybrid encoding. The error correction capabilities of the hybrid encoding are also enhanced based on the error correction performance of LDPC and polar codes under different codewords. Furthermore, storing the encoding information in marker bits can be used to identify changes in DNA sequence regions and base positions, improving the ability to detect DNA sequence errors and ensuring data robustness. This achieves stable and efficient DNA storage, enabling the stable and efficient storage of large amounts of complex data within DNA sequences. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 This is a flow chart of the encoding steps of an efficient DNA storage method based on a hybrid encoding strategy provided in an embodiment of the present application;
[0049] Figure 2 This is a flow chart of the encoding steps of another efficient DNA storage method based on a hybrid encoding strategy provided in an embodiment of the present application;
[0050] Figure 3 This is a flowchart of the decoding steps of an efficient DNA storage method based on a hybrid encoding strategy provided in an embodiment of the present application;
[0051] Figure 4 This is a flowchart of the decoding steps of another efficient DNA storage method based on a hybrid encoding strategy provided in an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of the structure of an efficient DNA storage system based on a hybrid coding strategy provided in an embodiment of the present application;
[0053] Figure 6 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] To make the above-mentioned purposes, features, and advantages of this application more clearly understood, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of this application.
[0055] DNA data storage uses synthesis technology to write data information into DNA and sequencing technology to read data information from DNA. The main processes of conventional DNA data storage include: encoding, synthesis, storage, retrieval, sequencing and decoding. Specifically, using specific code conversion rules, binary files are mapped to corresponding base sequences composed of adenine (A), thymine (T), cytosine (C) and guanine (G), and then written into the DNA chain through synthesis technology; the DNA chain must be stored in a suitable environment to ensure stability; due to the presence of a large number of DNA chains in the storage environment, obtaining the target data requires retrieval technology to obtain the corresponding DNA chain; sequencing technology is used to read the base arrangement of the DNA chain, and then the bases are decoded to restore the original data.
[0056] Existing DNA data storage can introduce base errors such as deletions, insertions, and substitutions during synthesis, DNA storage, retrieval, and sequencing. This requires adding redundancy to the encoded data to correct for random errors that may be introduced into the DNA sequence. During the encoding process, the DNA sequence must avoid certain specific constraints to reduce the probability of errors during storage. For example, DNA sequences with high or low GC content (the total amount of cytosine and guanine bases) and long homopolymer sequences can lead to a large number of errors in synthesis and sequencing.
[0057] Furthermore, the length of DNA sequences is also limited by technology, so long DNA sequences are typically divided into shorter segments of equal length. In this case, each DNA sequence must include an index segment to record address information. Primer tags are also added to the front and back ends of the DNA segments to synthesize gene fragments or oligonucleotide libraries, which are then stored in vivo or in vitro. During the retrieval process, polymerase chain reaction (PCR) amplification identifies specific primers to locate the target DNA strand, and sequencing and decoding are used to recover the original file.
[0058] As the scale of DNA storage continues to expand, DNA encoding needs to meet different data types and storage requirements to realize the practical application of DNA storage. Current DNA data storage methods are often designed for a specific purpose to improve storage performance. Although they achieve high performance under certain circumstances, they limit overall performance when processing complex data of multiple types. Furthermore, DNA storage differs from traditional media in that, after traditional media completes data writing and reading, the data is arranged in the storage medium in the order of physical addresses, and fixed-format data can be found through physical addressing. In DNA storage, however, DNA chains are distributed in a chaotic manner in the storage medium, requiring primers to find the target chain and then sorting the data based on index information. Furthermore, the DNA sequence will introduce certain random errors during the synthesis and sequencing process, leading to difficulties in data recovery.
[0059] To overcome the limitations of related technologies and achieve stable and efficient data storage in DNA sequences, the present invention provides an efficient DNA storage method based on a hybrid encoding strategy. This method achieves optimal encoding performance for multiple types of complex data. Detailed description is provided below.
[0060] The present invention provides an efficient DNA storage method based on a hybrid coding strategy. Figure 1 As shown, Figure 1 This is a flow chart of the coding steps of an efficient DNA storage method based on a hybrid coding strategy provided in an embodiment of the present application. Figure 1 As shown, the method may include steps S110 to S150:
[0061] Step S110: Statistical analysis is performed on the original data to be stored to obtain the original data, wherein the data attributes include: data type, data size, and data distribution.
[0062] In the present embodiment, to ensure good DNA storage performance in different data scenarios, data attributes are considered as a factor in determining the encoding algorithm. For the raw data to be stored, a statistical analysis is first performed on the raw data, that is, statistics are collected on data information such as the data type, data size, and data distribution of the raw data to obtain the data attributes of the raw data.
[0063] Step S120: Determine a coding algorithm and parameter settings of a hybrid encoder according to the data attributes and coding requirements, wherein the coding algorithm is low-density parity-check coding or polar coding.
[0064] Among them, the coding requirements include coding redundancy, DNA sequence storage channel error rate and codeword length; the parameter settings of the hybrid encoder include the number of input characters, the number of output characters, and the coding parameters corresponding to different coding algorithms.
[0065] Specifically, for low-density parity-check (LDPC) coding, the coding parameters include a check matrix and a generator matrix. The check matrix is constructed based on the codeword length, check nodes, and variable nodes, and the generator matrix is the transposed check matrix. For polar coding, the coding parameters include the generator matrix and frozen bits. The frozen bits are set by recursively applying polarization operations based on the information bit length and codeword length.
[0066] It is understandable that if there is only one original data to be stored, the encoding algorithm is one of low-density parity check coding and polar coding; if the original data includes multiple data, the encoding algorithms corresponding to each original data may be different or the same.
[0067] In the embodiments of the present application, by taking data attributes and coding requirements into consideration when determining the coding algorithm, different coding algorithms (for example, low-density parity-check coding and polar coding) have different coding performances for different data, thereby achieving optimal coding performance for multiple types of complex data.
[0068] Step S130: converting the original data into binary data, and dividing and block encoding the binary data according to the preset DNA sequence length, the encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy.
[0069] In the embodiment of the present application, the original data is converted into binary data according to the conversion relationship between the original data and the binary data. It is understandable that the conversion relationship between the original data and the binary data is different for different types of original data.
[0070] To facilitate data encoding, the original data is converted into binary data, which is then divided and block-encoded based on the binary data to produce a redundant codeword sequence. The redundant codeword sequence includes both redundant codewords and codewords corresponding to the binary data. The hybrid encoder performs error correction by adding the redundant codewords to the binary data.
[0071] Step S140: converting the redundant codeword sequence according to the mapping relationship between binary data and four-bit bases to obtain a data storage DNA sequence.
[0072] The four bases are adenine (A), thymine (T), cytosine (C), and guanine (G). Redundant codeword sequences are essentially binary data sequences, while DNA sequences are sequences of different bases. To store data in a DNA sequence, the redundant codeword sequence is converted based on the mapping relationship between binary data and four bases, resulting in a data storage DNA sequence.
[0073] In one embodiment, the mapping relationship between binary data and four bases is expressed as: 00-A, 01-T, 10-G, 11-C, that is, 00 in the code word sequence with redundancy is converted to adenine in the DNA sequence, 01 in the code word sequence with redundancy is converted to thymine in the DNA sequence, 10 in the code word sequence with redundancy is converted to cytosine in the DNA sequence, and 11 in the code word sequence with redundancy is converted to guanine in the DNA sequence.
[0074] It can be understood that in addition to the above-mentioned representation, the mapping relationship between binary data and four bases also has other representations. For example, the mapping relationship can also be expressed as: 00-C, 01-G, 10-A, 11-T. The embodiment of the present application does not make any specific limitation on the representation of the mapping relationship between binary data and four bases.
[0075] Step S150: According to the original data and the hybrid encoder, primers and markers are added to the data storage DNA sequence to obtain a final data storage DNA sequence, wherein the primers are used to record information of the DNA sequence storing the original data, and the markers are used to record at least the parameter settings of the hybrid encoder.
[0076] In an embodiment of the present application, primers are added to a data storage DNA sequence based on the original data, and markers are added to the data storage DNA sequence based on the hybrid encoder. This allows the storage information of the original data to be recorded in the primers of the DNA sequence, allowing the DNA data corresponding to the data to be decoded to be subsequently retrieved based on the primers. Furthermore, the information of the hybrid encoder (encoding algorithm and parameter settings) is recorded in the markers of the DNA sequence, and the hybrid encoder information can be retrieved based on these markers for decoding. In this way, by adding primers and markers to the data storage DNA sequence, changes in DNA sequence regions and base positions can be identified, improving the ability to detect DNA sequence errors and ensuring data robustness.
[0077] In practical applications, when the original data needs to be stored, the original data to be stored is stored in the DNA sequence according to the method of the above steps S110 to S150.
[0078] In the above process, since the coding algorithm and parameter settings used in the hybrid coding process are determined according to the data attributes and coding requirements of the original data, different coding algorithms (for example, low-density parity-check coding and polarization coding) have different coding performance for different data, and thus can achieve the best coding performance in multiple types of complex data. In addition, the coding algorithm can be a low-density parity-check code or a polarization code. According to the performance difference of the low-density parity-check code and the polarization code under different code words, the efficiency of the hybrid coding is improved; according to the error correction performance of the low-density parity-check code and the polarization code under different code words, the error correction capability of the hybrid coding is improved. In addition, storing the coding information in the marker bit can be used to identify changes in the DNA sequence region and base position, improves the ability to identify DNA sequence errors, and ensures the robustness of the data. In this way, a stable and efficient DNA storage is realized, which can stably and efficiently store a large amount of complex data in the DNA sequence.
[0079] In conjunction with the above embodiments, in one embodiment, the present application also provides an efficient DNA storage method based on a hybrid coding strategy. In this method, the above step S130 of "dividing and encoding the binary data in blocks according to the preset DNA sequence length, the encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy" can specifically include steps S130-1 to S130-3:
[0080] Step S130 - 1 : Divide the binary data according to a first number of characters input by the hybrid encoder to obtain a plurality of binary sequences having a first number of lengths.
[0081] In this embodiment of the present application, to facilitate encoding, binary data needs to be divided into multiple binary sequences that meet the input length of the hybrid encoder (i.e., multiple binary sequences having a first length). Specifically, different encoding algorithms may correspond to different input character lengths. If the encoding algorithm is low-density parity-check encoding, the first length is the number of low-density parity-check encoding input characters. If the encoding algorithm is polar encoding, the first length is the number of polar encoding input characters.
[0082] Step S130 - 2 : Encode the multiple binary sequences according to the encoding algorithm to obtain encoding sequences with a length of a second number, where the second number is the number of characters output by the hybrid encoder.
[0083] In the embodiments of the present application, the coding algorithm is low-density parity-check (LDPC) coding or polar coding. For the binary sequences corresponding to different original data, the corresponding coding algorithm is selected for coding, and finally the hybrid encoder outputs a coding sequence with a second quantity. If the coding algorithm is LDPC coding, the second quantity is the number of output characters of LDPC coding; if the coding algorithm is polar coding, the second quantity is the number of output characters of polar coding.
[0084] Specifically, encoding the plurality of binary sequences according to the coding algorithm to obtain a coding sequence with a second quantity includes item A-1 and item A-2:
[0085] Item A-1: When the coding algorithm is LDPC coding, sequentially multiply the plurality of binary sequences by the generator matrix of LDPC coding to generate redundant bits, and obtain a coding sequence with a second quantity according to the generated redundant bits.
[0086] In the embodiments of the present application, the generator matrix G of LDPC coding is the transpose of the parity-check matrix H. The parity-check matrix H of LDPC coding is constructed based on the second quantity n of output characters, check nodes, and variable nodes, that is, the parity-check matrix H is a sparse matrix of m×n (where m < n), and the generator matrix G is a matrix of n×(n−m). When performing LDPC coding, multiply the binary sequence c with a first quantity (such as the first quantity k = n−m) by the generator matrix G of LDPC coding to generate redundant bits, and then obtain a coding sequence with a second quantity n.
[0087] Item A-2: When the coding algorithm is polar coding, according to the generator matrix of polar coding, pass the plurality of binary sequences through recursive polarization to generate a series of synthetic channels, select the most reliable channel, and fill redundant bits according to the frozen bits of polar coding to obtain a coding sequence with a second quantity.
[0088] In the embodiments of the present application, the generator matrix of polar coding is constructed based on the first quantity k of encoder input characters and the second quantity n of output characters. The generator matrix of polar coding is a polarization matrix. Based on the information bit length k and the codeword length n, the frozen bits are set by recursively applying the polarization operation. Specifically, the reliability of the channel is calculated by calculating the bit error rate, and then the most reliable channel is selected to fill redundant bits according to the frozen bits of polar coding; the length of the frozen bits is n−k and is set to 0. Combine the information bits and the frozen bits to form a bit sequence with a length of n, and then encode through the generator matrix of polar coding to obtain a coding sequence with a second quantity n.
[0089] Step S130 - 3 : Divide the coding sequence according to the preset DNA sequence length to obtain a codeword sequence with redundancy.
[0090] In an embodiment of the present application, the length of the coding sequence obtained after encoding is the second number. For the convenience of storage, after obtaining the coding sequence, the coding sequence is divided according to the preset DNA sequence length to obtain a code word sequence with redundancy that meets the preset DNA sequence length.
[0091] In this way, binary data is divided and encoded in blocks according to the preset DNA sequence length, the encoding algorithm and parameter settings of the hybrid encoder. Since the encoding algorithm and parameter settings of the hybrid encoder are determined according to data attributes and encoding requirements, it provides a variety of flexible encoding schemes for different data, reducing the risk of data leakage.
[0092] In conjunction with the above embodiments, in one embodiment, the present application also provides an efficient DNA storage method based on a hybrid coding strategy. In this method, the above step S140 of "converting the redundant codeword sequence according to the mapping relationship between binary data and four-bit bases to obtain a data storage DNA sequence" can specifically include steps S140-1 to S140-3:
[0093] Step S140 - 1 : converting the redundant codeword sequence into an initial DNA sequence according to the mapping relationship between the binary data and the four-bit base.
[0094] Step S140-2: Determine whether the initial DNA sequence satisfies constraints, where the constraints include: whether the total content of cytosine and guanine bases in the initial DNA sequence is within a preset range, and whether the length of a long homopolymer in the initial DNA sequence is less than a length threshold;
[0095] Step S140-3: When the constraints are not met, the initial DNA sequence is pseudo-randomly constructed to obtain a data storage DNA sequence that meets the constraints, wherein the pseudo-random construction refers to recursively calling a pseudo-random library to perform sum-product operations on the initial DNA sequence.
[0096] In the examples of this application, we consider that the probability of DNA sequence errors increases significantly when the GC content (i.e., the total content of cytosine and guanine bases) in a DNA sequence is low or high, or when the length of long homopolymers is long. Therefore, a pseudo-randomized construction is used to enhance the randomness of the DNA sequence, maintain a moderate GC content (e.g., between 40% and 60%), and effectively reduce the length of long homopolymers, thereby complying with the biochemical constraints of DNA and achieving stable data storage.
[0097] Specifically, for a codeword sequence with redundancy, step S140-1 is first executed to convert the codeword sequence with redundancy into an initial DNA sequence. Then, step S140-2 is executed to determine whether the initial DNA sequence satisfies the constraint conditions, where GC content refers to the total cytosine and guanine base content, and long homopolymers refer to the number of consecutive bases. Only when the total cytosine and guanine base content in the initial DNA sequence is within a preset range and the length of the long homopolymer in the initial DNA sequence is less than a length threshold is the initial DNA sequence determined to satisfy the constraint conditions. Otherwise, the initial DNA sequence satisfies the constraint conditions. If the constraint conditions are not satisfied, step S140-3 is executed to pseudo-randomize the initial DNA sequence to obtain a data storage DNA sequence that satisfies the constraint conditions.
[0098] In this way, pseudo-random DNA sequences that meet biochemical constraints can be generated through pseudo-random construction, which improves the stability of the DNA sequence and achieves stable storage of data.
[0099] Furthermore, in the method, the step S150 of “adding primers and markers to the data storage DNA sequence according to the original data and the hybrid encoder to obtain a final data storage DNA sequence” specifically includes:
[0100] Primers are added to the data storage DNA sequence according to the original data, and marker bits are added to the data storage DNA sequence according to the pseudo-randomization structure and the hybrid encoder to obtain a final data storage DNA sequence.
[0101] In this embodiment of the present application, the storage information of the original data is recorded in the primer of the DNA sequence so that the DNA data corresponding to the data to be decoded can be subsequently obtained based on the primer. If the data storage DNA sequence is obtained through pseudo-randomization, it is necessary to store the pseudo-randomization construction process and the hybrid encoder information (encoding algorithm and parameter settings) in the flag bit. This allows the hybrid encoder information and pseudo-randomization construction information to be subsequently obtained based on the flag bit to achieve decoding of the data storage DNA sequence.
[0102] In this way, by adding primers and markers to the data storage DNA sequence, changes in DNA sequence regions and base positions can be identified, improving the ability to identify DNA sequence errors and ensuring the robustness of the data.
[0103] parameter Figure 2 As shown, Figure 2 This is a flow chart of the encoding steps of another efficient DNA storage method based on a hybrid encoding strategy provided in an embodiment of the present application, such as Figure 2As shown, in this method, the original data is encoded according to the following steps, and the method may include steps S210 to S270:
[0104] Step S210: Statistically analyze the original data to be stored to obtain data attributes, which include: data type, data size, and data distribution.
[0105] Step S220: Determine the encoding algorithm and parameter settings of the hybrid encoder according to the data attributes and encoding requirements, where the encoding algorithm is low-density parity-check coding or polar coding.
[0106] Step S230: converting the original data into binary data, and dividing and block encoding the binary data according to the preset DNA sequence length, the encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy.
[0107] Step S240: converting the redundant codeword sequence into an initial DNA sequence according to the mapping relationship between the binary data and the four-bit base.
[0108] Step S250: Determine whether the initial DNA sequence satisfies constraints, where the constraints include: whether the total content of cytosine bases and guanine bases in the initial DNA sequence is within a preset range, and whether the length of the long homopolymer in the initial DNA sequence is less than a length threshold.
[0109] Step S260: When the constraint conditions are not met, the initial DNA sequence is pseudo-randomly constructed to obtain a data storage DNA sequence that meets the constraints, wherein the pseudo-random construction refers to recursively calling a pseudo-random library to perform sum-product operations on the initial DNA sequence.
[0110] Step S270: adding primers to the data storage DNA sequence according to the original data, and adding marker bits to the data storage DNA sequence according to the pseudo-randomization construction process and the hybrid encoder to obtain a final data storage DNA sequence.
[0111] In the embodiments of the present application, the encoding algorithm and parameter settings used in the hybrid encoding process are determined based on the data attributes and encoding requirements of the original data. Different encoding algorithms (for example, low-density parity-check (LDPC) and polar codes) offer different encoding performance for different data types, thereby achieving optimal encoding performance for a wide range of complex data types. Furthermore, the encoding algorithm can be either a LDPC code or a polar code. The performance differences between LDPC and polar codes under different codewords improve the efficiency of hybrid encoding. The error correction capabilities of hybrid encoding are also enhanced based on the error correction performance of LDPC and polar codes under different codewords.
[0112] Moreover, the randomness of DNA sequence is improved by pseudo-randomization construction, the moderation of GC content is maintained, and the length of long homopolymers is effectively reduced, thereby meeting the biochemical constraints of DNA and realizing the stable storage of data. In addition, due to the hybrid coding characteristics, the coding algorithm and parameter setting of the hybrid encoder are stored by the marker bit in the DNA sequence, which improves the security of stored information. Thus, the embodiment of the application can design a complicated hybrid coding method, and by adjusting the parameter setting of the encoder, a diversified flexible coding scheme is provided, reducing the risk of data leakage. In this way, a kind of stable and efficient DNA storage is realized, and a large amount of complex data can be stably and efficiently stored in the DNA sequence.
[0113] In combination with the above embodiments, in one embodiment, the present application also provides an efficient DNA storage method based on a hybrid coding strategy. Figure 3 As shown, in this method, the data storage DNA sequence is decoded according to the following steps, specifically including steps S310 to S350:
[0114] Step S310: Sequence the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence.
[0115] Among them, the target data storage DNA sequence refers to the DNA sequence used for decoding. The data storage DNA sequence carries the primers of the original data, and the primers record the information of the DNA sequence storing the original data. Then, specific extraction is performed based on the primers of the original data to obtain the corresponding target data storage DNA sequence.
[0116] Step S320: Obtaining the encoding algorithm and parameter settings of the hybrid encoder according to the marker bits in the target data storage DNA sequence.
[0117] The encoding algorithm and parameter settings of the hybrid encoder refer to the encoding algorithm and parameter settings used to encode the target data storage DNA sequence. The parameter settings include a first number of input characters and a second number of output characters. If the encoding algorithm is low-density parity-check coding, the parameter settings also include the parity check matrix and generator matrix of the low-density parity-check coding. If the encoding algorithm is polarization coding, the parameter settings also include the generator matrix and frozen bits of the polarization coding. Information about the hybrid encoder is stored in the flag bit of the target data storage DNA, and the encoding algorithm and parameter settings of the hybrid encoder are obtained through the flag bit.
[0118] Step S330: converting the target data storage DNA sequence according to the mapping relationship from the four-bit base to binary data to obtain a plurality of binary codeword sequences.
[0119] In an embodiment of the present application, the target data storage DNA sequence is a base sequence composed of different bases. In order to obtain the stored data, the target data storage DNA sequence is converted according to the mapping relationship between four bases and binary data to obtain multiple binary codeword sequences. For example, if the mapping relationship between four bases and binary data is: A-00, T-01, G-10, C-11, then A in the target data storage DNA sequence is converted to the value 00, T is converted to the value 01, G is converted to the value 10, and C is converted to the value 11, thereby obtaining a binary codeword sequence.
[0120] In some embodiments, the target data storage DNA sequence is converted according to the mapping relationship from the four-bit base to binary data to obtain multiple binary codeword sequences, including: for the multiple copy characteristics of the target data storage DNA sequence (corresponding to multiple DNA sequences), based on the preset DNA sequence length and the mark bit position, the DNA sequence region is identified, whether the length is consistent, and the DNA sequence of poor quality is removed; for the remaining multiple DNA sequences, based on sequence similarity and index region, clustering is performed to obtain a cluster containing multiple similar DNA sequences; for the multiple DNA sequence clusters, based on the preset DNA sequence length and sequence alignment, the multiple DNA sequences are restored to obtain a DNA sequence from each cluster; finally, for each DNA sequence obtained by the clustering, according to the mapping relationship from the four-bit base to binary data, each DNA sequence is converted to obtain multiple binary codeword sequences.
[0121] Step S340: decoding the plurality of binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data.
[0122] For each binary codeword sequence, decoding is performed using the encoding algorithm and parameter settings of the hybrid encoder to remove redundant characters in the codeword and obtain binary data.
[0123] Specifically, according to the encoding algorithm and parameter settings of the hybrid encoder, the multiple binary codeword sequences are decoded, and redundant characters in the codewords are removed to obtain binary data, including item B-1 and item B-2:
[0124] Item B-1: When the coding algorithm is low-density parity-check coding, the multiple binary codeword sequences are converted into a first codeword sequence according to the number of output characters of the low-density parity-check coding, and iterative decoding is performed according to the first codeword sequence and the check matrix of the low-density parity-check coding to obtain a binary sequence.
[0125] Item B-2: When the coding algorithm is polar coding, convert the multiple binary codeword sequences into a second codeword sequence based on the number of output symbols of the polar coding, and sequentially decode the second codeword sequence based on a generator matrix and frozen bits of the polar coding to obtain multiple binary sequences.
[0126] In an embodiment of the present application, for each binary codeword sequence, the binary codeword sequence is spliced in units of the second number according to the second number and index order of the output characters to obtain multiple codeword sequences with a length of the second number, and then for each codeword sequence with a length of the second number, decoding is performed based on the encoding information (encoding algorithm and parameter device) of the hybrid encoder and the decoder.
[0127] (1) When the coding algorithm is low-density parity check coding, for each bit in each codeword sequence of the second length, hard decision is used to obtain the probability of each bit being 0 or 1, that is, to initialize the maximum likelihood value Initially, the variable node (Variable Node Refers to the bits in the transmitted codeword. Each variable node corresponds to a bit in the encoded codeword and updates its own state to 0 or 1 according to the received codeword bit and the information transmitted by the check node. (Check Node Refers to the check equation in the encoding process, which determines whether the current solution meets the parity check condition based on the received variable node information) Send information , and calculate and send new information to the variable node at the same time. For each variable node, the information sent by the verification node It can be expressed as:
[0128]
[0129] in, In addition to Other than The collection of all connected variable nodes.
[0130] The variable node updates its maximum likelihood value to reflect the new information brought by all the check nodes. :
[0131]
[0132] Based on the new maximum likelihood value, a hard decision is made for each variable node. The parity check matrix is checked to see if it satisfies all the check conditions. If all the check conditions are met, the decoding is successful and the decoding process ends. Otherwise, the process returns and information is passed.
[0133] (2) When the coding algorithm is polar coding, a Successive Cancellation List (SCL) algorithm is used for decoding the polar coding. The codeword sequence transmitted by the channel is obtained and an empty list is created according to the sequence length. For each bit, starting from each path in the list, two possibilities of the bit being 0 or 1 are tried, and both paths are added to the list. The probability of each path is calculated. After each decoding step, the most likely path in the list is retained based on the path probability. When the decoding reaches the last bit, the most reliable path in the list is selected as the decoding result to obtain a decoded binary sequence.
[0134] Step S350: Convert the binary data into original data.
[0135] In the embodiment of the present application, after obtaining the binary data, the binary data is converted into the original data according to the conversion relationship between the binary data and the original data, thereby storing the target data DNA sequence. It is understandable that the conversion relationship between the binary data and the original data is different for different types of original data.
[0136] In practical applications, when it is necessary to obtain data stored in a DNA sequence, the corresponding target data storage DNA sequence is obtained according to the method of steps S310 to S350 above, and the target data storage DNA sequence is decoded to obtain the corresponding original data.
[0137] Through the above process, a DNA sequence error correction method and a decoding error correction method were designed based on a hybrid coding strategy. DNA sequence errors were corrected based on clustering and marker bit recognition. Most insertion and deletion errors were corrected and the insertion and deletion errors were changed into substitution errors. The remaining substitution errors were corrected through a decoding algorithm to improve the robustness of the data.
[0138] In combination with the above embodiments, in one embodiment, the present application also provides an efficient DNA storage method based on a hybrid coding strategy. Figure 4 As shown, in this method, when the target data storage DNA sequence is subjected to pseudo-randomization construction processing, the data storage DNA sequence is decoded according to the following steps, specifically, including steps S410 to S460:
[0139] Step S410: Sequence the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence.
[0140] Step S420: Obtaining the encoding algorithm and parameter settings of the hybrid encoder according to the marker bits in the target data storage DNA sequence.
[0141] Step S430: According to the mapping relationship between the four bases and binary data, the codeword region in the target data storage DNA sequence is converted into a plurality of pseudo-random binary sequences.
[0142] Step S440: Convert the plurality of pseudo-random binary sequences into a plurality of binary codeword sequences according to the pseudo-randomization construction.
[0143] Step S450: decoding the plurality of binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data.
[0144] Step S460: Convert the binary data into original data.
[0145] In an embodiment of the present application, the target data storage DNA sequence is processed by pseudo-random construction, and the pseudo-random construction process is also recorded in the mark bit of the target data storage DNA sequence, so the encoding algorithm, parameter setting and pseudo-random construction of the hybrid encoder are obtained according to the mark bit.
[0146] After converting the codeword region in the target data storage DNA sequence into multiple pseudo-random binary sequences, the pseudo-random binary sequences need to be de-randomized according to the pseudo-randomization structure to obtain a binary codeword sequence. The binary codeword sequence is then decoded to obtain binary data, which is then restored to the original data, completing the DNA data decoding.
[0147] Through the above process, a DNA sequence error correction method and a decoding error correction method were designed based on a hybrid coding strategy. DNA sequence errors were corrected based on clustering and marker bit recognition. Most insertion and deletion errors were corrected and the insertion and deletion errors were changed into substitution errors. The remaining substitution errors were corrected through a decoding algorithm to improve the robustness of the data.
[0148] Furthermore, to better illustrate the performance of the efficient DNA storage method based on the hybrid coding strategy in the embodiments of the present application, the efficient DNA storage method based on the hybrid coding strategy in the embodiments of the present application is described using multiple types of raw data including images, videos, PDF documents, and audio as examples. Information on different types of raw data is shown in Table 1:
[0149] Table 1 Various types of raw data
[0150]
[0151] In the embodiments of the present application, the entire computer simulation experiment was run on an AMD R9 CPU with 32GB of random access memory using Python 3.11 in a Windows 11 environment to ensure fairness in the comparison.
[0152] First, different types of raw data are encoded according to the encoding steps of the efficient DNA storage method based on the hybrid encoding strategy in the embodiment of the present application, specifically:
[0153] Step 1: Perform statistical analysis on the original data to be stored to obtain data attributes, which include: data type, data size, and data distribution.
[0154] Step 2: Determine the encoding algorithm and parameter settings of the hybrid encoder according to data attributes and encoding requirements. The encoding algorithm is low-density parity check encoding or polar encoding.
[0155] Specifically, the length of the coding channel and the channel error rate can be set to select the coding algorithm of the hybrid encoder. The parameter settings include: preset DNA length (preset DNA length M=160), the first number k of input characters, the second number n of output characters, the generator matrix and check matrix of low-density parity-check coding, the generator matrix and frozen bits of polarization coding.
[0156] Step 3: Convert the original data (various original data in Table 1) into binary data. Divide the binary data according to the first number of characters input by the hybrid encoder to obtain multiple binary sequences of the first number of lengths, and record the address indexes. Encode the multiple binary sequences according to the encoding algorithm to obtain coded sequences of the second number of lengths. Divide the coded sequences according to the preset DNA sequence length to obtain codeword sequences with redundancy. Then, record the address indexes and merge the two-level address indexes to obtain index information.
[0157] Step 4: Based on the mapping relationship between binary data and four-bit bases, the redundant codeword sequence is converted into an initial DNA sequence. The initial DNA sequence is then determined to meet the constraints. If not, the initial DNA sequence is pseudo-randomized to obtain a data storage DNA sequence that meets the constraints. The pseudo-randomization involves recursively calling a pseudo-random library and performing a sum-product operation on the initial DNA sequence. The DNA sequence generated by the randomization maintains a GC content of approximately 50%, and the length of homopolymers is less than 5.
[0158] Step 5: Add primers to the data storage DNA sequence based on the original data (i.e., add primers with a length of 20 nt to the front and back ends of the data storage DNA sequence respectively), and add marker bits to the data storage DNA sequence based on the pseudo-randomization structure and the hybrid encoder to obtain the final data storage DNA sequence.
[0159] When the data stored in the data storage DNA sequence is to be obtained, the data storage DNA sequence is decoded according to the decoding steps of the efficient DNA storage method based on the hybrid coding strategy in the embodiment of the present application, specifically:
[0160] Step 6: Sequence the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence, and obtain the encoding algorithm and parameter settings of the hybrid encoder according to the marker bits in the target data storage DNA sequence.
[0161] Since each DNA sequence undergoes the synthetic sequencing process, multiple copies that may contain errors are produced. The DNA sequences are clustered according to sequence similarity, and the most likely DNA sequence is recovered from each cluster, and all DNA sequences are decoded.
[0162] Specifically, the simulated synthesis sequencing process introduces random errors with a probability ranging from 0% to 3%, and the decoded data remains consistent with the original data. The technical solution based on the embodiment of the present application achieves an information density of up to 1.9 bits / nt. At the same time, higher error rates can be corrected by reducing the information density. Compared with other DNA storage methods, it provides more stable encoding performance, as shown in Table 2:
[0163] Table 2 Comparison of DNA storage encoding scheme and experimental results
[0164]
[0165] Through computer simulations, various file types, including images, videos, and audio, were input into a hybrid encoder. The data was then encoded using a highly efficient DNA storage method based on a hybrid coding strategy. A synthetic sequencing process was simulated for the encoded data storage DNA sequence, introducing random errors to verify the error correction capability of the decoding process. The experimental results demonstrate that the embodiments of the present application can maintain a stable DNA information storage density, and that the decoding process can correct any errors that may occur.
[0166] The present application also provides an efficient DNA storage system based on a hybrid coding strategy, referring to Figure 5 As shown, Figure 5 : is a schematic diagram of the structure of an efficient DNA storage system based on a hybrid coding strategy provided in an embodiment of the present application, the system comprising:
[0167] The encoding module 510 is configured to perform statistical analysis on the raw data to be stored to obtain data attributes, including data type, data size, and data distribution; determine an encoding algorithm and parameter settings for a hybrid encoder based on the data attributes and encoding requirements, where the encoding algorithm is low-density parity-check encoding or polarization encoding; convert the raw data into binary data, and divide and block-encode the binary data based on a preset DNA sequence length, the encoding algorithm, and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy; convert the codeword sequence with redundancy based on a mapping relationship between binary data and four bases to obtain a data storage DNA sequence; and add primers and marker bits to the data storage DNA sequence based on the raw data and the hybrid encoder to obtain a final data storage DNA sequence, where the primers are used to record information about the DNA sequence storing the raw data, and the marker bits are used to record at least the parameter settings of the hybrid encoder.
[0168] The decoding module 520 is configured to sequence the data storage DNA sequence according to the primers of the original data to obtain a target data storage DNA sequence; obtain an encoding algorithm and parameter settings of a hybrid encoder according to the marker bits in the target data storage DNA sequence; convert the target data storage DNA sequence according to the mapping relationship between the four bases and binary data to obtain multiple binary codeword sequences; decode the multiple binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, remove redundant characters in the codewords, and obtain binary data; and convert the binary data into original data.
[0169] In an embodiment of the present application, the system can realize the above-mentioned efficient DNA storage method based on the hybrid coding strategy. When data storage is required, the original data is stored in the DNA sequence of the original data through the encoding module. When the data stored in the DNA sequence of the original data needs to be obtained, the target data storage DNA sequence to be decoded is obtained through the decoding module, and decoding is performed to obtain the corresponding original data.
[0170] In some optional embodiments, the encoding module is further used to convert the redundant codeword sequence into an initial DNA sequence based on the mapping relationship between the binary data and the four-bit base; determine whether the initial DNA sequence meets the constraint conditions, and the constraint conditions include: whether the total content of cytosine bases and guanine bases in the initial DNA sequence is within a preset range, and whether the length of the long homopolymer in the initial DNA sequence is less than a length threshold; if the constraint conditions are not met, perform pseudo-random construction on the initial DNA sequence to obtain a data storage DNA sequence that meets the constraints, and the pseudo-random construction refers to: recursively calling a pseudo-random library to perform sum-product operations on the initial DNA sequence.
[0171] In some optional embodiments, the encoding module is further used to add primers to the data storage DNA sequence based on the original data, and to add marker bits to the data storage DNA sequence based on the pseudo-randomization structure and the hybrid encoder to obtain a final data storage DNA sequence.
[0172] In some optional embodiments, the encoding module is further used to divide the binary data according to a first number of characters input by the hybrid encoder to obtain multiple binary sequences with a first length; encode the multiple binary sequences according to the encoding algorithm to obtain encoding sequences with a second length, where the second length is the number of characters output by the hybrid encoder; and divide the encoding sequence according to the preset DNA sequence length to obtain a codeword sequence with redundancy.
[0173] In some optional embodiments, the encoding module is further configured to, when the encoding algorithm is low-density parity-check encoding, sequentially multiply the multiple binary sequences by a generator matrix of the low-density parity-check encoding to generate redundant bits, and obtain a coding sequence of a second length based on the generated redundant bits; and, when the encoding algorithm is polarization encoding, recursively polarize the multiple binary sequences according to the generator matrix of the polarization encoding to generate a series of synthetic channels, select the most reliable channel, fill the redundant bits according to the frozen bits of the polarization encoding, and obtain a coding sequence of the second length.
[0174] In some optional embodiments, the decoding module is further used to convert the codeword region in the target data storage DNA sequence into multiple pseudo-random binary sequences based on the mapping relationship between the four-bit base and the binary data; and convert the multiple pseudo-random binary sequences into multiple binary codeword sequences based on the pseudo-randomization structure.
[0175] In some optional embodiments, the decoding module is further configured to, when the coding algorithm is low-density parity-check coding, convert the multiple binary codeword sequences into a first codeword sequence based on the number of output characters of the low-density parity-check coding, and perform iterative decoding based on the first codeword sequence and a check matrix of the low-density parity-check coding to obtain a binary sequence; and, when the coding algorithm is polar coding, convert the multiple binary codeword sequences into a second codeword sequence based on the number of output characters of the polar coding, and perform sequential decoding on the second codeword sequence based on a generator matrix and frozen bits of the polar coding to obtain multiple binary sequences.
[0176] The present application also provides an electronic device, Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 600 includes: a memory 610 and a processor 620. The memory 610 and the processor 620 are connected via a bus communication. A computer program is stored in the memory 610, and the computer program can be run on the processor 620, thereby realizing the steps of the efficient DNA storage method based on the hybrid coding strategy described in the embodiment of the present application.
[0177] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the efficient DNA storage method based on the hybrid coding strategy described in the embodiment of the present application are implemented.
[0178] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the efficient DNA storage method based on the hybrid coding strategy described in the embodiment of the present application.
[0179] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0180] Although 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 become aware of the basic inventive concepts. 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 embodiments of the present invention.
[0181] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0182] The above is a detailed introduction to an efficient DNA storage method and system based on a hybrid coding strategy provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. An efficient DNA storage method based on a hybrid coding strategy, characterized in that: The method comprises: Performing statistical analysis on the raw data to be stored to obtain data attributes, including: data type, data size, and data distribution; Determining a coding algorithm and parameter settings of a hybrid encoder according to the data attributes and coding requirements, wherein the coding algorithm is low-density parity-check coding or polar coding; The original data is converted into binary data, and the binary data is divided and block-encoded according to a preset DNA sequence length, an encoding algorithm and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy, including: dividing the binary data according to a first number of input characters of the hybrid encoder to obtain multiple binary sequences of the first number of lengths; encoding the multiple binary sequences according to the encoding algorithm to obtain encoding sequences of a second number of lengths, where the second number is the number of output characters of the hybrid encoder; and dividing the encoding sequence according to the preset DNA sequence length to obtain a codeword sequence with redundancy; The encoding of the multiple binary sequences according to the coding algorithm to obtain a coded sequence having a second length includes: when the coding algorithm is low-density parity-check coding, sequentially multiplying the multiple binary sequences by a generator matrix of the low-density parity-check coding to generate redundant bits, and obtaining a coded sequence having the second length based on the generated redundant bits; and when the coding algorithm is polarization coding, recursively polarizing the multiple binary sequences according to the generator matrix of the polarization coding to generate a series of synthetic channels, selecting the most reliable channel, and filling the redundant bits with frozen bits of the polarization coding to obtain a coded sequence having the second length. According to a mapping relationship between binary data and four-bit bases, the redundant codeword sequence is converted to obtain a data storage DNA sequence, including: according to the mapping relationship between binary data and four-bit bases, the redundant codeword sequence is converted into an initial DNA sequence; judging whether the initial DNA sequence satisfies constraint conditions, wherein the constraint conditions include: whether the total content of cytosine bases and guanine bases in the initial DNA sequence is within a preset range, and whether the length of a long homopolymer in the initial DNA sequence is less than a length threshold; if the constraint conditions are not satisfied, performing pseudo-random construction on the initial DNA sequence to obtain a data storage DNA sequence that satisfies the constraint, wherein the pseudo-random construction includes: recursively calling a pseudo-random library to perform a sum-product operation on the initial DNA sequence; According to the original data and the hybrid encoder, primers and markers are added to the data storage DNA sequence to obtain a final data storage DNA sequence, including: adding primers to the data storage DNA sequence according to the original data, and adding markers to the data storage DNA sequence according to the pseudo-randomization structure and the hybrid encoder to obtain the final data storage DNA sequence; the primers are used to record information of the DNA sequence storing the original data, and the markers are used to record at least parameter settings of the hybrid encoder.
2. The method according to claim 1, characterized in that The method further comprises: Sequencing the data storage DNA sequence according to the primers of the original data to obtain the target data storage DNA sequence; Obtaining an encoding algorithm and parameter settings of a hybrid encoder according to a marker bit in the target data storage DNA sequence; Converting the target data storage DNA sequence according to the mapping relationship from the four bases to binary data to obtain a plurality of binary codeword sequences; Decoding the plurality of binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data; Convert the binary data into raw data.
3. The method according to claim 2, characterized in that In the case where the target data storage DNA sequence is pseudo-randomly constructed, the target data storage DNA sequence is converted according to the mapping relationship between the four bases and binary data to obtain multiple binary codeword sequences, including: According to the mapping relationship between the four bases and the binary data, the codeword region in the target data storage DNA sequence is converted into a plurality of pseudo-random binary sequences; According to the pseudo-randomization construction, the plurality of pseudo-random binary sequences are converted into a plurality of binary codeword sequences.
4. The method according to claim 2 or 3, characterized in that Decoding the plurality of binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, removing redundant characters in the codewords, and obtaining binary data, including: When the coding algorithm is low-density parity check coding, converting the multiple binary codeword sequences into a first codeword sequence according to the number of output characters of the low-density parity check coding, and performing iterative decoding according to the first codeword sequence and a check matrix of the low-density parity check coding to obtain a binary sequence; When the coding algorithm is polar coding, the multiple binary codeword sequences are converted into second codeword sequences based on the number of output symbols of the polar coding, and the second codeword sequences are sequentially decoded based on a generator matrix and frozen bits of the polar coding to obtain multiple binary sequences.
5. An efficient DNA storage system based on a hybrid coding strategy, characterized in that: The system comprises: An encoding module is configured to perform statistical analysis on the raw data to be stored to obtain data attributes, including data type, data size, and data distribution; determine an encoding algorithm and parameter settings for a hybrid encoder based on the data attributes and encoding requirements, wherein the encoding algorithm is low-density parity-check encoding or polarization encoding; convert the raw data into binary data, and divide and block-encode the binary data based on a preset DNA sequence length, the encoding algorithm, and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy; convert the codeword sequence with redundancy based on a mapping relationship between binary data and four-bit bases to obtain a data storage DNA sequence; and add primers and marker bits to the data storage DNA sequence based on the raw data and the hybrid encoder to obtain a final data storage DNA sequence, wherein the primers are used to record information about the DNA sequence storing the raw data, and the marker bits are used to record at least the parameter settings of the hybrid encoder; The method converts the redundant codeword sequence into an initial DNA sequence according to a mapping relationship between binary data and four-bit bases to obtain a data storage DNA sequence, including: converting the redundant codeword sequence into an initial DNA sequence according to the mapping relationship between binary data and four-bit bases; determining whether the initial DNA sequence satisfies constraints, wherein the constraints include: whether the total content of cytosine bases and guanine bases in the initial DNA sequence is within a preset range, and whether the length of a long homopolymer in the initial DNA sequence is less than a length threshold; and if the constraints are not satisfied, performing pseudo-random construction on the initial DNA sequence to obtain a data storage DNA sequence that satisfies the constraints, wherein the pseudo-random construction includes: recursively calling a pseudo-random library to perform a sum-product operation on the initial DNA sequence; Adding primers and markers to the data storage DNA sequence according to the original data and the hybrid encoder to obtain a final data storage DNA sequence, including: adding primers to the data storage DNA sequence according to the original data, and adding markers to the data storage DNA sequence according to the pseudo-randomization structure and the hybrid encoder to obtain the final data storage DNA sequence; Dividing and block-encoding the binary data according to a preset DNA sequence length, an encoding algorithm, and parameter settings of the hybrid encoder to obtain a codeword sequence with redundancy, including: dividing the binary data according to a first number of input characters of the hybrid encoder to obtain a plurality of binary sequences having a first length; encoding the plurality of binary sequences according to the encoding algorithm to obtain encoding sequences having a second length, where the second length is the number of output characters of the hybrid encoder; and dividing the encoding sequence according to the preset DNA sequence length to obtain a codeword sequence with redundancy; Encoding the multiple binary sequences according to the coding algorithm to obtain a coded sequence having a second length includes: when the coding algorithm is low-density parity check coding, sequentially multiplying the multiple binary sequences by a generator matrix of the low-density parity check coding to generate redundant bits, and obtaining a coded sequence having the second length based on the generated redundant bits; and when the coding algorithm is polarization coding, recursively polarizing the multiple binary sequences according to the polarization coding generator matrix to generate a series of synthetic channels, selecting the most reliable channel, and filling the redundant bits with frozen bits of the polarization coding to obtain a coded sequence having the second length. The decoding module is used to sequence the data storage DNA sequence according to the primer of the original data to obtain a target data storage DNA sequence; obtain the encoding algorithm and parameter settings of the hybrid encoder according to the mark bit in the target data storage DNA sequence; convert the target data storage DNA sequence according to the mapping relationship between the four bases and binary data to obtain multiple binary codeword sequences; decode the multiple binary codeword sequences according to the encoding algorithm and parameter settings of the hybrid encoder, remove redundant characters in the codewords, and obtain binary data; and convert the binary data into original data.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the efficient DNA storage method based on the hybrid coding strategy according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
DNA storage coding method and device based on decimal system, and readable storage medium
CN114974429A
Hybrid system DNA encoding and decoding method and device
CN117577200A