DNA coding method and device, DNA decoding method and device, electronic equipment and medium
By grouping and mapping table selection methods of binary data, encoding and merging DNA base sequences, the problem of high error rates in DNA synthesis and sequencing is solved, and higher accuracy and GC balance are achieved.
Patent Information
- Application Number
- CN202411475859.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-22
AI Technical Summary
Existing DNA encoding methods are prone to errors or failures during DNA synthesis and sequencing, which affects the accuracy.
By grouping the binary data to be encoded, each group of 6 binary bits, selecting the preset first or second mapping table based on the first binary bit, encode the binary data group into base units, and merge into base sequences . This method ensures that the GC content of the base sequence is 50%, avoids long repeat bases and extreme GC content, and improves the accuracy of DNA synthesis and sequencing.
It improves the accuracy of DNA synthesis and sequencing, ensures GC balance of base sequences and lacks long repeat bases, and reduces the error rate during DNA synthesis and sequencing.
Smart Images

Figure CN119446270A_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 supports the operation of computer technology and information technology. Computers need to access data to run programs and perform operations, and the application of information technology cannot be separated from large amounts of data. Today, with the rapid development of information and network technology, human society generates massive amounts of data every day, and there is a huge demand for data storage.
[0003] As an emerging data storage technology, DNA storage technology has the advantages of high density, long life and low energy consumption. It is an important key technology for solving the data storage problems facing the world today and provides an important direction for researchers to find storage breakthroughs.
[0004] In the related art, 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 the present 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, a preset first mapping table is obtained; according to the preset first mapping table, the binary data group is encoded 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;
[0010] When the first binary bit of the binary data group is 1, a preset second mapping table is obtained; according to the preset second mapping table, the binary data group is encoded 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;
[0011] The base units corresponding to each binary data group are combined to obtain a base sequence corresponding to the binary data.
[0012] According to a second aspect of the embodiment 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, a preset mapping table is obtained; 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 an embodiment 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, used for grouping 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 is used to acquire a preset first mapping table for each binary data group when the first binary bit of the binary data group is 0; according to the preset first mapping table, the binary data group is encoded 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;
[0023] A second mapping table acquisition module is used to acquire a preset second mapping table when the first binary bit of the binary data group is 1; according to the preset second mapping table, the binary data group is encoded 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;
[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 an embodiment of the present application, a DNA decoding device is provided, comprising:
[0026] A base sequence acquisition module, used to acquire a base sequence generated according to the above-mentioned DNA encoding method;
[0027] A base sequence segmentation module, used for segmenting the base sequence into a number of base units;
[0028] A mapping table acquisition module, used 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, used for decoding 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, for a binary sequence corresponding to each base unit, when the binary sequence is in the first mapping table, adding a binary bit 0 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, adding a binary bit 1 before the first binary bit in the binary sequence to obtain a 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, there is provided an electronic device, 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 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, 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, encodes the binary data group into corresponding base units, and the GC content of the base sequence after the base units are merged strictly meets the GC balance requirement, and the GC content is 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 provided in one embodiment of the present application;
[0038] Figure 2 A schematic diagram of a DNA decoding method provided in one 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 for one embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0043] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0044] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" 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 other meanings. 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 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 attached 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 do not have to be 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 the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0047] See also Figure 1 , which is a schematic diagram of a DNA encoding method provided in one embodiment of the present application. The DNA encoding method provided in an 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 a user may be obtained, or original data such as audio, video, and documents input by a user may be obtained, and the original data may 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 according to a certain number of binary bits, so that the binary data includes several binary data groups. Specifically, the binary data is divided according to 6 binary bits to obtain several 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 only one repeated base (A or T or G or C) at most.
[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 obtained 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 2 repeated bases (AA or TT or GG or GC) at most.
[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 a 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 the embodiment of the present application, the base units corresponding to each binary data group are spliced from small to large according to the number of the binary data group to obtain a base sequence corresponding to the binary data. Among them, since the base unit obtained according to the first mapping table has only one repeated base at most, the GC content is 50%. The base unit obtained according to the first mapping table has only two repeated bases at most, and the GC content is 50%. Therefore, the base sequence obtained by splicing multiple base units also has only two repeated bases at most, and the GC content is also 50%.
[0062] By applying the embodiment of the present application, binary data to be encoded is obtained; the binary data is grouped 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, a preset first mapping table is obtained; according to the preset first mapping table, the binary data group is encoded 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, a preset second mapping table is obtained; according to the preset second mapping table, the binary data group is encoded 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; the base units corresponding to each binary data group are merged 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, encodes the binary data group into corresponding base units, and the GC content of the base sequence after the base units are merged strictly meets the GC balance requirement, and the GC content is 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 executor of the DNA encoding method can be a DNA encoding device, and the DNA encoding device includes but is not limited to a computer, a tablet, a mobile phone, etc.
[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 a 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 with a length of 5, and the right side is a base unit with a length of 4.
[0078] Since the 4 bases of each base unit in the first mapping table only contain 2 CCs or 2 GGs or 1 C and 1 G, the GC content in each base unit is 50%, which meets the GC balance requirement. In addition, since {A, T} and {G, C} appear alternately in the 4 bases of each base unit, there is only one repeated base in each base unit at most, and there will be no continuous AA or TT or CC or GG, which avoids the appearance of long repeated bases and improves the accuracy of subsequent DNA molecule synthesis and sequencing.
[0079] In an optional embodiment, the step of obtaining a preset second mapping table in step S40 includes step S401, which is specifically as follows:
[0080] S401: constructing a second mapping table 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.
[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 with a length of 5, and the right side is a base unit with a length of 4.
[0087] Since the 4 bases of each base unit in the second mapping table only contain 2 CCs or 2 GGs or 1 C and 1 G, the GC content in each base unit is 50%, which meets the GC balance requirement. In addition, since {A, T} and {A, T} appear adjacent to each other, or {G, C} and {G, C} appear adjacent to each other in the 4 bases of each base unit, there are at most 2 repeated bases in each base unit, which avoids the appearance of long repeated bases and improves 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 and T pairing, and G and C pairing.
[0091] In the embodiment 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 an embodiment of the present application comprises the following steps:
[0094] S100: Obtaining 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 DNA molecules generated by the DNA encoding method can be sequenced by DNA sequencing technology to obtain the base sequence. The base sequence generated by the DNA encoding method can also be directly obtained.
[0097] S200: Divide the base sequence into a plurality of base units.
[0098] In the embodiment of the present application, the base sequence can be divided into a group 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 position of the base unit in the base sequence, and the numbers are 1, 2, 3, ..., N. For example, the base units corresponding to the base sequence "TCTCGTCATCCT...CTAC...CAGT" are: 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 of the aforementioned steps S30 and S40, and are not described again herein.
[0101] S400: Decode each base unit into a corresponding binary sequence according to the first mapping table and the second mapping table.
[0102] In the 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 consistent base unit is matched, the binary sequence corresponding to the base unit is obtained. The binary sequence includes 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 the 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, which 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, and a binary bit 1 is added before the first binary bit of the binary sequence to obtain 6 binary bits, which 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: merging the binary data groups corresponding to each base unit to obtain binary data corresponding to the base sequence.
[0107] In the embodiment of the present application, the binary data group corresponding to each base unit is spliced from small to large according to the 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 is an embodiment of the device of the present application, which can be used to execute 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.
[0110] See also Figure 3 , which shows a schematic diagram of the structure of the DNA encoding device provided in the embodiment of the present application. The DNA encoding device 6 provided in the embodiment of the present application includes:
[0111] A binary data acquisition module 61, 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 used for acquiring a preset first mapping table for each binary data group when the first binary bit of the binary data group is 0; 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 unit;
[0114] A second mapping table acquisition module 64 is used 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 a binary sequence from the second binary bit to the sixth binary bit in the binary data group and the base unit;
[0115] The base sequence obtaining module 65 is used to merge 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 embodiment only uses the division of the above functional modules as an example when executing the DNA encoding method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the DNA encoding device and the DNA encoding method provided in the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0117] See also Figure 4 , which shows a schematic diagram of the structure of a DNA decoding device provided in an embodiment of the present application. The DNA decoding device 7 provided in an embodiment of the present application comprises:
[0118] A base sequence acquisition module 71, used to acquire a base sequence generated according to the above-mentioned DNA encoding method;
[0119] A base sequence segmentation module 72, used for segmenting the base sequence into a plurality of base units;
[0120] A mapping table acquisition module 73 is used 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, 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 used for, for the binary sequence corresponding to each base unit, when the binary sequence is in the first mapping table, adding a 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, adding a binary bit 1 before the first binary bit in the binary sequence to obtain the binary data group corresponding to the base unit;
[0123] The binary data acquisition 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 embodiment only uses the division of the above functional modules as an example when executing the DNA encoding method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the DNA encoding device and the DNA encoding method provided in the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0125] The following is an embodiment of the device of the present application, which can be used to execute 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 may 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 various parts of the entire electronic device, and executes 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 at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor can integrate one or more combinations of central processing unit (Central Processing Unit, CPU), image processor (Graphics Processing Unit, GPU) and modem. Among them, the CPU mainly processes the operating system, user interface and application program, etc.; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; the modem is used to process wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented by a single chip.
[0131] Among them, the memory 302 may include a random access memory (Random Access Memory, RAM) and may also include 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 method embodiments, etc.; the data storage area may store data involved in the above-mentioned 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 program.
[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 refer to the specific description shown in the embodiment, which will not be repeated here.
[0133] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0134] The above are only 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 modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should 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 of the binary data groups includes 6 binary bits; For each of the binary data groups, 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 unit; 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 unit; The base units corresponding to each of the binary data groups are combined to obtain a base sequence corresponding to the binary data.
2. The DNA encoding method according to claim 1, characterized in that: 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, characterized in that: The step of obtaining a 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 comprises: Obtaining 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 comprises: 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, a preset mapping table is obtained; wherein the preset mapping table includes a first mapping table and a second mapping table; According to the first mapping table and the second mapping table, decoding each base unit into a corresponding binary sequence; 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, used for grouping the binary data to obtain a plurality of binary data groups; wherein each of the binary data groups includes 6 binary bits; A first mapping table acquisition module is used for acquiring a preset first mapping table for each binary data group when the first binary bit of the binary data group is 0; 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 unit; A second mapping table acquisition module is used to acquire a preset second mapping table when the first binary bit of the binary data group is 1; according to the preset second mapping table, the binary data group is encoded 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; The base sequence acquisition 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, used 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, used for segmenting the base sequence into a plurality of base units; A mapping table acquisition module, used for acquiring 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, for a binary sequence corresponding to each base unit, when the binary sequence is in the first mapping table, adding a 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, adding a binary bit 1 before the first binary bit in the binary sequence 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 of the base units 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 and decoding method and coding and decoding device for binary information to base sequence for DNA data storage
CN112382340A
Coding method and coding device for DNA storage
CN114822695A
Double-rule coding DNA storage method for controlling GC content based on chaotic mapping
CN117542420A
Encoding and decoding method and encoding and decoding device between binary information and base sequence for DNA data storage
WO2022109879A1
DNA encoding method and apparatus, DNA decoding method and apparatus, terminal device, and medium
WO2023173837A1