Robust dna image storage method and system based on parity coding and local mean iteration
Patent Information
- Application Number
- CN202410768995.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2044-06-14
AI Technical Summary
但是现有的DNA存储方式中没有针对于图像数据的存储方案,在处理图像数据时,存在索引错误无法重建图像和图像序列编码质量不足等缺点
[0027]1、本发明在编码之前将数据分为高影响数据和低影响数据,利用rs纠错码对高影响数据进行差错保护;这样就可以提高rs纠错码对图像的保护性能,提高图像重建质量。
Smart Images

Figure CN118733803B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of DNA storage technology, and more specifically to a robust DNA image storage method and system based on parity coding and local mean iteration. Background Technology
[0002] Currently, global demand for data storage exceeds the growth rate of global storage capacity. DNA, as the most abundant storage medium in nature, offers a novel storage solution due to its high storage density and stability. In the 1960s, Neiman et al. first proposed the concept of storing digital information in DNA molecules, but due to limitations in biotechnology, rapid development of DNA storage only began in the early 20th century. Church et al., using next-generation sequencing technology, were the first to store 650KB of data in DNA, verifying that DNA can be stored on a large scale and estimating DNA storage density. Subsequently, Goldman et al. proposed a round-rotation coding method, achieving 739KB of data storage. It is noteworthy that these two storage schemes include multiple data types, demonstrating the practicality of DNA storage. However, existing DNA storage methods lack solutions specifically for image data, and when processing image data, drawbacks include indexing errors preventing image reconstruction and insufficient image sequence encoding quality. Summary of the Invention
[0003] The purpose of this invention is to propose a robust DNA image storage method and system based on parity coding and local mean iteration. The coding sequence satisfies common biochemical constraints, reduces the content of frequently erroneous adjacent bases, and achieves high-quality image reconstruction under arbitrary errors.
[0004] According to a first aspect of the present disclosure, a robust DNA image storage method based on parity coding and local mean iteration is provided, comprising the following steps:
[0005] Image data is stored in a lossless manner, and the image data is converted into pixel value form, and then converted into binary data;
[0006] The binary data is divided into groups of 8 bits each. The first four bits of each group are high-impact data and the last four bits are low-impact data. The RS error correction code is used to protect the high-impact data from errors.
[0007] High-impact data with added error correction codes is converted into binary data, grouped into 16-bit sets, and encoded according to odd and even encoding rules respectively.
[0008] Odd-coded and even-coded data are combined to form new data blocks; the optimal data block is selected based on biochemical constraints and error-prone adjacent bases, and this optimal data block is spliced into a DNA sequence of a set length, with the marker "AC" added at a fixed position in the DNA sequence;
[0009] During decoding, the position of the flag bit is checked. If the position changes, an interruption is inserted or deleted and the index is saved; if the position does not change, the flag bit "AC" is deleted.
[0010] Based on image size and sequence length, erroneous index sequences are filtered to obtain missing sequences. Random data is then added to the missing sequences, and the indexes of the missing sequences are saved.
[0011] By using the index of the lost sequence, the specific location and number of erroneous or lost sequences in the image pixels can be determined;
[0012] Create a window, retrieve all pixels within the potentially erroneous pixel window, and sort them according to their pixel values.
[0013] If the current pixel is between the third and seventh positions in the window (from smallest to largest), the pixel is considered to be without error; otherwise, the average value of the pixels in the window is used to replace the current pixel, and the process is iterated to obtain a relatively correct pixel.
[0014] According to a second aspect of the present disclosure, a robust DNA image storage system based on parity coding and local mean iteration is provided, comprising:
[0015] The conversion module stores image data in a lossless manner, converts the image data into pixel values, and then converts them into binary data.
[0016] Error protection includes dividing binary data into groups of 8 bits, with the first four bits of each group being high-impact data and the last four bits being low-impact data, and using RS error correction codes to protect the high-impact data from errors.
[0017] The encoding module converts high-impact data with error correction codes into binary data, grouping them into 16-bit sets and encoding them according to odd and even encoding rules respectively.
[0018] The identifier addition module combines odd-coded data and even-coded data to form a new data block; the optimal data block is selected based on biochemical constraints and error-prone adjacent bases, and this optimal data block is spliced into a DNA sequence of a set length, with the identifier "AC" added at a fixed position in the DNA sequence;
[0019] The flag bit determination module determines the position of the flag bit during decoding. If the position changes, it inserts or deletes an obstruction and saves the index; if the position does not change, it deletes the flag bit "AC".
[0020] The index acquisition module filters out erroneous index sequences based on image size and sequence length, acquires lost sequences, randomly supplements the lost sequences with data, and saves the index of the lost sequences.
[0021] The module searches for the missing sequence to determine the specific location and number of erroneous or missing sequences within the image pixels using the index of the missing sequence.
[0022] The sorting module creates a window, retrieves all pixels within the potentially erroneous pixel window, and sorts them according to their pixel values.
[0023] The pixel judgment module determines that if the current pixel is between the third and seventh positions in the window (from smallest to largest), the pixel is correct; otherwise, it iterates by replacing the current pixel with the average value of the pixels in the window to obtain a relatively correct pixel.
[0024] According to a third aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the memory, wherein the processor executes the program to implement the robust DNA image storage method based on parity coding and local mean iteration.
[0025] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the robust DNA image storage method based on parity coding and local mean iteration.
[0026] The advantages of the above technical solutions adopted in this invention compared with the prior art are as follows:
[0027] 1. Before encoding, the present invention divides the data into high-impact data and low-impact data, and uses RS error correction codes to protect the high-impact data from errors; this can improve the image protection performance of RS error correction codes and improve the image reconstruction quality.
[0028] 2. During the encoding process, the data is divided into odd and even data, and then mapped using odd encoding rules and even encoding rules respectively. This allows us to select the data blocks that meet the biochemical constraints and have the lowest content of error-prone adjacent bases.
[0029] 3. By utilizing the sequence indexes of missing and erroneous sequences, the location of the erroneous sequence in the image is determined, and image enhancement is performed through iterative local mean averaging. Attached Figure Description
[0030] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.
[0031] Figure 1 The flowchart shows a robust DNA image storage method based on parity coding and local mean iteration.
[0032] Figure 2This is a schematic diagram of the image reconstruction results with 1% random error, where the ratio of insertion, replacement and deletion is 1:1:8. Specific implementation methods
[0033] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0034] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0035] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0036] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of this disclosure. It should be noted that each block in a flowchart or block diagram may represent a module, segment, or portion of code, which may include one or more executable instructions for implementing the logical functions specified in the various embodiments. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutively represented blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, may be implemented using a dedicated hardware-based system that performs the specified functions or operations, or using a combination of dedicated hardware and computer instructions.
[0037] Example 1:
[0038] like Figure 1 As shown, this embodiment provides a robust DNA image storage method based on parity coding and local mean iteration, including the following steps:
[0039] Step 1. Store the image data in a lossless manner, convert the image data into pixel value form, and then convert it into binary data;
[0040] Specifically, the image_to_bit function is used to convert image data into binary data; for example, a 196kb image is converted into 524288 bits of binary data after the above operation.
[0041] Step 2. Divide the binary data into groups of 8 bits each, with the first four bits of each group being high-impact data and the last four bits being low-impact data. Use RS error correction codes to protect the high-impact data from errors.
[0042] Preferably, the division of high-impact data and low-impact data is based on the following: the binary data at different positions in each group accounts for 2% of the pixel value weight. i -1, where i represents the position of the data in the group; the impact of a random one-bit error in the first four bits of data on the pixel is 60.25, which is defined as high-impact data; the impact of a random one-bit error in the last four bits of data on the pixel is 3.75, which is defined as low-impact data.
[0043] Step 3. Convert the high-impact data with error correction codes into binary data, and encode them in groups of 16 bits according to odd and even encoding rules respectively;
[0044] Specifically, in the 16-bit binary data, bits 1-4 and bits 9-12 are encoded according to the odd encoding rule (00-A, 01-T, 10-C, 11-G); for example, the odd data of 0000000011111111 is 00001111, which is mapped to the base position AAGG.
[0045] Bits 5-8 and 13-16 are encoded according to even-number encoding rules; for example, the even-number data of 0000000011111111 is 00001111, and the mapped bases are AAGG, TTAA, CCTT, and GGCC, respectively. The even-number encoding rules include four types: R1, R2, R3, and R4, which are as follows:
[0046] R1:00-A,01-T,10-C,11-G
[0047] R2:00-T,01-C,10-G,11-A
[0048] R3:00-C,01-G,10-A,11-T
[0049] R4:00-G,01-A,10-T,11-C.
[0050] Step 4. Combine odd-coded data and even-coded data to form a new data block; select the optimal data block based on biochemical constraints and error-prone adjacent bases, splice the optimal data block into a DNA sequence of a set length, and add the marker "AC" at a fixed position in the DNA sequence;
[0051] Specifically, based on the example in step 3, the synthesized base blocks are AAAAGGGG, AATTGGAA, AACCGGTT, and AAGGGGCC. The data block that satisfies the biochemical constraints and has the lowest number of error-prone adjacent bases is AACCGGTT.
[0052] Step 5. During decoding, determine the position of the flag bit. If the position changes, insert or delete an interruption and save the index; if the position does not change, delete the flag bit "AC".
[0053] For example, in the sequence "AGCAGATGATATGGAGCACTAGTTAAGTTGGAC", the identifier "AC" is added every 30 bases. If the 31st and 32nd bases of the above sequence are GA, then the movement of the identifier is determined, and the left and right shifts are performed to find 'AC'. The insertion and deletion of the block are performed, and the index is saved.
[0054] Step 6. Filter the erroneous index sequences according to the image size and sequence length, obtain the missing sequences, randomly supplement the missing sequences with data, and save the index of the missing sequences;
[0055] Specifically, the image is 256*256 pixels, and the binary sequence length is 256, which should contain 2048 sequences. When the index is converted to decimal 3000, this sequence is filtered out. When the sequence indices are 1, 2, and 4 from smallest to largest, the sequence with index 3 is considered lost.
[0056] Step 7. Using the index of the lost sequence, determine the specific location and number of erroneous or lost sequences in the image pixels;
[0057] Step 8. Create a 3x3 window, obtain all pixels within the potentially erroneous pixel window, and sort them according to their pixel values;
[0058] Step 9. If the current pixel is between the third and seventh positions in the window (from smallest to largest), determine that the pixel is correct; otherwise, replace the current pixel with the average value of the pixels in the window and iterate to obtain a relatively correct pixel.
[0059] For example, if the current pixel is 68, the average pixel value in the window is 98, and the third and seventh pixels in the window from smallest to largest are 75 and 128 respectively, then the current pixel will be replaced by 98.
[0060] The above method was simulated using PyCharm on an Intel(R) CPU 3.6GHz, 10.0GB RAM, and Windows 10 operating system. Figure 2 As shown, experimental results demonstrate that the method in this embodiment outperforms the experimental results of other algorithms.
[0061] Example 2:
[0062] This embodiment provides a robust DNA image storage system based on parity coding and local mean iteration, including:
[0063] The conversion module stores image data in a lossless manner, converts the image data into pixel values, and then converts them into binary data.
[0064] Error protection includes dividing binary data into groups of 8 bits, with the first four bits of each group being high-impact data and the last four bits being low-impact data, and using RS error correction codes to protect the high-impact data from errors.
[0065] The encoding module converts high-impact data with error correction codes into binary data, grouping them into 16-bit sets and encoding them according to odd and even encoding rules respectively.
[0066] The identifier addition module combines odd-coded data and even-coded data to form a new data block; the optimal data block is selected based on biochemical constraints and error-prone adjacent bases, and this optimal data block is spliced into a DNA sequence of a set length, with the identifier "AC" added at a fixed position in the DNA sequence;
[0067] The flag bit determination module determines the position of the flag bit during decoding. If the position changes, it inserts or deletes an obstruction and saves the index; if the position does not change, it deletes the flag bit "AC".
[0068] The index acquisition module filters out erroneous index sequences based on image size and sequence length, acquires lost sequences, randomly supplements the lost sequences with data, and saves the index of the lost sequences.
[0069] The module searches for the missing sequence to determine the specific location and number of erroneous or missing sequences within the image pixels using the index of the missing sequence.
[0070] The sorting module creates a window, retrieves all pixels within the potentially erroneous pixel window, and sorts them according to their pixel values.
[0071] The pixel judgment module determines that if the current pixel is between the third and seventh positions in the window (from smallest to largest), the pixel is correct; otherwise, it iterates by replacing the current pixel with the average value of the pixels in the window to obtain a relatively correct pixel.
[0072] Example 3:
[0073] An electronic device includes a memory, a processor, and a computer program stored in the memory and running thereon. When the processor executes the program, it implements the robust DNA image storage method based on parity coding and local mean iteration described above, comprising:
[0074] Image data is stored in a lossless manner, and the image data is converted into pixel value form, and then converted into binary data;
[0075] The binary data is divided into groups of 8 bits each. The first four bits of each group are high-impact data and the last four bits are low-impact data. The RS error correction code is used to protect the high-impact data from errors.
[0076] High-impact data with added error correction codes is converted into binary data, grouped into 16-bit sets, and encoded according to odd and even encoding rules respectively.
[0077] Odd-coded and even-coded data are combined to form new data blocks; the optimal data block is selected based on biochemical constraints and error-prone adjacent bases, and this optimal data block is spliced into a DNA sequence of a set length, with the marker "AC" added at a fixed position in the DNA sequence;
[0078] During decoding, the position of the flag bit is checked. If the position changes, an interruption is inserted or deleted and the index is saved; if the position does not change, the flag bit "AC" is deleted.
[0079] Based on image size and sequence length, erroneous index sequences are filtered to obtain missing sequences. Random data is then added to the missing sequences, and the indexes of the missing sequences are saved.
[0080] By using the index of the lost sequence, the specific location and number of erroneous or lost sequences in the image pixels can be determined;
[0081] Create a window, retrieve all pixels within the potentially erroneous pixel window, and sort them according to their pixel values.
[0082] If the current pixel is between the third and seventh positions in the window (from smallest to largest), the pixel is considered to be without error; otherwise, the average value of the pixels in the window is used to replace the current pixel, and the process is iterated to obtain a relatively correct pixel.
[0083] Example 4:
[0084] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the robust DNA image storage method based on parity coding and local mean iteration described above, comprising:
[0085] Image data is stored in a lossless manner, and the image data is converted into pixel value form, and then converted into binary data;
[0086] The binary data is divided into groups of 8 bits each. The first four bits of each group are high-impact data and the last four bits are low-impact data. The RS error correction code is used to protect the high-impact data from errors.
[0087] High-impact data with added error correction codes is converted into binary data, grouped into 16-bit sets, and encoded according to odd and even encoding rules respectively.
[0088] Odd-coded and even-coded data are combined to form new data blocks; the optimal data block is selected based on biochemical constraints and error-prone adjacent bases, and this optimal data block is spliced into a DNA sequence of a set length, with the marker "AC" added at a fixed position in the DNA sequence;
[0089] During decoding, the position of the flag bit is checked. If the position changes, an interruption is inserted or deleted and the index is saved; if the position does not change, the flag bit "AC" is deleted.
[0090] Based on image size and sequence length, erroneous index sequences are filtered to obtain missing sequences. Random data is then added to the missing sequences, and the indexes of the missing sequences are saved.
[0091] By using the index of the lost sequence, the specific location and number of erroneous or lost sequences in the image pixels can be determined;
[0092] Create a window, retrieve all pixels within the potentially erroneous pixel window, and sort them according to their pixel values.
[0093] If the current pixel is between the third and seventh positions in the window (from smallest to largest), the pixel is considered to be without error; otherwise, the average value of the pixels in the window is used to replace the current pixel, and the process is iterated to obtain a relatively correct pixel.
[0094] This invention proposes parity coding and local mean iteration, which enables DNA sequences to meet conventional biochemical constraints and reduces the frequency of error-prone adjacent bases, thereby improving the stability of DNA sequences. Furthermore, it achieves image reconstruction under conventional error conditions, resulting in reconstructed images with better clarity, fidelity, and similarity in structure, texture, and detail, leading to better image reconstruction quality in DNA storage.
[0095] Those skilled in the art will understand that the modules or steps described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, which can then be stored in a storage device for execution by a computer device. Alternatively, they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. This disclosure is not limited to any particular combination of hardware and software.
[0096] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0097] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A robust DNA image storage method based on parity coding and local mean iteration, characterized in that, Includes the following steps: Image data is stored in a lossless manner, and the image data is converted into pixel value form, and then converted into binary data; The binary data is divided into groups of 8 bits each. The first four bits of each group are high-impact data and the last four bits are low-impact data. The RS error correction code is used to protect the high-impact data from errors. High-impact data with added error correction codes is converted into binary data, grouped into 16-bit sets, and encoded according to odd and even encoding rules respectively. Combine odd-coded data and even-coded data to form a new data block; The optimal data block is selected based on biochemical constraints and error-prone adjacent bases. This optimal data block is then spliced into a DNA sequence of a set length, and a marker "AC" is added at a fixed position in the DNA sequence. During decoding, the position of the flag bit is checked. If the position changes, an interruption is inserted or deleted and the index is saved; if the position does not change, the flag bit "AC" is deleted. Based on image size and sequence length, erroneous index sequences are filtered to obtain missing sequences. Random data is then added to the missing sequences, and the indexes of the missing sequences are saved. By using the index of the lost sequence, the specific location and number of erroneous or lost sequences in the image pixels can be determined; Create a window, retrieve all pixels within the potentially erroneous pixel window, and sort them according to their pixel values. If the current pixel is between the third and seventh positions in ascending order within the window, the pixel is considered to be without error. Otherwise, the average value of the pixels within the window is used to replace the current pixel, and the process is iterated to obtain a relatively correct pixel.
2. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, The odd encoding rule is 00-A, 01-T, 10-C, 11-G.
3. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, The even encoding rules include four types: R1, R2, R3, and R4, which are as follows: R1: 00-A, 01-T, 10-C, 11-G R2: 00-T, 01-C, 10-G, 11-A R3: 00-C, 01-G, 10-A, 11-T R4: 00-G, 01-A, 10-T, 11-C.
4. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, In binary data grouped into sixteen bits, bits 1-4 and 9-12 are encoded according to odd encoding rules; bits 5-8 and 13-16 are encoded according to even encoding rules.
5. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, The distinction between high-impact and low-impact data is based on the following: the weight of binary data at different positions in each group accounts for 2% of the pixel value weight. i -1, where i represents the position of the data in the group; the impact of a random one-bit error in the first four bits of data on the pixel is 60.25, which is defined as high-impact data; the impact of a random one-bit error in the last four bits of data on the pixel is 3.75, which is defined as low-impact data.
6. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, The error-prone adjacent bases refer to three bases that are prone to errors when combined, including "GAC", "CAC", "GTC", "GTG", "GCG", "CGC", "TCT", "ACT", "AGA", "ATA", "TAT" and "TGC".
7. The robust DNA image storage method based on parity coding and local mean iteration according to claim 1, characterized in that, The created window is 3*3 in size.
8. A robust DNA image storage system based on parity coding and local mean iteration, characterized in that, include: The conversion module stores image data in a lossless manner, converts the image data into pixel value form, and then converts it into binary data; The error protection module divides binary data into groups of 8 bits each, with the first four bits of each group being high-impact data and the last four bits being low-impact data. It uses RS error correction codes to protect the high-impact data from errors. The encoding module converts high-impact data with error correction codes into binary data, grouping them into 16-bit sets and encoding them according to odd and even encoding rules respectively. The identifier addition module combines odd-coded data and even-coded data into a new data block; The optimal data block is selected based on biochemical constraints and error-prone adjacent bases. This optimal data block is then spliced into a DNA sequence of a set length, and a marker "AC" is added at a fixed position in the DNA sequence. The flag bit determination module determines the position of the flag bit during decoding. If the position changes, it inserts or deletes an obstruction and saves the index; if the position does not change, it deletes the flag bit "AC". The index acquisition module filters out erroneous index sequences based on image size and sequence length, acquires lost sequences, randomly supplements the lost sequences with data, and saves the index of the lost sequences. The module searches for the missing sequence to determine the specific location and number of erroneous or missing sequences within the image pixels using the index of the missing sequence. The sorting module creates a window, retrieves all pixels within the potentially erroneous pixel window, and sorts them according to their pixel values. The pixel judgment module determines that if the current pixel is between the third and seventh positions in ascending order within the window, the pixel is considered to be without error. Otherwise, the average value of the pixels within the window is used to replace the current pixel, and the process is iterated to obtain a relatively correct pixel.
Citation Information
Patent Citations
Hidden addressing DNA storage coding design method
CN114678074A
Long-sequence DNA storage coding method based on static interleaving coding
CN115459781A