WO2023092723A1 - 数据纠错方法、装置及电子设备 - Google Patents

数据纠错方法、装置及电子设备 Download PDF

Info

Publication number
WO2023092723A1
WO2023092723A1 PCT/CN2021/138004 CN2021138004W WO2023092723A1 WO 2023092723 A1 WO2023092723 A1 WO 2023092723A1 CN 2021138004 W CN2021138004 W CN 2021138004W WO 2023092723 A1 WO2023092723 A1 WO 2023092723A1
Authority
WO
WIPO (PCT)
Prior art keywords
text
error
base
corrected
base sequence
Prior art date
Application number
PCT/CN2021/138004
Other languages
English (en)
French (fr)
Inventor
戴俊彪
卢明伟
黄小罗
Original Assignee
中国科学院深圳先进技术研究院
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2023092723A1 publication Critical patent/WO2023092723A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • G06F40/284Lexical analysis, e.g. tokenisation or collocates
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16BBIOINFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR GENETIC OR PROTEIN-RELATED DATA PROCESSING IN COMPUTATIONAL MOLECULAR BIOLOGY
    • G16B20/00ICT specially adapted for functional genomics or proteomics, e.g. genotype-phenotype associations

Definitions

  • the present application belongs to the technical field of data processing, and in particular relates to a data error correction method, device, electronic equipment, and computer-readable storage medium.
  • the success rate of subsequent restoration of original data is mainly increased by adding redundant storage.
  • quadruple overlapping redundancy is used to store a piece of data multiple times, and then compare multiple stored data to improve the success rate of restoring the original data. That is to say, when restoring the original data, the existing method needs to combine the data stored repeatedly to achieve error correction, and the repeated storage of data will increase the storage cost of DNA.
  • the embodiment of the present application provides a data error correction method, device, electronic equipment, and computer-readable storage medium, which can solve the problem of excessive storage costs caused by relying on redundantly stored data when error correction is performed on data based on DNA storage .
  • the embodiment of the present application provides a data error correction method, including:
  • the base sequence to be error-corrected is composed of multiple bases
  • Error correction is performed on the base sequence to be error-corrected according to the erroneous text unit.
  • the embodiment of the present application provides a data error correction device, including:
  • the first text determination module is used to decode the base sequence to be error-corrected into the first text, and the base sequence to be error-corrected is composed of multiple bases;
  • the first text word segmentation module is used to perform word segmentation on the first text to obtain multiple text units;
  • An error detection module configured to perform error detection on the plurality of text units to obtain error text units
  • An error correction module configured to correct the error of the base sequence to be error corrected according to the error text unit.
  • an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and operable on the processor.
  • the processor executes the computer program, Implement the method as described in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to the first aspect is implemented.
  • an embodiment of the present application provides a computer program product, which causes the electronic device to execute the method described in the first aspect when the computer program product is run on the electronic device.
  • the first text can be processed by related algorithms in the field of natural language processing Error detection is performed on multiple text units obtained by word segmentation of a text to obtain text units with errors, and then the base sequence to be corrected can be corrected according to the text units with errors.
  • relevant algorithms in the field of natural language processing to detect errors in text units, it can be realized without combining duplicate stored data, that is, when performing DNA storage, there is no need to increase redundancy. That is to say, through the data error correction method provided by the embodiment of the present application, not only the error correction of the data can be realized, but also the redundancy in data storage can be reduced, thereby reducing the storage cost of DNA.
  • FIG. 1 is a flowchart of a data error correction method provided by an embodiment of the present application
  • FIG. 2 is a flowchart of another data error correction method provided by an embodiment of the present application.
  • Fig. 3 is a structural block diagram of a data error correction device provided by an embodiment of the present application.
  • Fig. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.
  • DNA when used as an information storage medium, in order to improve the success rate of restoring the original data, one piece of data must be stored multiple times, or an error correction code must be added to the stored data. But no matter which method is used, it will increase the redundancy, thereby increasing the storage cost of DNA.
  • an embodiment of the present application provides a data error correction method.
  • the base sequence to be error corrected is first decoded into a text, and then the text is error detected, and finally Error correction is performed on the base sequence to be error-corrected based on the detection result. That is to say, in the embodiment of the present application, instead of directly correcting the base sequence to be corrected, the base sequence to be corrected is first decoded into a corresponding text and then the text is corrected.
  • the error correction of the text can be realized without combining the data stored repeatedly. Therefore, the storage cost of DNA can be effectively saved when error correction is performed by the above method.
  • FIG. 1 shows a flowchart of a data error correction method provided in the embodiment of the present application, which is described in detail as follows:
  • Step S11 decoding the base sequence to be error-corrected into a first text, where the base sequence to be error-corrected is composed of multiple bases.
  • the base is a part of deoxyribonucleotide (DNA), and there are generally four types of bases on DNA: A, T, G, and C.
  • the base sequence to be corrected is the base sequence after encoding, and the base sequence to be corrected includes a plurality of bases.
  • the base sequence to be corrected can be " AGCCTACTACCTCT".
  • the corresponding decoding method can be selected according to the encoding method adopted by the base sequence to be error-corrected, and then the first text can be decoded by using the decoding method.
  • the encoding method adopted for the base sequence to be error-corrected is: adopt quaternary huffman encoding, and replace every continuous 5 bases with 6 bases. Then, when decoding the base sequence to be error-corrected, it is necessary to convert each consecutive 6 bases in the base sequence to be error-corrected into corresponding 5 bases, obtain the converted base sequence, and then decode The converted base sequence is used to obtain the first text.
  • Step S12 performing word segmentation on the above-mentioned first text to obtain a plurality of text units.
  • the jieba word segmentation method may be used to segment the first text to obtain multiple text units. For example, assuming that the sentence "you and me” in the first text is segmented by jieba, the three text units "you", "and” and "me” are obtained.
  • Step S13 performing error detection on the above-mentioned plurality of text units to obtain text units with errors.
  • an algorithm related to the field of natural language processing may be selected to perform error detection on text units.
  • Step S14 performing error correction on the base sequence to be error-corrected according to the above-mentioned erroneous text unit.
  • the bases with errors can be determined in the base sequence to be error-corrected, and then the error correction of the base sequence to be error-corrected can be realized.
  • the first text can be processed by related algorithms in the field of natural language processing Error detection is performed on multiple text units obtained by word segmentation of a text to obtain text units with errors, and then the base sequence to be corrected can be corrected according to the text units with errors.
  • relevant algorithms in the field of natural language processing to detect errors in text units, it can be realized without combining duplicate stored data, that is, when performing DNA storage, there is no need to increase redundancy. That is to say, through the data error correction method provided by the embodiment of the present application, not only the error correction of the data can be realized, but also the redundancy in data storage can be reduced, thereby reducing the storage cost of DNA.
  • the above step S14 includes:
  • A1. Determine the erroneous base group according to the above-mentioned erroneous text unit, and obtain the target base group, wherein each of the above-mentioned base groups is composed of every consecutive N bases in the above-mentioned base sequence to be error-corrected , N is a natural number greater than 1.
  • A2. Perform error correction on the base sequence to be error-corrected according to the target base group.
  • the base group corresponding to the text unit with errors is located in the base sequence to be corrected, that is, the target base group is determined. Since the determined base group is the same as the text with errors unit corresponds, therefore, the determined base group is also wrong, that is, by performing error detection on the text unit, it is possible to detect the wrong base position, and then the base at the base position is Error correction, so as to realize the error correction of the base sequence to be error corrected.
  • the relationship between the bases in the base sequence to be error-corrected should conform to The encoding requirements during encoding, otherwise, if the relationship between the bases does not meet the encoding requirements during encoding, it indicates that there is an error in the base sequence to be corrected. That is, it can be judged whether there is an error in the base sequence to be error-corrected by judging whether the relationship between the bases in the base sequence to be error-corrected meets the coding requirements during encoding. That is, before the above step S11, it also includes:
  • the above-mentioned preset The encoding requirement is the encoding requirement adopted to obtain the above-mentioned base sequence to be error-corrected.
  • step S11 includes:
  • the base sequence to be error-corrected is decoded into the first text.
  • the above-mentioned base sequence to be corrected is divided into multiple base groups, and for each base group, it is judged whether the bases in the base group meet the preset coding requirements, if not, Then it is determined that the base group is a base group with errors, that is, it is determined as a target base group. Since the target base group is screened according to whether the preset encoding requirements are met, the calculation amount of the comparison process is less, so the speed of screening out the target base group can be improved. And since only base groups meeting the preset encoding requirements can decode the corresponding text, a screening is performed before the first text is decoded, which can also ensure the success of subsequent decoding.
  • the ratio of the specified bases in the base group meets the above ratio requirements, and/or, the base group belongs to a preset base group set, and the above preset base group set is used to store preset multiple bases base group.
  • the designated base can be one base, or two or more bases.
  • the specified base is two bases (assumed to be G and C bases)
  • the coding requirement for obtaining the base sequence to be corrected is: the ratio of bases "G" and "C" in every 6 consecutive bases is 50%
  • the bases to be corrected are first Every 6 consecutive bases in the base sequence are divided into a base group, and then judge whether the proportion of bases "G" and "C” in each base group is 50%, if not, determine the base group is the target base group.
  • a base group set is preset, and the base group set is used to store multiple base groups.
  • Each base group in the base group set can be directly decoded into a corresponding text unit, or can be decoded into a corresponding text unit after certain processing (such as performing a replacement operation). That is, when the base group does not belong to the base group set, it indicates that the base group cannot be decoded into the corresponding text unit, that is, the base group is the target base group.
  • the base groups stored in the base group set do not necessarily include the base groups corresponding to the permutations and combinations of various bases. Therefore, some bases divided from the base sequence to be error-corrected groups may not belong to the base group set, and at this time, these base groups that do not belong to the base group set are all determined as target base groups.
  • the above step A2 includes:
  • A21 Determine all possible base groups according to the above target base group, and obtain M candidate base groups, where M is a natural number.
  • a single base of the target base group is changed sequentially, so as to realize the traversal of the target base group.
  • the target base group has only one base group, such as "GGCAAT”
  • change its single bases in turn note that when replacing, "G” and “C” are replaced, “T” and “A” are replaced
  • CGCAAT CGCAAT
  • GCCAAT GGGAAT
  • GGCTAT GGGCATT
  • GGCAAA GGCAAA
  • the target base group includes two or more base groups, such as "GGCAAT” and “TACCGA"
  • the target base group may include base groups that do not belong to the preset base group set
  • the base groups that do not belong to the preset base group set cannot be decoded into corresponding text units , therefore, in the process of traversing the target base group, if a base group that does not belong to the preset base group set is encountered, the base group is skipped, that is, the base group is not traversed. For example, suppose the target base group includes two base groups "GGCAAT" and "TACCGA", but "GGCAAT" is not in the preset base set, then skip the "GGCAAT” and directly change the "TACCGA” single base.
  • a new base sequence will be obtained after replacing each candidate base group with the base sequence to be corrected, that is , when M candidate base groups are used to replace the base sequences to be corrected respectively, M new base sequences will be obtained.
  • M texts can be decoded, and in order to distinguish them from other texts, the decoded text here is named the second text.
  • A23 Determine a second text from all the above-mentioned second texts as the error-corrected text corresponding to the above-mentioned base sequence to be error-corrected.
  • a preset natural language processing model (such as an N-gram model) may be used to determine the correct second text from multiple second texts.
  • step S13 includes:
  • the natural language processing model will output a score.
  • the higher the score the higher the probability that the text unit is a wrong text unit. Otherwise, it indicates that the text unit is wrong. The lower the probability of the text unit.
  • the preset natural language processing model includes an N-gram model. Before performing error detection on the text unit through the N-gram model (assumed to be the first N-gram model), the second N-gram model is trained first, and the model obtained after training is the first N-gram model.
  • python can be used to call a third-party open source library kenlm to train the second N-gram model. Since kenlm is a language model tool developed by Kenneth Heafield personally, it has the advantages of fast speed and small memory usage. Therefore, it is more convenient to get the first N-gram model by using python to call kenlm.
  • the first N-gram model can calculate the corresponding score according to the following python3 program:
  • Model is a class related to score calculation defined in kenlm, instantiate this class as kn_model, filename is the name of the N-gram model file generated by python3 calling kenlm tool training, math.floor(x) is used to return less than the parameter The maximum integer of x, sentence is one or several consecutive text units whose score is to be calculated.
  • n is the number of text units+1, for example, when sentence is "you and me", n is 4.
  • the first preset requirement includes: not greater than 10 6 , that is, when the score corresponding to the text unit input into the natural language processing model is greater than 10 6 , it is determined that the text unit is a text unit with errors.
  • step S13 includes:
  • the second preset requirement is different from the first preset requirement, for example, when the first preset requirement includes: not more than 10 6 , the second preset requirement may include 2 ⁇ 10 5 .
  • the natural language processing model outputs the corresponding score of the text unit group, and a text unit group is composed of consecutive R text units, and R is greater than 1, the output of the natural language processing model is at least Scores corresponding to two adjacent text units. That is, through the above processing, it is possible to identify adjacent text units whose adjacent relationship has errors.
  • the resulting encoding result is "AGGAGTCATAGA"
  • the character string to be encoded is restored, an error occurs in the first base of the above encoding result, which becomes to "TGGAGTCATAGA" or, alternatively, to "GGGAGTCATAGA".
  • the encoding requires that every 6 consecutive bases be a base group, and the GC ratio in each base group is 50%
  • the GC ratio of the base groups in "TGGAGTCATAGA" is 50 %
  • the GC ratio of the first base group "GGGAGT” in “GGGAGTCATAGA" is 66.7%, which does not meet the GC ratio requirement.
  • FIG. 3 shows a structural block diagram of a data error correction device provided by the embodiment of the present application. For the convenience of description, only the parts related to the embodiment of the present application are shown.
  • the data error correction device includes: a first text determination module 31 , a first text word segmentation module 32 , an error detection module 33 , and an error correction module 34 . in:
  • the first text determination module 31 is configured to decode the base sequence to be error-corrected into a first text, and the base sequence to be error-corrected is composed of multiple bases.
  • the first text word segmentation module 32 is used for carrying out word segmentation to described first text, obtains a plurality of text units;
  • the error detection module 33 is configured to perform error detection on the plurality of text units to obtain text units with errors.
  • An error correction module 34 configured to correct the base sequence to be error-corrected according to the text unit with errors.
  • the base sequence to be error-corrected is first decoded into the first text before performing error correction on the base sequence to be error-corrected
  • the first Error detection is performed on multiple text units obtained by text segmentation to obtain text units with errors, and then the base sequence to be corrected can be corrected according to the text units with errors.
  • it can be realized without combining repeatedly stored data, that is, when performing DNA storage, there is no need to increase redundancy. That is to say, through the data error correction method provided by the embodiment of the present application, not only the error correction of data can be realized, but also the redundancy in data storage can be reduced, thereby reducing the storage cost of DNA.
  • the error correction module 34 includes:
  • the first target base group determination unit is used to determine the base group with errors according to the text unit with errors to obtain target base groups, wherein each of the base groups consists of the bases to be corrected Consecutive N bases in the base sequence, where N is a natural number greater than 1.
  • an error correction unit configured to correct the error of the base sequence to be error corrected according to the target base group.
  • the data error correction device also includes:
  • the second target base group determination unit is used to detect whether there are base groups that do not meet the preset coding requirements in the base sequence to be error-corrected, and base groups that do not meet the preset coding requirements
  • the group is determined as the target base group, and the preset coding requirement is the coding requirement used to obtain the base sequence to be error-corrected.
  • the first text determination module 31 is specifically used for:
  • the preset encoding requirements include:
  • the ratio of the specified bases in the base group meets the ratio requirement, and/or, the base group belongs to a preset base group set, and the preset base group set is used to store a preset multiple base group.
  • the designated base can be one base, or two or more bases.
  • the above-mentioned error correction unit includes:
  • the base group traversal unit is used to determine all possible base groups according to the target base group to obtain M candidate base groups, where M is a natural number.
  • a single base of the target base group is changed sequentially, so as to realize the traversal of the target base group.
  • the target base group may include base groups that do not belong to the preset base group set
  • the base groups that do not belong to the preset base group set cannot be decoded into corresponding text units , therefore, in the process of traversing the target base group, if a base group that does not belong to the preset base group set is encountered, the base group is skipped, that is, the base group is not traversed.
  • the second text determination unit is used to replace the M candidate base groups with the target base groups in the base sequence to be error-corrected to obtain M new base sequences, and decode the M base groups respectively A new base sequence is obtained to obtain M second texts.
  • the error-corrected text determining unit is configured to determine a second text from all the second texts as the error-corrected text corresponding to the base sequence to be error-corrected.
  • a preset natural language processing model (such as an N-gram model) may be used to determine the correct second text from multiple second texts.
  • the error detection module 33 includes:
  • the score determination unit for a single text unit is configured to input multiple text units into a preset natural language processing model one by one to obtain a score output by the natural language processing model corresponding to the input text unit.
  • the preset natural language processing model includes an N-gram model. Before performing error detection on the text unit through the N-gram model (assumed to be the first N-gram model), the second N-gram model is trained first, and the model obtained after training is the first N-gram model.
  • python can be used to call a third-party open source library kenlm to train the second N-gram model. Since kenlm is a language model tool developed by Kenneth Heafield personally, it has the advantages of fast speed and small memory usage. Therefore, using python to call kenlm can get the first N-gram model more conveniently.
  • the first N-gram model can calculate the corresponding score according to the following formula:
  • PP(T) is the score
  • T is the value of "N" in the first N-gram model, appear in the sentence , the probability of ⁇ i appearing later.
  • a single erroneous text unit detection unit is configured to determine that the input text unit is an erroneous text unit when the score corresponding to the input text unit does not meet the first preset requirement.
  • the first preset requirement includes: not greater than 10 6 .
  • the error detection module 33 also includes:
  • the text unit group determination unit is used to divide every continuous R text units into one group in all of the text units to obtain at least two groups of text unit groups, and R is a natural number greater than 1.
  • the score determining unit of the text unit group is configured to input the text unit groups into the natural language processing model one by one, and obtain the scores corresponding to the input text unit groups output by the natural language processing model.
  • An erroneous text unit group detection unit configured to determine that the input text unit group is an erroneous text unit group when the score corresponding to the input text unit group does not meet the second preset requirement.
  • Each text unit included in the text unit group is the text unit with the error.
  • the second preset requirement is different from the first preset requirement, for example, when the first preset requirement includes: not more than 10 6 , the second preset requirement may include 2 ⁇ 10 5 .
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 4 of this embodiment includes: at least one processor 40 (only one processor is shown in FIG. 4 ), a memory 41 and stored in the memory 41 and can be processed in the at least one processor.
  • a computer program 42 running on the processor 40 when the processor 40 executes the computer program 42, implements the steps in any of the above method embodiments.
  • the electronic device 4 may be computing devices such as desktop computers, notebooks, palmtop computers, and cloud servers.
  • the electronic device may include, but not limited to, a processor 40 and a memory 41 .
  • FIG. 4 is only an example of the electronic device 4, and does not constitute a limitation to the electronic device 4. It may include more or less components than shown in the figure, or combine some components, or different components. , for example, may also include input and output devices, network access devices, and so on.
  • the so-called processor 40 can be a central processing unit (Central Processing Unit, CPU), and the processor 40 can also be other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit) , ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the storage 41 may be an internal storage unit of the electronic device 4 in some embodiments, such as a hard disk or memory of the electronic device 4 .
  • the memory 41 can also be an external storage device of the electronic device 4 in other embodiments, such as a plug-in hard disk equipped on the electronic device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc. Further, the memory 41 may also include both an internal storage unit of the electronic device 4 and an external storage device.
  • the memory 41 is used to store operating system, application program, boot loader (BootLoader), data and other programs, such as the program code of the computer program.
  • the memory 41 can also be used to temporarily store data that has been output or will be output.
  • the embodiment of the present application also provides a network device, which includes: at least one processor, a memory, and a computer program stored in the memory and operable on the at least one processor, and the processor executes The computer program implements the steps in any of the above method embodiments.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various method embodiments can be realized.
  • An embodiment of the present application provides a computer program product.
  • the computer program product runs on an electronic device, the electronic device can implement the steps in the foregoing method embodiments when executed.
  • the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the procedures in the method of the above-mentioned embodiments in the present application can be completed by instructing related hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium.
  • the computer program When executed by a processor, the steps in the above-mentioned various method embodiments can be realized.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form.
  • the computer-readable medium may at least include: any entity or device capable of carrying computer program codes to the photographing device/electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium.
  • ROM read-only memory
  • RAM random access memory
  • electrical carrier signal telecommunication signal and software distribution medium.
  • U disk mobile hard disk
  • magnetic disk or optical disk etc.
  • computer readable media may not be electrical carrier signals and telecommunication signals under legislation and patent practice.
  • the disclosed device/network device and method may be implemented in other ways.
  • the device/network device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Biotechnology (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Molecular Biology (AREA)
  • Proteomics, Peptides & Aminoacids (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • Analytical Chemistry (AREA)
  • Medical Informatics (AREA)
  • Genetics & Genomics (AREA)
  • Chemical & Material Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Machine Translation (AREA)

Abstract

本申请适用于数据处理技术领域,提供了数据纠错方法、装置及电子设备,包括:将待纠错的碱基序列解码为第一文本,所述待纠错的碱基序列由多个碱基组成;对所述第一文本进行分词,得到多个文本单元;对所述多个文本单元进行错误检测,得到存在错误的文本单元;根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。通过上述方法,能够实现对数据的纠错,也能够减少DNA的存储成本。

Description

数据纠错方法、装置及电子设备 技术领域
本申请属于数据处理技术领域,尤其涉及数据纠错方法、装置、电子设备及计算机可读存储介质。
背景技术
随着信息时代的到来,信息总量在不断高速增长。相关数据表明,2025年全球数据信息总量将增长至163ZB(泽字节),而这超过了现有硬盘等存储介质的承受能力。目前,研究者关注到脱氧核糖核酸(DNA)可用于信息的大量存储,且其具有存储密度高、存储时间长、损耗率低等特点。
现有方法中,主要通过增加冗余存储来提高后续恢复原始数据的成功率。比如,采用四倍重叠冗余,将一份数据进行多次存储,后续再通过比对多个存储数据来提高恢复原始数据的成功率。也即,现有方法在恢复原始数据时需要结合重复存储的数据才能实现纠错,而数据重复存储将增大DNA的存储成本。
发明内容
本申请实施例提供了数据纠错方法、装置、电子设备及计算机可读存储介质,可以解决对基于DNA存储的数据进行纠错时需要依赖冗余存储的数据所导致的存储成本过大的问题。
第一方面,本申请实施例提供了一种数据纠错方法,包括:
将待纠错的碱基序列解码为第一文本,所述待纠错的碱基序列由多个碱基组成;
对所述第一文本进行分词,得到多个文本单元;
对所述多个文本单元进行错误检测,得到存在错误的文本单元;
根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。
第二方面,本申请实施例提供了一种数据纠错装置,包括:
第一文本确定模块,用于将待纠错的碱基序列解码为第一文本,所述待纠错的碱基序列由多个碱基组成;
第一文本分词模块,用于对所述第一文本进行分词,得到多个文本单元;
错误检测模块,用于对所述多个文本单元进行错误检测,得到存在错误的文本单元;
纠错模块,用于根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。
第三方面,本申请实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如第一方面所述的方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面所述的方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面所述的方法。
本申请实施例与现有技术相比存在的有益效果是:
在本申请实施例中,由于对待纠错的碱基序列进行纠错之前,先将该待纠错的碱基序列解码为第一文本,因此,可通过自然语言处理领域的相关算法对该第一文本分词得到的多个文本单元进行错误检测,得到存在错误的文本单元,进而可以根据存在错误的文本单元实现对待纠错的碱基序列的纠错。而通过自然语言处理领域的相关算法对文本单元进行错误检测时,无需结合重复存储的数据就能实现,即在进行DNA存储时,不需要增加冗余量。也即,通过本申请实施例提供的数据纠错方法,不仅能够实现对数据的纠错,也能够减少数据存储时的冗余量,进而减少DNA的存储成本。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍。
图1是本申请一实施例提供的一种数据纠错方法的流程图;
图2是本申请一实施例提供的另一种数据纠错方法的流程图;
图3是本申请一实施例提供的一种数据纠错装置的结构框图;
图4是本申请一实施例提供的一种电子设备的结构示意图。
具体实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
还应当理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一 些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
实施例一:
目前,在将DNA作为信息存储介质时,为了提高恢复原始数据的成功率,要不将一份数据进行多次存储,要不在存储的数据中增加纠错码。但无论采用哪一种方式,均会增加冗余量,从而增加了DNA的存储成本。
为了解决该技术问题,本申请实施例提供了一种数据纠错方法,在该数据纠错方法中,先将待纠错的碱基序列解码为一个文本,再对该文本进行错误检测,最后基于检测结果对待纠错的碱基序列进行纠错。也即,在本申请实施例中,不是直接对待纠错的碱基序列进行纠错,而是先将该待纠错的碱基序列解码为对应的文本再对该文本进行纠错,由于对文本进行纠错时无需结合重复存储的数据就能实现,因此,通过上述方法进行纠错时能够有效节省DNA的存储成本。
下面结合具体的实施例对本申请实施例提供的数据纠错方法进行描述。
图1示出了本申请实施例提供的一种数据纠错方法的流程图,详述如下:
步骤S11,将待纠错的碱基序列解码为第一文本,上述待纠错的碱基序列由多个碱基组成。
其中,碱基是脱氧核糖核苷酸(DNA)的一部分,DNA上的碱基一般有A、T、G、C四种。
对DNA上的碱基进行编码后,不同碱基所组成的组合可用来表示不同的数据,进而实现将数据存储在DNA上。本实施例中,上述待纠错的碱基序列即为编码后的碱基序列,该待纠错的碱基序列中包括多个碱基,比如,该待纠错的碱基序列可以为“AGCCTACTACCTCT”。
在本实施例中,可根据该待纠错的碱基序列所采用的编码方式选择对应的解码方式,再采用该解码方式解码出第一文本。例如,假设该待纠错的碱基序 列所采用的编码方式是:采用四进制huffman编码,并将每连续的5个碱基替换为6个碱基。则在解码该待纠错的碱基序列时,需要先将待纠错的碱基序列中每连续的6个碱基转换为对应的5个碱基,得到转换后的碱基序列,再解码转换后的碱基序列,得到第一文本。
步骤S12,对上述第一文本进行分词,得到多个文本单元。
本实施例中,可采用jieba分词法对第一文本进行分词,得到多个文本单元。例如,假设对第一文本中的句子“you and me”进行jieba分词后,得到“you”、“and”、“me”这三个文本单元。
步骤S13,对上述多个文本单元进行错误检测,得到存在错误的文本单元。
本实施例中,检测分词得到的文本单元是否存在错误。具体地,可选择与自然语言处理领域相关的算法对文本单元进行错误检测。
步骤S14,根据上述存在错误的文本单元对上述待纠错的碱基序列进行纠错。
本实施例中,在确定出存在错误的文本单元后能够在待纠错的碱基序列中确定出存在错误的碱基,进而能够实现对该待纠错的碱基序列的纠错。
在本申请实施例中,由于对待纠错的碱基序列进行纠错之前,先将该待纠错的碱基序列解码为第一文本,因此,可通过自然语言处理领域的相关算法对该第一文本分词得到的多个文本单元进行错误检测,得到存在错误的文本单元,进而可以根据存在错误的文本单元实现对待纠错的碱基序列的纠错。而通过自然语言处理领域的相关算法对文本单元进行错误检测时,无需结合重复存储的数据就能实现,即在进行DNA存储时,不需要增加冗余量。也即,通过本申请实施例提供的数据纠错方法,不仅能够实现对数据的纠错,也能够减少数据存储时的冗余量,进而减少DNA的存储成本。
在一些实施例中,上述步骤S14包括:
A1、根据上述存在错误的文本单元确定存在错误的碱基组,得到目标碱基组,其中,每个上述碱基组由上述待纠错的碱基序列中的每连续的N个碱基组 成,N为大于1的自然数。
假设待纠错的碱基序列为“AGCCTACTACCTCT”,N=6,则从该待纠错的碱基序列中可以划分出以下几个碱基组“AGCCTA”、“GCCTAC”、“CCTACT”、“CTACTA”、“TACTAC”、“ACTACC”、“CTACCT”、“TACCTC”以及“ACCTCT”。
本实施例中,假设存在三个文本单元:“you”、“and”、“me”,且“you”这个文本单元为存在错误的文本单元,而与“you”对应的碱基组有X1、Y1和Z1,则该X1、Y1和Z1均为上述的目标碱基组。而若“and”对应的碱基组为X2和Y2,且“and”这个文本单元也为存在错误的文本单元,则X1、Y1、Z1、X2和Y2均为上述的目标碱基组。
A2、根据上述目标碱基组对上述待纠错的碱基序列进行纠错。
上述A1和A2中,在待纠错的碱基序列中定位出与存在错误的文本单元对应的碱基组,即确定出目标碱基组,由于确定出的碱基组是与存在错误的文本单元对应,因此,该确定出的碱基组也是存在错误的,也即,通过对文本单元进行错误检测,能够检测出存在错误的碱基位置,进而再对该碱基位置上的碱基进行纠错,从而实现对该待纠错的碱基序列的纠错。
在一些实施例中,考虑到待纠错的碱基序列在纠错之前先进行了编码,即,在没有出错的情况下,待纠错的碱基序列中的碱基之间的关系应符合编码时的编码要求,否则,若碱基之间的关系不符合编码时的编码要求,则表明待纠错的碱基序列存在错误。也即,可通过判断待纠错的碱基序列中的碱基之间的关系是否满足编码时的编码要求来判断该待纠错的碱基序列是否存在错误。即,在上述步骤S11之前,还包括:
检测上述待纠错的碱基序列中是否存在不满足预设的编码要求的碱基组,并将不满足上述预设的编码要求的碱基组判定为上述目标碱基组,上述预设的编码要求为得到上述待纠错的碱基序列所采用的编码要求。
对应地,上述步骤S11包括:
若上述待纠错的碱基序列中不存在不满足预设的编码要求的碱基组,则将上述待纠错的碱基序列解码为第一文本。
本实施例中,将上述待纠错的碱基序列划分为多个碱基组,对每一个碱基组,判断该碱基组中的碱基是否满足预设的编码要求,若不满足,则判定该碱基组为存在错误的碱基组,即判定为目标碱基组。由于根据是否满足预设的编码要求来筛选目标碱基组,而比较过程的运算量较少,因此,能够提高筛选出该目标碱基组的速度。且由于只有满足预设的编码要求的碱基组才能解码出对应的文本,因此,在解码出第一文本之前先进行一次筛选,也能够保证后续解码的成功性。
在一些实施例中,上述预设的编码要求包括:
碱基组中的指定碱基的占比满足上述占比要求,和/或,碱基组属于预设的碱基组集合,上述预设的碱基组集合用于存储预设的多个碱基组。
本实施例中,指定碱基可以为一个碱基,也可以为两个或两个以上碱基。当指定碱基为两个碱基(假设为G、C碱基),则判断碱基组中的G、C碱基是否满足占比要求,若满足,则判断该碱基组中的碱基满足预设的编码要求。例如,假设得到待纠错的碱基序列所采用的编码要求为:每连续的6个碱基中碱基“G”和“C”的占比为50%,则先将待纠错的碱基序列中每连续的6个碱基划分为一个碱基组,再判断每一个碱基组中碱基“G”和“C”的占比是否为50%,若不是,则判定该碱基组为目标碱基组。需要指出的是,若碱基组只有碱基“G”,则只判断碱基“G”的占比是否为50%;若碱基组只有碱基“C”,则只判断碱基“C”的占比是否为50%;若碱基组同时包含碱基“G”和“C”,则需要判断碱基“G”和碱基“C”的占比是否为50%。
本实施例中,预设一个碱基组集合,该碱基组集合用于存储多个碱基组。该碱基组集合中的每一个碱基组均能够直接解码为对应的文本单元,或者,均能够进行一定的处理(如执行替换操作)后再解码为对应的文本单元。即,当碱基组不属于该碱基组集合时,表明该碱基组不能解码为对应的文本单元,也 即,该碱基组为目标碱基组。
需要指出的是,该碱基组集合存储的碱基组中不一定包括各种碱基的排列组合所对应的碱基组,因此,从待纠错的碱基序列划分出的某些碱基组可能不属于该碱基组集合,此时,将这些不属于碱基组集合中的碱基组均判定为目标碱基组。
在一些实施例中,上述步骤A2包括:
A21、根据上述目标碱基组确定所有可能的碱基组,得到M个候选碱基组,M为自然数。
具体地,依次更改目标碱基组的单个碱基,以实现对该目标碱基组的遍历。例如,假设目标碱基组只有一个碱基组,如为“GGCAAT”,则依次更改其单个碱基(注意,替换时,“G”和“C”替换,“T”和“A”替换),得到“CGCAAT”、“CGCAAT”、“GCCAAT”、“GGGAAT”、“GGCTAT”、“GGCATT”、“GGCAAA”。假设目标碱基组包括两个或两个以上碱基组,如为“GGCAAT”和“TACCGA”,则同样依次更改“GGCAAT”和“TACCGA”中的单个碱基,具体更改过程与目标碱基组只有一个碱基组时类似,此处不再赘述。
在一些实施例中,由于目标碱基组可能包括不属于预设的碱基组集合中的碱基组,而不属于预设的碱基组集合中的碱基组不能解码为对应的文本单元,因此,在对目标碱基组遍历的过程中,若遇到不属于预设的碱基组集合中的碱基组,则跳过该碱基组,即不对该碱基组进行遍历。例如,假设目标碱基组包括“GGCAAT”和“TACCGA”这两个碱基组,而“GGCAAT”不在预设的碱基集合中,则跳过该“GGCAAT”,直接依次更改“TACCGA”的单个碱基。
A22、将上述M个候选碱基组分别替换上述待纠错的碱基序列中的目标碱基组,得到M个新的碱基序列,分别解码上述M个新的碱基序列,得到M个第二文本。
由于每更改目标碱基组中的一个碱基,均得到一个候选碱基组,因此,将每一个候选碱基组替换待纠错的碱基序列后将得到一个新的碱基序列,也即, 当采用M个候选碱基组分别替换待纠错的碱基序列后,将得到M个新的碱基序列。对该M个新的碱基序列解码后,能够解码出M个文本,为了跟其他文本进行区分,将这里解码出的文本命名为第二文本。
A23、从所有上述第二文本中确定出一个第二文本作为上述待纠错的碱基序列对应的纠错后的文本。
具体地,可采用预设的自然语言处理模型(如N-gram模型)从多个第二文本中确定出正确的第二文本。
上述A21~A23中,由于逐个更改目标碱基组中的碱基,因此,能够得到该目标碱基组对应的多种可能的碱基组组合,从而在解码由M个候选碱基得到的M个新的碱基序列后,能够得到M个第二文本。即,由于增加了第二文本的数量,因此,提高了正确的第二文本在解码出的多个第二文本中的可能性,从而提高了得到正确的第二文本的概率性,即提高了纠错的成功率。
在一些实施例中,步骤S13包括:
B1、将多个上述文本单元逐个输入预设的自然语言处理模型,得到自然语言处理模型输出的与输入的文本单元对应的得分。
在本实施例中,文本单元输入自然语言处理模型后,该自然语言处理模型将输出一个得分,得分越高表明该文本单元为错误的文本单元的概率越高,反之,表明该文本单元为错误的文本单元的概率越低。
在一些实施例中,预设的自然语言处理模型包括N-gram模型。在通过N-gram模型(假设为第一N-gram模型)对文本单元进行检错之前,先对第二N-gram模型进行训练,训练后得到的模型为第一N-gram模型。
在一些实施例中,可利用python调用第三方开源库kenlm对第二N-gram模型进行训练。由于kenlm是Kenneth Heafield个人开发的语言模型工具,其具有速度快、占用内存小的优点,因此,利用python调用kenlm可以更便捷地得到第一N-gram模型。
在一些实施例中,第一N-gram模型可根据以下python3程序计算出对应的 得分:
kn_model=kenlm.Model(filename)
score=math.floor(kn_model.perplexity(sentence))
其中,Model为kenlm中定义的与得分计算相关的类,将该类实例化为kn_model,filename为python3调用kenlm工具训练生成的N-gram模型文件名称,math.floor(x)用于返回小于参数x的最大整数,sentence为待计算得分的一个或连续若干个文本单元。上述的kn_model.perplexity(sentence)和kn_model.score(sentence)的关系是a=10^(-b/n):
其中,a=kn_model.perplexity(sentence),b=kn_model.score(sentence),n为文本单元的数量+1,例如当sentence为“you and me”时,n为4。
B2、在上述输入的文本单元对应的得分不满足第一预设要求时,判定上述输入的文本单元为存在错误的文本单元。
其中,第一预设要求包括:不大于10 6,即当输入自然语言处理模型的文本单元对应的得分大于10 6时,判定该文本单元为存在错误的文本单元。
上述B1和B2中,由于自然语言处理模型逐个计算文本单元的得分,因此,通过上述处理,能够排查出存在错误的单个的文本单元。
在一些实施例中,步骤S13包括:
C1、在所有的上述文本单元中,将每连续R个文本单元分为一组,得到至少两组文本单元组,R为大于1的自然数。
具体地,假设有以下文本单元:文本单元1、文本单元2和文本单元3,R为2,则将每连续R个文本单元分为一组,得到:“文本单元1和文本单元2”这一文本单元组以及“文本单元2和文本单元3”这一文本单元组。
C2、将上述文本单元组逐个输入上述的自然语言处理模型,得到该自然语言处理模型输出的与输入的文本单元组对应的得分。
C3、在上述输入的文本单元组对应的得分不满足第二预设要求时,判定上述输入的文本单元组为存在错误的文本单元组,上述存在错误的文本单元组包 括的各个文本单元均为上述存在错误的文本单元。
其中,第二预设要求与第一预设要求不同,例如,在第一预设要求包括:不大于10 6时,第二预设要求可以包括2×10 5
上述C1~C3中,由于自然语言处理模型输出的是文本单元组对应的得分,而一个文本单元组由连续R个文本单元组成,且R大于1,因此,该自然语言处理模型输出的是至少两个相邻文本单元对应的得分。也即,通过上述处理,能够识别相邻关系存在错误的相邻文本单元。
为了更清楚地描述本申请实施例提供的数据纠错方法,下面结合具体例子进行描述。
参考图2,假设对待编码的字符串进行编码,得到的编码结果为“AGGAGTCATAGA...”,但在恢复该待编码的字符串时,上述编码结果的第一个碱基出现了错误,变为“TGGAGTCATAGA...”,或者,变为“GGGAGTCATAGA...”。假设编码要求以每连续6个碱基为一个碱基组,且每一个碱基组中GC的占比为50%,则“TGGAGTCATAGA...”中的碱基组的GC占比均为50%,而“GGGAGTCATAGA...”中的第一个碱基组“GGGAGT”的GC占比为66.7%,不满足GC占比要求。
满足GC占比要求的“TGGAGTCATAGA...”将解码得到第一文本,之后,再采用N-gram模型计算得分,确定出存在错误的碱基组,假设为第1组或第2组或第3组(这些存在错误的碱基组即为目标碱基组),对这些目标碱基组进行遍历,得到多个新的碱基序列,再将这些新的碱基序列解码为多个第二文本,最后通过N-gram模型计算不同的第二文本所对应的得分,并将得分最低的第二文本作为纠正后的文本。
不满足GC占比的“GGGAGTCATAGA...”没有解码出对应的第一文本。假设带有错误的碱基组为第1组,则对第1组的碱基组进行遍历,得到多个新的碱基序列,将这些新的碱基序列解码为多个第二文本,最后通过N-gram模型计算不同的第二文本所对应的得分,并将得分最低的第二文本作为纠正后的 文本。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
实施例二:
对应于上文实施例所述的数据纠错方法,图3示出了本申请实施例提供的数据纠错装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图3,该数据纠错装置包括:第一文本确定模块31、第一文本分词模块32、错误检测模块33、纠错模块34。其中:
第一文本确定模块31,用于将待纠错的碱基序列解码为第一文本,所述待纠错的碱基序列由多个碱基组成。
第一文本分词模块32,用于对所述第一文本进行分词,得到多个文本单元;
错误检测模块33,用于对所述多个文本单元进行错误检测,得到存在错误的文本单元。
纠错模块34,用于根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。
本申请实施例中,由于对待纠错的碱基序列进行纠错之前,先将该待纠错的碱基序列解码为第一文本,因此,可通过自然语言处理领域的相关算法对该第一文本分词得到的多个文本单元进行错误检测,得到存在错误的文本单元,进而可以根据存在错误的文本单元实现对待纠错的碱基序列的纠错。而通过自然语言处理领域的相关算法对文本单元进行错误检测时,无需结合重复存储的数据就能实现,即在进行DNA存储时,不需要增加冗余量。也即,通过本申请实施例提供的数据纠错方法,不仅能够实现对数据的纠错,也能够减少数据存储时的冗余量,进而减少DNA的存储成本。
在一些实施例中,所述纠错模块34包括:
第一目标碱基组确定单元,用于根据所述存在错误的文本单元确定存在错误的碱基组,得到目标碱基组,其中,每个所述碱基组由所述待纠错的碱基序列中的每连续的N个碱基组成,N为大于1的自然数。
纠错单元,用于根据所述目标碱基组对所述待纠错的碱基序列进行纠错。
在一些实施例中,该数据纠错装置还包括:
第二目标碱基组确定单元,用于检测所述待纠错的碱基序列中是否存在不满足预设的编码要求的碱基组,并将不满足所述预设的编码要求的碱基组判定为所述目标碱基组,所述预设的编码要求为得到所述待纠错的碱基序列所采用的编码要求。
所述第一文本确定模块31具体用于:
若所述待纠错的碱基序列中不存在不满足预设的编码要求的碱基组,则将所述待纠错的碱基序列解码为第一文本。
在一些实施例中,所述预设的编码要求包括:
碱基组中的指定碱基的占比满足所述占比要求,和/或,碱基组属于预设的碱基组集合,所述预设的碱基组集合用于存储预设的多个碱基组。
本实施例中,指定碱基可以为一个碱基,也可以为两个或两个以上碱基。
在一些实施例中,上述纠错单元包括:
碱基组遍历单元,用于根据所述目标碱基组确定所有可能的碱基组,得到M个候选碱基组,M为自然数。
具体地,依次更改目标碱基组的单个碱基,以实现对该目标碱基组的遍历。
在一些实施例中,由于目标碱基组可能包括不属于预设的碱基组集合中的碱基组,而不属于预设的碱基组集合中的碱基组不能解码为对应的文本单元,因此,在对目标碱基组遍历的过程中,若遇到不属于预设的碱基组集合中的碱基组,则跳过该碱基组,即不对该碱基组进行遍历。
第二文本确定单元,用于将所述M个候选碱基组分别替换所述待纠错的碱基序列中的目标碱基组,得到M个新的碱基序列,分别解码所述M个新的碱 基序列,得到M个第二文本。
纠错后的文本确定单元,用于从所有所述第二文本中确定出一个第二文本作为所述待纠错的碱基序列对应的纠错后的文本。
具体地,可采用预设的自然语言处理模型(如N-gram模型)从多个第二文本中确定出正确的第二文本。
在一些实施例中,所述错误检测模块33包括:
单个文本单元的得分确定单元,用于将多个所述文本单元逐个输入预设的自然语言处理模型,得到自然语言处理模型输出的与输入的文本单元对应的得分。
在一些实施例中,预设的自然语言处理模型包括N-gram模型。在通过N-gram模型(假设为第一N-gram模型)对文本单元进行检错之前,先对第二N-gram模型进行训练,训练后得到的模型为第一N-gram模型。
在一些实施例中,可利用python调用第三方开源库kenlm对第二N-gram模型进行训练。由于kenlm是Kenneth Heafield个人开发的语言模型工具,其具有速度快、占用内存小的优点,因此,利用python调用kenlm可以更便捷地得到第一N-gram模型。
在一些实施例中,第一N-gram模型可根据以下公式计算出对应的得分:
Figure PCTCN2021138004-appb-000001
其中,PP(T)为得分,T为第一N-gram模型中“N”的取值,
Figure PCTCN2021138004-appb-000002
表示句子中出现
Figure PCTCN2021138004-appb-000003
时,后面出现ω i的概率。
单个错误的文本单元检测单元,用于在所述输入的文本单元对应的得分不满足第一预设要求时,判定所述输入的文本单元为存在错误的文本单元。
其中,第一预设要求包括:不大于10 6
在一些实施例中,所述错误检测模块33还包括:
文本单元组确定单元,用于在所有的所述文本单元中,将每连续R个文本 单元分为一组,得到至少两组文本单元组,R为大于1的自然数。
文本单元组的得分确定单元,用于将所述文本单元组逐个输入所述自然语言处理模型,得到所述自然语言处理模型输出的与输入的文本单元组对应的得分。
错误的文本单元组检测单元,用于在所述输入的文本单元组对应的得分不满足第二预设要求时,判定所述输入的文本单元组为存在错误的文本单元组,所述存在错误的文本单元组包括的各个文本单元均为所述存在错误的文本单元。
其中,第二预设要求与第一预设要求不同,例如,在第一预设要求包括:不大于10 6时,第二预设要求可以包括2×10 5
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
实施例三:
图4为本申请一实施例提供的电子设备的结构示意图。如图4所示,该实施例的电子设备4包括:至少一个处理器40(图4中仅示出一个处理器)、存储器41以及存储在所述存储器41中并可在所述至少一个处理器40上运行的计算机程序42,所述处理器40执行所述计算机程序42时实现上述任意各个方法实施例中的步骤。
所述电子设备4可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。该电子设备可包括,但不仅限于,处理器40、存储器41。本领域技术人员可以理解,图4仅仅是电子设备4的举例,并不构成对电子设备4的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如还可以包括输入输出设备、网络接入设备等。
所称处理器40可以是中央处理单元(Central Processing Unit,CPU),该处理器40还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit, ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器41在一些实施例中可以是所述电子设备4的内部存储单元,例如电子设备4的硬盘或内存。所述存储器41在另一些实施例中也可以是所述电子设备4的外部存储设备,例如所述电子设备4上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器41还可以既包括所述电子设备4的内部存储单元也包括外部存储设备。所述存储器41用于存储操作系统、应用程序、引导装载程序(BootLoader)、数据以及其他程序等,例如所述计算机程序的程序代码等。所述存储器41还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供了一种网络设备,该网络设备包括:至少一个处理器、存储器以及存储在所述存储器中并可在所述至少一个处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任意各个方法实施例中的步骤。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述各个方 法实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现可实现上述各个方法实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/电子设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一 个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (10)

  1. 一种数据纠错方法,其特征在于,包括:
    将待纠错的碱基序列解码为第一文本,所述待纠错的碱基序列由多个碱基组成;
    对所述第一文本进行分词,得到多个文本单元;
    对所述多个文本单元进行错误检测,得到存在错误的文本单元;
    根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。
  2. 如权利要求1所述的数据纠错方法,其特征在于,所述根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错,包括:
    根据所述存在错误的文本单元确定存在错误的碱基组,得到目标碱基组,其中,每个所述碱基组由所述待纠错的碱基序列中的每连续的N个碱基组成,N为大于1的自然数;
    根据所述目标碱基组对所述待纠错的碱基序列进行纠错。
  3. 如权利要求2所述的数据纠错方法,其特征在于,在所述将待纠错的碱基序列解码为第一文本之前,还包括:
    检测所述待纠错的碱基序列中是否存在不满足预设的编码要求的碱基组,并将不满足所述预设的编码要求的碱基组判定为所述目标碱基组,所述预设的编码要求为得到所述待纠错的碱基序列所采用的编码要求;
    所述将待纠错的碱基序列解码为第一文本,包括:
    若所述待纠错的碱基序列中不存在不满足预设的编码要求的碱基组,则将所述待纠错的碱基序列解码为第一文本。
  4. 如权利要求3所述的数据纠错方法,其特征在于,所述预设的编码要求包括:
    碱基组中的指定碱基的占比满足所述占比要求,和/或,碱基组属于预设的碱基组集合,所述预设的碱基组集合用于存储预设的多个碱基组。
  5. 如权利要求2至4任一项所述的数据纠错方法,其特征在于,所述根据所述目标碱基组对所述待纠错的碱基序列进行纠错,包括:
    根据所述目标碱基组确定所有可能的碱基组,得到M个候选碱基组,M为自然数;
    将所述M个候选碱基组分别替换所述待纠错的碱基序列中的目标碱基组,得到M个新的碱基序列,分别解码所述M个新的碱基序列,得到M个第二文本;
    从所有所述第二文本中确定出一个第二文本作为所述待纠错的碱基序列对应的纠错后的文本。
  6. 如权利要求1至4任一项所述的数据纠错方法,其特征在于,所述对所述多个文本单元进行错误检测,得到存在错误的文本单元,包括:
    将多个所述文本单元逐个输入预设的自然语言处理模型,得到自然语言处理模型输出的与输入的文本单元对应的得分;
    在所述输入的文本单元对应的得分不满足第一预设要求时,判定所述输入的文本单元为存在错误的文本单元。
  7. 如权利要求6所述的数据纠错方法,其特征在于,所述对所述多个文本单元进行错误检测,得到存在错误的文本单元,包括:
    在所有的所述文本单元中,将每连续R个文本单元分为一组,得到至少两组文本单元组,R为大于1的自然数;
    将所述文本单元组逐个输入所述自然语言处理模型,得到所述自然语言处理模型输出的与输入的文本单元组对应的得分;
    在所述输入的文本单元组对应的得分不满足第二预设要求时,判定所述输入的文本单元组为存在错误的文本单元组,所述存在错误的文本单元组包括的各个文本单元均为所述存在错误的文本单元。
  8. 一种数据纠错装置,其特征在于,包括:
    第一文本确定模块,用于将待纠错的碱基序列解码为第一文本,所述待纠 错的碱基序列由多个碱基组成;
    第一文本分词模块,用于对所述第一文本进行分词,得到多个文本单元;
    错误检测模块,用于对所述多个文本单元进行错误检测,得到存在错误的文本单元;
    纠错模块,用于根据所述存在错误的文本单元对所述待纠错的碱基序列进行纠错。
  9. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的方法。
PCT/CN2021/138004 2021-11-24 2021-12-14 数据纠错方法、装置及电子设备 WO2023092723A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111402498.0 2021-11-24
CN202111402498.0A CN114218937B (zh) 2021-11-24 2021-11-24 数据纠错方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2023092723A1 true WO2023092723A1 (zh) 2023-06-01

Family

ID=80698107

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/138004 WO2023092723A1 (zh) 2021-11-24 2021-12-14 数据纠错方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN114218937B (zh)
WO (1) WO2023092723A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110276077A (zh) * 2019-06-25 2019-09-24 上海应用技术大学 中文纠错的方法、装置及设备
US20200192983A1 (en) * 2018-12-17 2020-06-18 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and device for correcting error in text
CN112530522A (zh) * 2020-12-15 2021-03-19 中国科学院深圳先进技术研究院 序列纠错方法、装置、设备和存储介质
CN112582030A (zh) * 2020-12-18 2021-03-30 广州大学 一种基于dna存储介质的文本存储方法
CN113539370A (zh) * 2021-06-29 2021-10-22 中国科学院深圳先进技术研究院 编码方法、解码方法、装置、终端设备及可读存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11789906B2 (en) * 2014-11-19 2023-10-17 Arc Bio, Llc Systems and methods for genomic manipulations and analysis
CN106874709B (zh) * 2015-12-12 2019-03-01 北京大学 测序结果中序列数据错误的检测和校正方法
US11023680B2 (en) * 2016-02-17 2021-06-01 The King Abdulaziz City For Science And Technology (Kacst) Method and system for detecting semantic errors in a text using artificial neural networks
WO2021033981A1 (ko) * 2019-08-21 2021-02-25 울산대학교 산학협력단 Dna 저장 장치의 연성 정보 기반 복호화 방법, 프로그램 및 장치
US11755640B2 (en) * 2019-12-20 2023-09-12 The Board Of Trustees Of The University Of Illinois DNA-based image storage and retrieval
JP7443774B2 (ja) * 2020-01-14 2024-03-06 ソニーグループ株式会社 符号化装置、および符号化方法、復号装置、および復号方法、並びにプログラム
CN112100982B (zh) * 2020-08-07 2023-06-20 广州大学 Dna存储方法、系统和存储介质
CN112016304A (zh) * 2020-09-03 2020-12-01 平安科技(深圳)有限公司 文本纠错方法、装置、电子设备及存储介质
CN112232062A (zh) * 2020-12-11 2021-01-15 北京百度网讯科技有限公司 文本纠错方法、装置、电子设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200192983A1 (en) * 2018-12-17 2020-06-18 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and device for correcting error in text
CN110276077A (zh) * 2019-06-25 2019-09-24 上海应用技术大学 中文纠错的方法、装置及设备
CN112530522A (zh) * 2020-12-15 2021-03-19 中国科学院深圳先进技术研究院 序列纠错方法、装置、设备和存储介质
CN112582030A (zh) * 2020-12-18 2021-03-30 广州大学 一种基于dna存储介质的文本存储方法
CN113539370A (zh) * 2021-06-29 2021-10-22 中国科学院深圳先进技术研究院 编码方法、解码方法、装置、终端设备及可读存储介质

Also Published As

Publication number Publication date
CN114218937B (zh) 2022-12-02
CN114218937A (zh) 2022-03-22

Similar Documents

Publication Publication Date Title
WO2021135910A1 (zh) 基于机器阅读理解的信息抽取方法、及其相关设备
Li et al. The similarity metric
US6925467B2 (en) Byte-level file differencing and updating algorithms
US8812513B2 (en) Hash pointer checking for hierarchical database logical relationship
GB1570344A (en) Information storage and retrieval system
CN106788468B (zh) 一种纠删码更新方法及装置,电子设备
US10078646B2 (en) Hardware efficient fingerprinting
CN105302924A (zh) 一种文件管理方法及装置
WO2020001638A1 (zh) 一种提高Turbo译码性能的方法、装置及计算机设备
US11467905B1 (en) Stripe merging method and system based on erasure codes
KR102339723B1 (ko) Dna 저장 장치의 연성 정보 기반 복호화 방법, 프로그램 및 장치
CN112949290B (zh) 文本纠错方法、装置及通信设备
CN114201756A (zh) 一种智能合约代码片段的漏洞检测方法和相关装置
WO2023092723A1 (zh) 数据纠错方法、装置及电子设备
CN115982310B (zh) 一种自带验证功能的链表生成方法及电子设备
US20130204839A1 (en) Validating Files Using a Sliding Window to Access and Correlate Records in an Arbitrarily Large Dataset
WO2016122318A1 (en) A computer implemented method for generating a variant call file
CN112530522B (zh) 序列纠错方法、装置、设备和存储介质
CN114417834A (zh) 文本的处理方法、装置、电子设备及可读存储介质
CN114528824A (zh) 文本纠错方法、装置、电子设备及存储介质
US10404276B1 (en) Stable variable-length order-preserving encoding scheme
CN109299260B (zh) 数据分类方法、装置以及计算机可读存储介质
Isroil et al. Increasing the Reliability of Full Text Documents Based on the Use of Mechanisms for Extraction of Statistical and Semantic Links of Elements
Gajalwar et al. Erasure Coding and Data Deduplication: A Comprehensive Survey
JPH05252049A (ja) データ圧縮処理方式及びデータ復元処理方式

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21965444

Country of ref document: EP

Kind code of ref document: A1