DNA encoding method, decoding method, device, electronic device, and medium
By grouping binary data and encoding and decoding it using a specific mapping table, the error problem during DNA synthesis and sequencing is resolved, achieving high-accuracy DNA storage.
Patent Information
- Application Number
- CN202411475859.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing DNA encoding methods lead to errors or failures in DNA synthesis and sequencing, affecting accuracy.
By grouping binary data, different mapping tables are used to encode the binary data groups into base units, and during the synthesis process, GC content balance is ensured and long repeated bases are avoided. The first and second mapping tables are used to handle the cases where the binary bits are 0 and 1, respectively.
It improves the accuracy of DNA synthesis and sequencing, ensures the GC content in the base sequence is 50%, avoids long repeated bases, and improves the reliability of DNA synthesis and sequencing.
Smart Images

Figure CN119446270B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data storage technology, and in particular to a DNA encoding method, decoding method, device, electronic device and storage medium. Background Art
[0002] Data storage underpins the operation of computer and information technology. Computers need access to data to run programs and perform operations, and the application of information technology is inseparable from large amounts of data. Today, with the rapid development of information and network technologies, human society generates massive amounts of data every day, creating a huge demand for data storage.
[0003] DNA storage technology, as an emerging data storage technology, offers the advantages of high density, long lifespan, and low energy consumption. It is a key technology for solving the data storage challenges currently facing the world, and provides an important direction for researchers to find storage breakthroughs.
[0004] In related technologies, the base sequence obtained by the DNA encoding method may cause errors or failures in the DNA synthesis and sequencing process, affecting the accuracy of DNA synthesis and sequencing. Summary of the Invention
[0005] Based on this, the purpose of this application is to provide a DNA encoding method, decoding method, device, electronic device and storage medium, which can improve the accuracy of DNA synthesis and sequencing.
[0006] According to a first aspect of the embodiments of the present application, a DNA encoding method is provided, comprising the following steps:
[0007] Get the binary data to be encoded;
[0008] Grouping the binary data to obtain a plurality of binary data groups, wherein each binary data group includes 6 binary bits;
[0009] For each binary data group, when the first binary bit of the binary data group is 0, obtaining a preset first mapping table; encoding the binary data group into corresponding base units according to the preset first mapping table; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0010] When the first binary bit of the binary data group is 1, obtaining a preset second mapping table; encoding the binary data group into corresponding base units according to the preset second mapping table; the second mapping table includes a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0011] The base units corresponding to each binary data group are merged to obtain a base sequence corresponding to the binary data.
[0012] According to a second aspect of the embodiments of the present application, a DNA decoding method is provided, comprising the following steps:
[0013] Obtaining a base sequence generated according to the above-mentioned DNA encoding method;
[0014] Divide the base sequence into several base units;
[0015] For each base unit, obtaining a preset mapping table; wherein the preset mapping table includes a first mapping table and a second mapping table;
[0016] Decoding each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table;
[0017] For the binary sequence corresponding to each base unit, when the binary sequence is in the first mapping table, a binary bit 0 is added before the first binary bit in the binary sequence to obtain a binary data group corresponding to the base unit; when the binary sequence is in the second mapping table, a binary bit 1 is added before the first binary bit in the binary sequence to obtain a binary data group corresponding to the base unit;
[0018] The binary data groups corresponding to each base unit are merged to obtain binary data corresponding to the base sequence.
[0019] According to a third aspect of the embodiments of the present application, a DNA encoding device is provided, comprising:
[0020] A binary data acquisition module, used to acquire binary data to be encoded;
[0021] A binary data group obtaining module is used to group the binary data to obtain a plurality of binary data groups; wherein each binary data group includes 6 binary bits;
[0022] a first mapping table acquisition module configured to, for each binary data group, acquire a preset first mapping table when the first binary bit of the binary data group is 0; and encode the binary data group into corresponding base units according to the preset first mapping table; the first mapping table including a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0023] a second mapping table acquisition module, configured to acquire a preset second mapping table when the first binary bit of the binary data group is 1; and encode the binary data group into corresponding base units according to the preset second mapping table; the second mapping table including a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0024] The base sequence acquisition module is used to merge the base units corresponding to each binary data group to obtain the base sequence corresponding to the binary data.
[0025] According to a fourth aspect of the embodiments of the present application, there is provided a DNA decoding device, comprising:
[0026] A base sequence acquisition module, used to obtain the base sequence generated according to the above-mentioned DNA encoding method;
[0027] A base sequence segmentation module, used to segment the base sequence into several base units;
[0028] A mapping table acquisition module, configured to acquire a preset mapping table for each base unit; wherein the preset mapping table includes a first mapping table and a second mapping table;
[0029] A base unit decoding module, configured to decode each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table;
[0030] a binary data group obtaining module, configured to, for each binary sequence corresponding to a base unit, add a binary bit 0 before the first binary bit in the binary sequence when the binary sequence is in the first mapping table to obtain the binary data group corresponding to the base unit; and add a binary bit 1 before the first binary bit in the binary sequence when the binary sequence is in the second mapping table to obtain the binary data group corresponding to the base unit;
[0031] The binary data acquisition module is used to merge the binary data groups corresponding to each base unit to obtain binary data corresponding to the base sequence.
[0032] According to a fifth aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method of the first aspect or the second aspect.
[0033] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the method of the first aspect or the second aspect are implemented.
[0034] The embodiment of the present application obtains binary data to be encoded; groups the binary data to obtain several binary data groups; wherein each binary data group includes 6 binary bits; for each binary data group, when the first binary bit of the binary data group is 0, obtains a preset first mapping table; according to the preset first mapping table, encodes the binary data group into corresponding base units; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit; when the first binary bit of the binary data group is 1, obtains a preset second mapping table; according to the preset second mapping table, encodes the binary data group into corresponding base units; the second mapping table includes a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit; and merges the base units corresponding to each binary data group to obtain a base sequence corresponding to the binary data. The present application groups the binary data to be encoded, selects the corresponding mapping table according to the value of the first binary bit of the binary data group, and encodes the binary data group into corresponding base units. The GC content of the base sequence after the base units are merged strictly meets the GC balance requirement, with a GC content of 50%. At the same time, the maximum length of the same continuous base subsequence in the base sequence is only 2 bases, avoiding the influence of long repeated bases in the base sequence and the extreme GC content in the base sequence during DNA synthesis and sequencing, thereby improving the accuracy of the base sequence during DNA synthesis and sequencing.
[0035] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0036] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of a DNA encoding method according to one embodiment of the present application;
[0038] Figure 2 A schematic diagram of a DNA decoding method according to an embodiment of the present application;
[0039] Figure 3 A structural block diagram of a DNA encoding device provided in one embodiment of the present application;
[0040] Figure 4 A structural block diagram of a DNA decoding device provided in one embodiment of the present application;
[0041] Figure 5 A schematic block diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
[0043] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0044] The terms used in the embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit the embodiments of the present application. The singular forms "a," "the," and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0045] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0046] In addition, in this application, unless otherwise specified, "plurality" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0047] See also Figure 1 , which is a flow chart of a DNA encoding method provided in one embodiment of the present application. The DNA encoding method provided in the embodiment of the present application comprises the following steps:
[0048] S10: Obtain binary data to be encoded.
[0049] Among them, binary data is the underlying representation of files on a computer, consisting of 0 and 1. Any file stored on a computer has unique binary data.
[0050] In an embodiment of the present application, binary data input by the user can be obtained, and original data such as audio, video, and documents input by the user can also be obtained, and the original data can be converted into binary data.
[0051] S20: Grouping the binary data to obtain a plurality of binary data groups; wherein each binary data group includes 6 binary bits.
[0052] In an embodiment of the present application, the binary data is divided into a group of a certain number of binary bits, so that the binary data includes a plurality of binary data groups. Specifically, the binary data is divided into a group of 6 binary bits to obtain a plurality of binary data groups. Each binary data group can be numbered according to the order of the position of the binary data group in the binary data, and the numbers are 1, 2, 3, ..., N. For example, the binary data "001010011100101001 ... 110100 ... 010011" corresponds to the binary data groups: 001010 (number 1), 011100 (number 2), 101001 (number 3), ..., 110100 (number i), ..., 010011 (number N).
[0053] S30: For each binary data group, when the first binary bit of the binary data group is 0, obtain a preset first mapping table; according to the preset first mapping table, encode the binary data group into corresponding base units; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit.
[0054] The base unit includes several bases, and there are four types of bases: guanine (G), cytosine (C), adenine (A) and thymine (T).
[0055] In the preset first mapping table, a binary sequence corresponds to a unique base unit. The binary sequence includes 5 binary bits. The GC content of each base unit in the preset first mapping table is 50%, and there is at most one repeated base (A, T, G, or C).
[0056] In an embodiment of the present application, when encoding a binary data group, the first binary bit of the binary data group is first identified. When the first binary bit of the binary data group is 0, the base unit corresponding to the binary sequence from the second binary bit to the sixth binary bit of the binary data group is searched from a preset first mapping table.
[0057] S40: When the first binary bit of the binary data group is 1, obtain a preset second mapping table; according to the preset second mapping table, encode the binary data group into corresponding base units; the second mapping table includes a second mapping relationship between the binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit.
[0058] In the preset second mapping table, a binary sequence corresponds to a unique base unit. The binary sequence includes 5 binary bits. The GC content of each base unit in the preset second mapping table is 50%, and there are only two repeated bases (AA or TT or GG or GC).
[0059] In an embodiment of the present application, when encoding a binary data group, the first binary bit of the binary data group is first identified. When the first binary bit of the binary data group is 1, the base unit corresponding to the binary sequence from the second binary bit to the sixth binary bit of the binary data group is obtained from the preset second mapping table.
[0060] S50: Merge the base units corresponding to each binary data group to obtain a base sequence corresponding to the binary data.
[0061] In this embodiment of the present application, the base units corresponding to each binary data group are spliced together according to the binary data group numbering from smallest to largest to obtain a base sequence corresponding to the binary data. Since the base units obtained according to the first mapping table have at most only one repeated base, their GC content is 50%. The base units obtained according to the first mapping table have at most only two repeated bases, their GC content is 50%. Therefore, the base sequence obtained by splicing multiple base units also has at most only two repeated bases, and their GC content is also 50%.
[0062] An embodiment of the present application is applied, by obtaining binary data to be encoded; grouping the binary data to obtain several binary data groups; wherein each binary data group includes 6 binary bits; for each binary data group, when the first binary bit of the binary data group is 0, obtaining a preset first mapping table; according to the preset first mapping table, encoding the binary data group into corresponding base units; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit; when the first binary bit of the binary data group is 1, obtaining a preset second mapping table; according to the preset second mapping table, encoding the binary data group into corresponding base units; the second mapping table includes a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit; merging the base units corresponding to each binary data group to obtain a base sequence corresponding to the binary data. The present application groups the binary data to be encoded, selects the corresponding mapping table according to the value of the first binary bit of the binary data group, and encodes the binary data group into corresponding base units. The GC content of the base sequence after the base units are merged strictly meets the GC balance requirement, with a GC content of 50%. At the same time, the maximum length of the same continuous base subsequence in the base sequence is only 2 bases, avoiding the influence of long repeated bases in the base sequence and the extreme GC content in the base sequence during DNA synthesis and sequencing, thereby improving the accuracy of the base sequence during DNA synthesis and sequencing.
[0063] In an optional embodiment, step S10 includes steps S101 to S102, which are specifically as follows:
[0064] S101: Obtain original data to be encoded.
[0065] Among them, the execution subject of the DNA encoding method can be a DNA encoding device, which includes but is not limited to computers, tablets, and mobile phones.
[0066] In the embodiment of the present application, the original data to be encoded includes but is not limited to files, photos, and audio and video data.
[0067] S102: Convert the original data into binary data.
[0068] In the embodiment of the present application, the original data is stored as electronic data in a digitized form to obtain data in a binary format.
[0069] By converting the original data into a binary format, the binary data to be encoded can be obtained automatically and quickly.
[0070] In an optional embodiment, the step of obtaining the preset first mapping table in step S30 includes step S301, which is specifically as follows:
[0071] S301: Constructing a first mapping table according to a first mapping relationship between a binary sequence and a base unit; wherein the binary sequence includes 5 binary bits, the base unit includes 4 bases, and adenine and thymine are spaced apart from each other, or guanine and cytosine are spaced apart from each other in the 4 bases.
[0072] In the embodiment of the present application, the specific form of the first mapping relationship between the binary sequence and the base unit is as follows:
[0073] 00000<-->ACAC, 00001<-->ACAG, 00010<-->ACTC, 00011<-->ACTG, 00100<-->AGAC, 00101<-->AGAG, 00110<-->AGTC, 00111<-->AGTG;
[0074] 01000<-->TCAC, 01001<-->TCAG, 01010<-->TCTC, 01011<-->TCTG, 01100<-->TGAC, 01101<-->TGAG, 01110<-->TGTC, 01111<-->TGTG;
[0075] 10000<-->GACA, 10001<-->GACT, 10010<-->GAGA, 10011<-->GAGT, 10100<-->GTCA, 10101<-->GTCT, 10110<-->GTGA, 10111<-->GTGT;
[0076] 11000<-->CACA, 11001<-->CACT, 11010<-->CAGA, 11011<-->CAGT, 11100<-->CTCA, 11101<-->CTCT, 11110<-->CTGA, 11111<-->CTGT.
[0077] Among them, <--> is a mapping symbol, the left side of the symbol is a binary sequence of length 5, and the right side is a base unit of length 4.
[0078] Because the four bases in each base unit in the first mapping table only contain two CCs, two GGs, or one C and one G, the GC content in each base unit is 50%, meeting the GC balance requirement. Furthermore, because {A, T} and {G, C} alternate within the four bases in each base unit, each base unit contains at most one repeated base, with no consecutive AA, TT, CC, or GG sequences. This prevents long base repeats and improves the accuracy of subsequent DNA synthesis and sequencing.
[0079] In an optional embodiment, the step of obtaining the preset second mapping table in step S40 includes step S401, which is specifically as follows:
[0080] S401: Construct a second mapping table based on a second mapping relationship between a binary sequence and a base unit; wherein the binary sequence includes 5 binary bits, the base unit includes 4 bases, and in the 4 bases, adenine and thymine are adjacent, and guanine and cytosine are located on both sides, or guanine and cytosine are adjacent, and adenine and thymine are located on both sides.
[0081] In the embodiment of the present application, the specific form of the second mapping relationship between the binary sequence and the base unit is as follows:
[0082] 00000<-->ACCA, 00001<-->ACCT, 00010<-->ACGA, 00011<-->ACGT, 00100<-->AGCA, 00101<-->AGCT, 00110<-->AGGA, 00111<-->AGGT;
[0083] 01000<-->TCCA, 01001<-->TCCT, 01010<-->TCGA, 01011<-->TCGT, 01100<-->TGCA, 01101<-->TGCT, 01110<-->TGGA, 01111<-->TGGT;
[0084] 10000<-->GAAC, 10001<-->GAAG, 10010<-->GATC, 10011<-->GATG, 10100<-->GTAC, 10101<-->GTAG, 10110<-->GTTC, 10111<-->GTTG;
[0085] 11000<-->CAAC, 11001<-->CAAG, 11010<-->CATC, 11011<-->CATG, 11100<-->CTAC, 11101<-->CTAG, 11110<-->CTTC, 11111<-->CTTG.
[0086] Among them, <--> is a mapping symbol, the left side of the symbol is a binary sequence of length 5, and the right side is a base unit of length 4.
[0087] Because each base unit in the second mapping table contains only two CCs, two GGs, or one C and one G, the GC content of each base unit is 50%, meeting the GC balance requirement. Furthermore, because each base unit contains either {A, T} and {A, T} adjacent to each other, or {G, C} and {G, C} adjacent to each other, each base unit contains at most two repeated bases, avoiding the occurrence of long base repeats and improving the accuracy of subsequent DNA molecule synthesis and sequencing.
[0088] In an optional embodiment, after step S50, step S501 is included, which is specifically as follows:
[0089] S501: Using DNA synthesis technology, the base sequence is synthesized into a DNA molecule.
[0090] Among them, DNA synthesis technology refers to a method of artificially connecting deoxynucleotides one by one to synthesize DNA chains based on the principle of complementary base pairing of DNA, that is, A pairs with T and G pairs with C.
[0091] In the embodiments of the present application, after the base sequence is obtained, the base sequence can be synthesized into a DNA molecule through DNA synthesis technology to facilitate subsequent DNA sequencing.
[0092] By synthesizing base sequences into DNA molecules, encoded binary data storage can be achieved, saving data storage space.
[0093] See also Figure 2 , which is a flow chart of a DNA decoding method provided in one embodiment of the present application. The DNA decoding method provided in the embodiment of the present application comprises the following steps:
[0094] S100: Acquire a base sequence generated according to the above-mentioned DNA encoding method.
[0095] The execution subject of the DNA decoding method may be a DNA decoding device, which includes but is not limited to a computer, a tablet, a mobile phone, etc.
[0096] In the embodiments of the present application, the base sequence can be obtained by sequencing the DNA molecules generated by the DNA encoding method using DNA sequencing technology, or the base sequence generated by the DNA encoding method can be directly obtained.
[0097] S200: Divide the base sequence into several base units.
[0098] In an embodiment of the present application, the base sequence can be divided into groups of a certain number of bases to obtain a number of base units. Specifically, the base sequence can be divided into groups of 4 bases to obtain a number of base units, and each base unit is numbered according to the order of the base unit's position in the base sequence, and the numbers are 1, 2, 3, ..., N. For example, the base sequence "TCTCGTCATCCT...CTAC...CAGT" corresponds to the base units: TCTC (number 1), GTCA (number 2), TCCT (number 3), ..., CTAC (number i), ..., CAGT (number N).
[0099] S300: For each base unit, obtain a preset mapping table; wherein the preset mapping table includes a first mapping table and a second mapping table.
[0100] In the embodiment of the present application, the first mapping table and the second mapping table are consistent with the mapping tables in the aforementioned steps S30 and S40, and are not described again here.
[0101] S400: Decode each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table.
[0102] In this embodiment of the present application, each base unit is matched with the base units in the first mapping table and the second mapping table. If a matching base unit is found, the binary sequence corresponding to the base unit is obtained. The binary sequence consists of 5 binary bits. For example, the binary sequence corresponding to the base unit "TCTC" is "01010", and the binary sequence corresponding to the base unit "TCCT" is "01001".
[0103] S500: For the binary sequence corresponding to each base unit, when the binary sequence is in the first mapping table, add binary bit 0 before the first binary bit in the binary sequence to obtain the binary data group corresponding to the base unit; when the binary sequence is in the second mapping table, add binary bit 1 before the first binary bit in the binary sequence to obtain the binary data group corresponding to the base unit.
[0104] In this embodiment of the present application, when the base unit to be decoded is the same as a base unit in the first mapping table, the binary sequence corresponding to the base unit to be decoded is found in the first mapping table, and a binary bit 0 is added before the first binary bit of the binary sequence to obtain 6 binary bits. These 6 binary bits are used as the binary data group after decoding the base unit to be decoded. For example, the binary data group corresponding to the base unit "TCTC" is "001010".
[0105] When the base unit to be decoded is the same as a base unit in the second mapping table, the binary sequence corresponding to the base unit to be decoded is found in the second mapping table. The binary bit 1 is added before the first binary bit of the binary sequence to obtain 6 binary bits. These 6 binary bits are used as the binary data group after decoding the base unit to be decoded. For example, the binary data group corresponding to the base unit "TCCT" is "101001".
[0106] S600: Merge the binary data groups corresponding to each base unit to obtain binary data corresponding to the base sequence.
[0107] In this embodiment, the binary data groups corresponding to each base unit are concatenated in ascending order of base unit number to obtain the binary data corresponding to the base sequence. For example, the base sequence "TCTCGTCATCCT...CTAC...CAGT" corresponds to the binary data "001010011100101001...110100...010011".
[0108] The above-mentioned DNA decoding method corresponds to the aforementioned DNA encoding method, and can decode the base sequence generated by the DNA encoding method and restore it to binary data, thereby realizing the reading of binary data.
[0109] The following are embodiments of the apparatus of the present application, which can be used to execute the contents of the method in the embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the contents of the method in the embodiments of the present application.
[0110] See Figure 3 , which shows a schematic diagram of the structure of the DNA encoding device provided in an embodiment of the present application. The DNA encoding device 6 provided in an embodiment of the present application includes:
[0111] A binary data acquisition module 61 is used to acquire binary data to be encoded;
[0112] A binary data group obtaining module 62 is used to group the binary data to obtain a plurality of binary data groups; wherein each binary data group includes 6 binary bits;
[0113] A first mapping table acquisition module 63 is configured to, for each binary data group, acquire a preset first mapping table when the first binary bit of the binary data group is 0; encode the binary data group into corresponding base units according to the preset first mapping table; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0114] A second mapping table acquisition module 64 is configured to acquire a preset second mapping table when the first binary bit of the binary data group is 1; encode the binary data group into corresponding base units according to the preset second mapping table; the second mapping table includes a second mapping relationship between the binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units;
[0115] The base sequence obtaining module 65 is used to combine the base units corresponding to each binary data group to obtain a base sequence corresponding to the binary data.
[0116] It should be noted that the DNA encoding device provided in the above embodiments, when executing the DNA encoding method, is merely illustrated by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the DNA encoding device and the DNA encoding method provided in the above embodiments are based on the same concept. The implementation process is detailed in the method embodiments and will not be further described here.
[0117] See Figure 4 , which shows a schematic diagram of the structure of the DNA decoding device provided in an embodiment of the present application. The DNA decoding device 7 provided in an embodiment of the present application includes:
[0118] A base sequence acquisition module 71 is used to obtain a base sequence generated according to the above-mentioned DNA encoding method;
[0119] A base sequence segmentation module 72 is used to segment the base sequence into a plurality of base units;
[0120] A mapping table acquisition module 73 is configured to acquire a preset mapping table for each base unit; wherein the preset mapping table includes a first mapping table and a second mapping table;
[0121] A base unit decoding module 74 is configured to decode each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table;
[0122] The binary data group obtaining module 75 is configured to, for each binary sequence corresponding to a base unit, add a binary bit 0 before the first binary bit in the binary sequence when the binary sequence is in the first mapping table to obtain the binary data group corresponding to the base unit; and add a binary bit 1 before the first binary bit in the binary sequence when the binary sequence is in the second mapping table to obtain the binary data group corresponding to the base unit;
[0123] The binary data obtaining module 76 is used to merge the binary data groups corresponding to each base unit to obtain binary data corresponding to the base sequence.
[0124] It should be noted that the DNA decoding device provided in the above embodiments, when executing the DNA encoding method, is merely illustrated by the division of the aforementioned functional modules. In actual applications, the aforementioned functions can be assigned to different functional modules as needed, i.e., the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. Furthermore, the DNA encoding device and the DNA encoding method provided in the above embodiments are based on the same concept. The implementation process is detailed in the method embodiments and will not be further described here.
[0125] The following are embodiments of the device of the present application, which can be used to perform the content of the method in the embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the content of the method in the embodiment of the present application.
[0126] See also Figure 5 The present application also provides an electronic device 300, which may be a computer, a mobile phone, a tablet computer, etc. In an exemplary embodiment of the present application, the electronic device 300 is a computer, which may include: at least one processor 301, at least one memory 302, at least one display, at least one network interface 303, a user interface 304, and at least one communication bus 305.
[0127] The user interface 304 is mainly used to provide an input interface for the user and obtain data input by the user. Optionally, the user interface can also include a standard wired interface or a wireless interface.
[0128] The network interface 303 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0129] The communication bus 305 is used to realize the connection and communication between these components.
[0130] Among them, the processor 301 may include one or more processing cores. The processor uses various interfaces and lines to connect the various parts of the entire electronic device, and performs various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in the form of at least one hardware of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or more combinations of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; and the modem is used to handle wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor and may be implemented separately through a chip.
[0131] Among them, the memory 302 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory can be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory may also be optionally at least one storage device located away from the aforementioned processor. As Figure 3 , as a computer storage medium, the memory may include an operating system, a network communication module, a user interface module, and an operating application.
[0132] The processor can be used to call the application programs of the DNA encoding method and the DNA decoding method stored in the memory, and specifically execute the method steps of the above-mentioned embodiment. The specific execution process can be referred to the specific description shown in the embodiment, which will not be repeated here.
[0133] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0134] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A DNA encoding method, characterized in that: The method comprises the following steps: Get the binary data to be encoded; Grouping the binary data to obtain a plurality of binary data groups; wherein each binary data group includes 6 binary bits; For each binary data group, when the first binary bit of the binary data group is 0, obtaining a preset first mapping table; encoding the binary data group into corresponding base units according to the preset first mapping table; the first mapping table includes a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units; When the first binary bit of the binary data group is 1, obtaining a preset second mapping table; encoding the binary data group into corresponding base units according to the preset second mapping table; the second mapping table includes a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units; The base units corresponding to each of the binary data groups are merged to obtain a base sequence corresponding to the binary data.
2. The DNA encoding method according to claim 1, wherein: The step of obtaining a preset first mapping table includes: A first mapping table is constructed according to a first mapping relationship between a binary sequence and a base unit, wherein the binary sequence includes 5 binary bits, the base unit includes 4 bases, and adenine and thymine are spaced apart from each other, or guanine and cytosine are spaced apart from each other in the 4 bases.
3. The DNA encoding method according to claim 1, wherein: The step of obtaining the preset second mapping table includes: A second mapping table is constructed according to a second mapping relationship between the binary sequence and the base unit; wherein the binary sequence includes 5 binary bits, the base unit includes 4 bases, and in the 4 bases, adenine and thymine are adjacent, and guanine and cytosine are located on both sides, or guanine and cytosine are adjacent, and adenine and thymine are located on both sides.
4. The DNA encoding method according to any one of claims 1 to 3, characterized in that: The step of obtaining the binary data to be encoded includes: Get the original data to be encoded; The raw data is converted into binary data.
5. The DNA encoding method according to any one of claims 1 to 3, characterized in that: After the step of merging the base units corresponding to each of the binary data groups to obtain a base sequence corresponding to the binary data, the method further includes: The base sequence is synthesized into a DNA molecule using DNA synthesis technology.
6. A DNA decoding method, characterized in that: The method comprises the following steps: Obtaining a base sequence generated by the DNA encoding method according to any one of claims 1 to 4; dividing the base sequence into a plurality of base units; For each of the base units, obtaining a preset mapping table; wherein the preset mapping table includes a first mapping table and a second mapping table; Decoding each of the base units into a corresponding binary sequence according to the first mapping table and the second mapping table; For each binary sequence corresponding to the base unit, when the binary sequence is in the first mapping table, a binary bit 0 is added before the first binary bit in the binary sequence to obtain a binary data group corresponding to the base unit; when the binary sequence is in the second mapping table, a binary bit 1 is added before the first binary bit in the binary sequence to obtain a binary data group corresponding to the base unit; The binary data groups corresponding to each of the base units are merged to obtain binary data corresponding to the base sequence.
7. A DNA encoding device, characterized in that include: A binary data acquisition module, used to acquire binary data to be encoded; a binary data group obtaining module, configured to group the binary data to obtain a plurality of binary data groups, wherein each binary data group includes 6 binary bits; a first mapping table acquisition module configured to, for each binary data group, acquire a preset first mapping table when the first binary bit of the binary data group is 0; and encode the binary data group into corresponding base units according to the preset first mapping table; the first mapping table including a first mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units; a second mapping table acquisition module, configured to, when the first binary bit of the binary data group is 1, acquire a preset second mapping table; and encode the binary data group into corresponding base units according to the preset second mapping table; wherein the second mapping table includes a second mapping relationship between a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base units; The base sequence obtaining module is used to merge the base units corresponding to each of the binary data groups to obtain a base sequence corresponding to the binary data.
8. A DNA decoding device, characterized in that: include: a base sequence acquisition module, configured to acquire a base sequence generated by the DNA encoding method according to any one of claims 1 to 4; A base sequence segmentation module, configured to segment the base sequence into a plurality of base units; A mapping table acquisition module, configured to acquire a preset mapping table for each base unit; wherein the preset mapping table includes a first mapping table and a second mapping table; a base unit decoding module, configured to decode each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table; a binary data group obtaining module, configured to, for each binary sequence corresponding to the base unit, add a binary bit 0 before the first binary bit in the binary sequence when the binary sequence is in the first mapping table to obtain the binary data group corresponding to the base unit; and add a binary bit 1 before the first binary bit in the binary sequence when the binary sequence is in the second mapping table to obtain the binary data group corresponding to the base unit; The binary data acquisition module is used to merge the binary data groups corresponding to each base unit to obtain binary data corresponding to the base sequence.
9. An electronic device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the DNA encoding method according to any one of claims 1 to 6 or the DNA decoding method according to claim 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the DNA encoding method according to any one of claims 1 to 6 or the DNA decoding method according to claim 7 are implemented.
Citation Information
Patent Citations
Coding method and coding device for DNA storage
CN114822695A
Double-rule coding DNA storage method for controlling GC content based on chaotic mapping
CN117542420A