High-precision sequence reconstruction method based on branch prediction
By using a branch prediction sequence reconstruction method in the DNA storage system, and using multiple consecutive bits in the replica sequence for reconstruction, the problem of insufficient reconstruction accuracy in the prior art is solved, and a higher sequence reconstruction accuracy is achieved.
Patent Information
- Application Number
- CN202510560935.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-26
AI Technical Summary
The existing BMA-DDC algorithm fails to fully utilize the replica sequence information during sequence reconstruction in DNA storage systems, resulting in low reconstruction accuracy.
Using a sequence reconstruction method based on branch prediction, through branch prediction tree construction and depth-first search strategy, multiple consecutive bits in the replica sequence are used for reconstruction, instead of single bit voting in the BMA algorithm, and the reconstruction accuracy is improved.
Effectively reduce the normalized Levinstein distance between the reconstructed sequence and the original sequence, improve the sequence reconstruction accuracy, and improve the accuracy of sequence reconstruction.
Smart Images

Figure CN120544696A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of information storage, and in particular relates to a high-precision sequence reconstruction method based on branch prediction. Background Art
[0002] Advances in artificial intelligence have ushered in an era of information explosion, with data volumes showing exponential growth. Against this backdrop, the need for innovative storage technologies is increasingly urgent to address the enormous challenges posed by this data explosion. DNA storage technology offers significant advantages over traditional magnetic, optical, and dielectric storage technologies, thanks to its ultra-high storage density, long-lasting storage lifespan, and relatively low maintenance costs. It is considered a key solution for breaking through the bottleneck of massive data storage. In DNA storage systems, data is typically stored using the four bases A, T, C, and G. This process is primarily based on DNA synthesis, polymerase chain reaction (PCR) amplification, and DNA sequencing. During the information access process in DNA storage systems, multiple copies of the original DNA coding sequence are generated. These copies may contain certain base editing errors relative to the original sequence, including insertions, substitutions, and deletions, with deletions and substitutions being more likely to occur. During the data read phase, accurate recovery of the original DNA sequence is required based on these error-prone copies.
[0003] The data access process described above can be modeled as follows: the process that causes editing errors in a DNA storage system can be viewed as an editing channel model, where the input of the channel is the original DNA sequence, and the output of the channel is a DNA replica sequence with editing errors. By transmitting the original DNA sequence multiple times over this editing channel, several replica sequences with editing errors are obtained, and the original DNA sequence needs to be reconstructed based on these replica sequences. This process is similar to the sequence reconstruction problem currently studied in academia, so it is worth studying the sequence reconstruction problem in the context of DNA storage to address the data reliability issues faced by DNA storage.
[0004] In his paper “Optimal Codes Detecting Deletions in Concatenated Binary Strings Applied to Trace Reconstruction” (IEEE Transactions on Information Theory, 2023, 69(9), pp.5687-5700.), Hanna proposed a code that can detect deletion errors under a deletion channel—deletion detection code, and proposed an efficient sequence reconstruction algorithm based on this codeword, namely the Bitwise Majority Alignment Based on Deletion Detecting Codes (BMA-DDC) algorithm. The erasure detection code divides the original sequence into multiple subsequences of the same length by adding δ+1 redundant bits at the beginning of each sequence and δ redundant bits different from the beginning at the end. After a deletion error occurs in the sequence, the deletion error can be detected by the redundant bits, and at most δ deletion errors can be detected in each subsequence. The sequence reconstruction algorithm uses the grouping characteristics of the erasure detection code. After the original sequence is deleted through the channel to obtain several replica sequences, each replica sequence is grouped based on the erasure detection code. The Bitwise Majority Alignment (BMA) algorithm proposed by Batu et al. in the paper "Reconstructing strings from random traces" (Proceedings of the fifteenth Annual ACM-SIAM Symposium on Discrete Algorithms, 2004, 4, pp. 910-918) is used to reconstruct the sequence. Finally, each set of reconstruction results is spliced in sequence to obtain the reconstructed sequence.
[0005] The shortcomings of the existing BMA-DDC algorithm are that the BMA algorithm used in the sequence reconstruction process after the replica sequences are grouped based on the erasure detection code only relies on the single bit that votes in each replica sequence during the reconstruction process, ignoring the indication information of the subsequent consecutive bits of the voting bit on the reconstruction bit, failing to fully utilize the information in the replica sequence, resulting in low sequence reconstruction accuracy. Summary of the Invention
[0006] To overcome the shortcomings of the prior art, the present invention provides a high-precision sequence reconstruction method based on branch prediction. When reconstructing a sequence using a voting-based approach in an erasure channel, the bits following a voting bit in the replica sequence provide information indicating whether that voting bit has been deleted. To fully utilize this information, the present invention utilizes multiple consecutive bits in the replica sequence during the grouped sequence reconstruction process based on the principle of branch prediction. This method effectively reduces the normalized Levenshtein distance between the reconstructed sequence and the original sequence, thereby improving sequence reconstruction accuracy.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0008] A high-precision sequence reconstruction method based on branch prediction includes the following steps:
[0009] Step 1: Get the replica sequence matrix Y, set the sequence reconstruction parameters and calculate the sequence group length l. The sequence reconstruction parameters include the reconstructed sequence length L, the deletion probability p of the deletion channel d , the deletion detection code flag parameter δ and the number of copy sequences t;
[0010] The expression of the replica sequence matrix Y is as follows:
[0011] Y={y1,y2,...,y t} T
[0012] Among them, y i represents the i-th copy sequence, i.e., the sequence with erasure errors obtained by the original binary sequence x after the i-th erasure channel, i = [1, t];
[0013] Step 2: Based on the erasure detection code, the i-th copy sequence y in the copy sequence matrix Y i Group and get the copy sequence y i The m group starting position set start i ;
[0014] start i ={start i1 ,start i2 ,...,start im}
[0015] Among them, start ik Represents the i-th copy sequence y i The starting position of the kth group, k∈[1,m], Indicates the number of groups;
[0016] Step 3: Repeat step 2 until all t copies of sequence y are completed i The groups are divided into t copies of sequence y i The m group starting position set start i ; According to the t copy sequence y i The m group starting position set start i , get the grouped copy sequence matrix Y grouped , the expression is as follows:
[0017] Y grouped ={Y 1_grouped ,Y 2_grouped ,...,Y m_grouped}
[0018] Among them, Y k_grouped represents the kth set of replica sequence matrix, Y k_grouped ={y 1k ,y 2k ,...,y tk} T ,y ik Represents the i-th copy sequence y i The kth group, that is, the copy sequence y i Start ik to the start i(k+1) -1-bit subsequence; in particular, y im Represents the copy sequence y i The mth group, that is, the copy sequence y i Start im bit to copy sequence y i The subsequence consisting of the end of ;
[0019] Step 4: Set the pointer array index[t] = {index1, index2, ..., index t}, where index i Points to the i-th copy sequence y i Pointer to the voting position, all pointers index i Initialized to 1; set an initial sequence of length l And initialize it to an empty sequence; at the same time, set the current reconstruction bit pos and initialize the reconstruction bit pos to 1; set the prediction length α of branch prediction, α>1; based on the sequence reconstruction algorithm of branch prediction, the kth group of copies sequence matrix Y k_grouped Perform sequence reconstruction to obtain a pre-reconstruction result of length α If pos+α-1≥l, the pre-reconstructed result Fill to initial sequence The lth position, at this time the kth group of copy sequence matrix Y k_grouped The reconstruction is completed and the reconstructed sequence of length l is obtained Otherwise the result will be pre-reconstructed Fill to initial sequence From the posth bit to the pos+α-1th bit, let pos=pos+α and perform the next round of branch prediction pre-reconstruction;
[0020] Step 5: Repeat step 4 until all m sets of copy sequence matrices Y are completed k_grouped Reconstruction, we get m groups of reconstructed sequences with length l Reconstruct the sequence based on the length of m groups being l The final length of the reconstructed sequence is L. The expression is as follows:
[0021]
[0022] In step 4, the branch prediction process is as follows: a branch prediction tree is constructed based on a depth-first search strategy, wherein each path formed by the root node to the bottom leaf node is a branch, and each node represents a possible situation when performing branch prediction pre-reconstruction based on the voting bits pointed to by the pointer array index[t], including three situations: no deletion error occurs, a deletion 0 error occurs, and a deletion 1 error occurs, specifically:
[0023] Case 1: The bit values of the t voting positions pointed to by the pointer array index[t] are exactly the same. It is predicted that no deletion error has occurred at the position pointed to by the pointer array index[t]. The bit value of the current position to be reconstructed is set to the bit value of the voting position pointed to by the pointer array index[t]. There is no need to change the error weight. All pointers in the pointer array index[t] are incremented by 1.
[0024] Case 2: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. A deletion error occurs at the position pointed to by the predicted pointer array index[t], and it is considered that 0 has been deleted. The bit value of the current pre-reconstructed position is set to 0, and the error weight needs to be increased by 1 for each voting position pointed to by the pointer. After the error weight calculation is completed, the pointer array index[t] is updated. At this time, all pointers pointing to voting positions with a bit value of 0 are increased by 1. When voting for the next pre-reconstructed position in this sequence, it is necessary to vote at the position next to the position currently pointed to by the corresponding pointer in this sequence.
[0025] Case 3: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. It is predicted that a deletion error occurs at the position pointed to by the pointer array index[t]. It is considered that 1 is deleted, and the bit value of the current pre-reconstructed position is set to 1. For every time a pointer points to a voting position with a bit value of 0, the error weight needs to be increased by one. After the error weight calculation is completed, the pointer array index[t] is updated. At this time, all pointers pointing to voting positions with a bit value of 1 are increased by 1. When voting for the next pre-reconstructed bit in this sequence, it is necessary to use the position next to the position currently pointed to by the corresponding pointer in this sequence to vote.
[0026] In step 4, in each round of branch prediction, the error weights of all branch paths are compared, and the branch with the smallest error weight is selected as the pre-reconstruction result. And update the pointer array to the situation corresponding to the branch path.
[0027] In step 4, fill Y with characters other than 0 and 1 k_grouped Each sequence in , so that the length of each sequence is l.
[0028] In step 4, before each round of branch prediction pre-reconstruction begins, the initial error weight weight=0.
[0029] In step 1, the reconstructed sequence length L adopts the known length of the original binary sequence.
[0030] In step 1, the calculation formula of the sequence group length l is as follows:
[0031]
[0032] Among them, p d is the deletion probability of the deleted channel.
[0033] In step 2, the copy sequence y i The starting position set after grouping start i The determination process is as follows:
[0034] If the starting position of the current group is start i1 , that is, k=1, then let start i1 =1, and start i1 Add the starting position set start i middle;
[0035] If the starting position of the current group is start ik , k∈[1,m], first scan the copy sequence y i Start i(k-1) +l-δ position to the start i(k-1)+l-1 bit, find the position where the first redundant bit appears. If no redundant bit appears, it means that no deletion error occurs in the group, then start ik =start i(k-1) +l; otherwise, the position where the first redundant bit appears is error k-1 , error k-1 ∈[start i(k-1) +l-δ,start i(k-1) +l-1], represents the copy sequence y i The k-1th group has errornum k-1 =δ-[error k-1 -(start k-1 +l-δ)] deletion errors, so start ik =start i(k-1) +l-errornum k-1 ; After completing the judgment process, start ik Add the starting position set start i Until the replica sequence y is determined i The starting position of m groups, get the copy sequence y i The m group starting position set start i .
[0036] Compared with the prior art, the present invention has the following beneficial effects:
[0037] 1. Since the present invention uses a branch prediction-based sequence reconstruction algorithm instead of the BMA algorithm to reconstruct each group of replica sequences after grouping based on the erasure detection code, and the branch prediction-based sequence reconstruction algorithm uses branch prediction to reconstruct multiple bits at a time, it can better utilize the indication information in the replica sequence, overcome the disadvantage that the BMA algorithm only involves a single bit of the replica sequence in each round of voting, resulting in the inability to fully utilize the replica sequence information, and improves the accuracy of sequence reconstruction.
[0038] 2. In existing sequence reconstruction algorithms based on majority voting, such as the BMA algorithm and the BMA-DDC algorithm, the voting process can be viewed as selecting a single bit that best matches the current replica sequence as the corresponding bit for the reconstruction bit. In the branch prediction process of the present invention, based on the bit conditions in each replica sequence pointed to by the pointer array, the continuous α-bit reconstruction bits that best match the current replica sequence are selected. Compared with existing sequence reconstruction algorithms based on majority voting, the present invention has higher reconstruction sequence accuracy.
[0039] In summary, compared with the prior art, the present invention, in the process of sequence reconstruction after grouping, uses multiple consecutive bits in the replica sequence based on the idea of branch prediction and reconstructs multiple consecutive bits at the same time, which can effectively reduce the normalized Levenshtein distance between the reconstructed sequence and the original sequence and improve the sequence reconstruction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a flow chart of the high-precision sequence reconstruction method based on branch prediction of the present invention.
[0041] Figure 2 The branch prediction tree constructed for the present invention.
[0042] Figure 3 This is an example of one round of branch prediction pre-reconstruction in all branch prediction processes of the present invention.
[0043] Figure 4 yes Figure 3 The branch prediction tree formed by the pre-reconstruction process is shown.
[0044] Figure 5 It is a simulation system framework diagram during the simulation process of the present invention.
[0045] Figure 6 This is a comparison chart of the accuracy of different sequence reconstruction algorithms of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0047] like Figure 1 As shown, a high-precision sequence reconstruction method based on branch prediction includes the following steps:
[0048] Step 1: The original binary sequence x is passed through the deletion channel to output t copies of the sequence y with deletion errors. i , obtain the replica sequence matrix Y; set the sequence reconstruction parameters, which include the reconstruction sequence length L, the deletion probability p of the deletion channel d , the deletion detection code flag parameter δ and the number of copy sequences t; the reconstructed sequence length L adopts the known length of the original binary sequence x;
[0049] According to the deletion probability p of the deletion channel d Calculate the sequence group length l, the formula is as follows:
[0050]
[0051] The expression of the replica sequence matrix Y is as follows:
[0052] Y={y1,y2,...,yt} T
[0053] Among them, y i represents the i-th copy sequence, i.e., the sequence with erasure errors obtained by the original binary sequence x after the i-th erasure channel, i = [1, t];
[0054] Step 2: Based on the erasure detection code, the i-th copy sequence y in the copy sequence matrix Y i Group and get the copy sequence y i The m group starting position set start i ;
[0055] start i ={start i1 ,start i2 ,...,start im}
[0056] Among them, start ik Represents the i-th copy sequence y i The starting position of the kth group, k∈[1,m], Indicates the number of groups.
[0057] Copy sequence y i The m group starting position set start i The determination process is as follows:
[0058] If the starting position of the current group is start i1 , that is, k=1, then let start i1 =1, and start i1 Add the starting position set start i In the process of determining the starting position of each group, it is assumed that the starting position of the previous group is definitely determined;
[0059] If the starting position of the current group is start ik , k∈[2,m], first scan the copy sequence y i Start i(k-1) +l-δ position to the start i(k-1) +l-1 bit, find the position where the first redundant bit appears. If no redundant bit appears, it means that no deletion error occurs in the group, then start ik =start i(k-1) +l; otherwise, the position where the first redundant bit appears is error k-1 , error k-1 ∈[start i(k-1) +l-δ,starti(k-1) +l-1], represents the copy sequence y i The k-1th group has errornum k-1 =δ-[error k-1 -(start k-1 +l-δ)] deletion errors, so start ik =start i(k-1) +l-errornum k-1 After completing the above judgment process, start ik Add the starting position set start i Until the replica sequence y is determined i The starting position of m groups, get the copy sequence y i The m group starting position set start i .
[0060] Step 3: Repeat step 2 until all t copies of sequence y are completed i The groups are divided into t copies of sequence y i The m group starting position set start i ; According to the t copy sequence y i The m group starting position set start i , get the grouped copy sequence matrix Y grouped , the expression is as follows:
[0061] Y grouped ={Y 1_grouped ,Y 2_grouped ,...,Y m_grouped}
[0062] Among them, Y k_grouped represents the kth set of replica sequence matrix, Y k_grouped ={y 1k ,y 2k ,...,y tk} T ,y ik Represents the i-th copy sequence y i The kth group, that is, the copy sequence y i Start ik to the start i(k+1) -1-bit subsequence; in particular, y im Represents the copy sequence y i The mth group, that is, the copy sequence y i Start im bit to copy sequence y i The subsequence consisting of the end of ;
[0063] Step 4: Set the pointer array index[t] = {index1, index2, ..., index t}, where index i Points to the i-th copy sequence y i Pointer to the voting position, all pointers index i Initialized to 1, that is, all pointer index i Points to its corresponding copy sequence y i The starting position; set an initial sequence of length l And initialize it to an empty sequence; at the same time, set the current reconstruction bit pos and initialize the reconstruction bit pos to 1; set the predicted length α of the branch prediction, α>1; fill Y with characters other than 0 and 1 k_grouped Each sequence in the group is made to have a length of l, and then the sequence reconstruction algorithm based on branch prediction is used to reconstruct the kth group of copies sequence matrix Y k_grouped Perform sequence reconstruction to obtain a pre-reconstruction result of length α If pos+α-1≥l, the pre-reconstructed result Fill to initial sequence The lth position, at this time the kth group of copy sequence matrix Y k_grouped The reconstruction is completed and the reconstructed sequence of length l is obtained Otherwise the result will be pre-reconstructed Fill to initial sequence From the posth bit to the pos+α-1th bit, let pos=pos+α, and perform the next round of branch prediction pre-reconstruction. Before each round of branch prediction pre-reconstruction begins, let the initial error weight weight=0.
[0064] The branch prediction process is as follows:
[0065] Figure 2 It is a branch prediction tree constructed according to the depth-first search strategy, in which each path from the root node to the bottom leaf node is a branch. Each node represents a possible situation when performing branch prediction pre-reconstruction based on the voting bits pointed to by the pointer array index[t], including three situations: no deletion error occurs, deletion 0 error occurs, and deletion 1 error occurs. In each case, the pre-reconstruction bit will be set to a different value. For each case, the algorithm has a different processing method, as follows:
[0066] Case 1: The bit values of the t voting positions pointed to by the pointer array index[t] are exactly the same, so it is predicted that no deletion error has occurred:
[0067] Since the bit values of the t voting positions pointed to by pointer array index[t] are exactly the same, it is predicted that no erasure error has occurred at the position pointed to by pointer array index[t]. The bit value of the current position to be pre-reconstructed is set to the bit value of the voting position pointed to by pointer array index[t]. Since no erasure error has been predicted, there is no need to change the error weight. All pointers in pointer array index[t] are incremented by 1, and pre-reconstruction of the next position is performed.
[0068] Case 2: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. A deletion error is predicted and it is considered that 0 is deleted:
[0069] Because the bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same, it is predicted that an erasure error has occurred at the position pointed to by the pointer array index[t]. In this case, it is predicted that 0 has been deleted, so the bit value of the current pre-reconstructed position is set to 0. Since it is predicted that an erasure error has occurred, in this case, the position where the voting position pointed to by the pointer has a bit value of 1 is considered to have undergone an erasure error. Therefore, the error weight needs to be increased by one for each voting position pointed to by the pointer with a bit value of 1. After the error weight calculation is completed, the pointer array index[t] needs to be updated. At this time, all pointers pointing to voting positions with a bit value of 0 are increased by 1, indicating that in their corresponding replica sequence, the position they point to did not undergo an erasure error and made a correct vote. When voting on the next pre-reconstructed position in this sequence, the position next to the position currently pointed to by the corresponding pointer in this sequence needs to be voted.
[0070] Case 3: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. A deletion error is predicted, and it is considered that 1 is deleted:
[0071] Because the bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same, it is predicted that an erasure error has occurred at the position pointed to by the pointer array index[t]. In this case, it is predicted that 1 has been deleted, so the bit value of the current pre-reconstructed position is set to 1. Since an erasure error of 1 is predicted, in this case, the position where the voting position pointed to by the pointer has a bit value of 0 is considered to have undergone an erasure error. Therefore, the error weight needs to be increased by one every time a pointer points to a voting position with a bit value of 0. After the error weight calculation is completed, the pointer array index[t] needs to be updated. At this time, all pointers pointing to voting positions with a bit value of 1 are increased by 1, indicating that in the corresponding replica sequence, the position pointed to by them did not undergo an erasure error and a correct vote was made. When voting on the next pre-reconstructed bit in this sequence, the position next to the position currently pointed to by the corresponding pointer in this sequence needs to be voted.
[0072] In each round of branch prediction, a branch prediction tree with a height of α+1 is constructed based on the depth-first algorithm according to the voting bits in each copy sequence pointed to by the pointer array index[t]. During the construction process, the pointer array index[t] and the error weight of each branch path need to be updated according to the three cases mentioned above based on the voting bits. Each branch needs to be judged α times; finally, the error weights of all branch paths are compared, and the branch with the smallest error weight is selected as the pre-reconstruction result. And update the pointer array to the situation corresponding to the branch path.
[0073] Step 5: Repeat step 4 until all m sets of copy sequence matrices Y are completed k_grouped Reconstruction, we get m groups of reconstructed sequences with length l Reconstruct the sequence by setting the length of m groups to be l Splice in sequence to obtain a reconstructed sequence with a final length of L The expression is as follows:
[0074]
[0075] The following combination Figure 3 and Figure 4 Describe an example of a branch prediction algorithm. Figure 3 It is one of the branch prediction pre-reconstruction processes in all branch prediction pre-reconstruction processes. Figure 3 Each rectangle in the figure represents a step in the pre-reconstruction process. The rectangle contains the original sequence x, the copy sequences y1, y2, ..., y in the current step. t and pre-reconstruction sequence In the case of , the bit values of the voting bits and the pre-reconstructed bits voted out in the current step are both underlined; Figure 4 yes Figure 3 The branch prediction tree formed by the pre-reconstruction process is shown in FIG. Figure 4 The text on the edge of the branch prediction tree node describes the pre-reconstruction result and error weight in this case. After the branch prediction tree leaf node, the pre-reconstruction sequence of the branch path corresponding to the leaf node and the path weight are explained.
[0076] Example 1: Assume that the original sequence x = 001001 and that it is transmitted five times through a binary erasure channel, resulting in five replica sequences, y1 = 1001, y2 = 01001, y3 = 001001, y4 = 01001, and y5 = 001001. First, the replica sequences are padded according to step 4, using the padding character "*". The padded replica sequences are y1 = 1001**, y2 = 01001*, y3 = 001001, y4 = 01001*, and y5 = 001001. Initialize the pointer array index[5] to index[5] = {1, 1, 1, 1, 1}, set the prediction length α of the branch prediction to 4, and set the initial error weight weight to 0.
[0077] When index[5]={1,1,1,1,1}, the bit values of the voting bits pointed to by the pointer array index[5] are not completely consistent, which belongs to Case 2 and Case 3. First, predict the occurrence of Case 2 and perform pre-reconstruction of Case 2, such as Figure 3 As shown in step 1, the bit value of the pre-reconstruction bit is set to 0. Among all replica sequences, the bit value of the voting bit of replica sequence y1 is 1. Therefore, the error weight increases by 1, and weight = 1 at this time, and its pointer index1 remains unchanged. The bit values of the voting bits of replica sequences y2, y3, y4, and y5 are all 0, so the pointers of replica sequences y2, y3, y4, and y5, that is, index2, index3, index4, and index5, are increased by 1 respectively. At this time, the pointer array index[5] = {1, 2, 2, 2, 2}, and the pre-reconstruction depth is 1.
[0078] When index[5]={1,2,2,2,2}, the bit values of the voting bits pointed to by the pointer array are not completely consistent, which belongs to Case 2 and Case 3. First, predict the occurrence of Case 2 and perform pre-reconstruction of Case 2, such as Figure 3 As shown in step 2, the bit value of the pre-reconstruction bit is set to 0. Among all replica sequences, the bit value of the voting bit of replica sequences y1, y2, and y4 is 1. Therefore, the error weight increases by 3, and weight = 4. The corresponding pointers index1, index2, and index4 remain unchanged. The bit values of the voting bits of replica sequences y3 and y5 are both 0. Therefore, the pointers of replica sequences y3 and y5, i.e. index3 and index5, are increased by 1 respectively. At this time, the pointer array index[5] = {1, 2, 3, 2, 3}, and the pre-reconstruction depth is 2.
[0079] When index[5]={1,2,3,2,3}, the voting bits pointed to by the pointer array are exactly the same, which belongs to case 1. Case 1 is predicted to occur. Figure 3As shown in step 3, since the voting bits of the replica sequences y1, y2, y3, y4 and y5 are all 1 at this time, the bit value of the pre-reconstruction bit is set to 1, the error weight remains unchanged, and weight = 4, and the corresponding pointers of all replica sequences are increased by 1. At this time, the pointer array index[5] = {2, 3, 4, 3, 4}, and the pre-reconstruction depth is 3.
[0080] When index[5]={2,3,4,3,4}, the voting bits pointed to by the pointer array are exactly the same, which belongs to case 1. Case 1 is predicted to occur. Figure 3 As shown in step 4, since the voting bits of replica sequences y1, y2, y3, y4, and y5 are all 1 at this time, the pre-reconstruction bit value is set to 1, the error weight remains unchanged, and weight = 4, and the corresponding pointers of all replica sequences are increased by 1. At this time, the pointer array index[5] = {3,4,5,4,5}, and the pre-reconstruction depth is 4. At this time, the maximum depth α has been reached, so it is necessary to record the current state, that is, to keep the current pre-reconstruction result Pointer array index[5]={3,4,5,4,5} and error weight weight1=4, and backtrack to the previous branch, which should be Figure 4 In step 5 shown in , the state of the pointer array in step 5 is index[5]={1,2,2,2,2}, and weight=1.
[0081] When index[5]={1,2,2,2,2}, the bit values of the voting bits pointed to by the pointer array are not completely consistent, which belongs to Case 2 and Case 3. Since the pre-reconstruction of Case 2 has been performed, the pre-reconstruction of Case 3 is performed, such as Figure 3 As shown in step 5, the bit value of the pre-reconstruction bit is set to 1. Among all replica sequences, the bit value of the voting bit of replica sequences y3 and y5 is 0, so the error weight increases by 2, and weight = 3 at this time. The corresponding pointers index3 and index5 remain unchanged. The bit value of the voting bit of replica sequences y1, y2, and y4 are all 1, so the pointers of replica sequences y1, y2, and y4, that is, index1, index2, and index4, are increased by 1 respectively. At this time, the pointer array index[5] = {2, 3, 2, 3, 2}, and the pre-reconstruction depth is 2.
[0082] And so on, until all branch paths are traversed, we get Figure 4The branch tree shown has 5 leaf nodes, i.e. 5 branch paths, and their corresponding error weights are weight1=4, weight2=5, weight3=6, weight3=6, weight5=7. The smallest error weight is weight1=4, so weight1 is selected as the pre-reconstruction result of this round. The initial pointer array of the next round of pre-reconstruction is set to the corresponding situation of the branch path, that is, index[5]={3,4,5,4,5}, and the next branch prediction tree is constructed for a new round of pre-reconstruction.
[0083] Until all bits are reconstructed, the reconstructed sequence is obtained Consistent with the original sequence x=001001, the reconstruction algorithm based on branch prediction is successful.
[0084] Simulation conditions:
[0085] In the simulation, the Figure 5 The simulation system shown in the figure is used for simulation. The simulation system includes a sequence generator, an erasure channel, and a sequence reconstructor, wherein the sequence generator is used to generate a sequence based on the sequence length L, the erasure detection code flag parameter δ, and the erasure probability p of the erasure channel. d Generate the original binary sequence x based on the erasure detection code; the erasure channel is used to input each bit of the original sequence x with independent erasure probability p d After deletion, a copy sequence with deletion error is output; the sequence reconstructor is used to reconstruct the input copy sequence matrix Y based on the sequence length L, the deletion detection code flag parameter δ and other parameters using the sequence reconstruction algorithm based on branch prediction to obtain a reconstructed sequence of length L The sequence reconstruction algorithm refers to the present invention and the existing sequence reconstruction algorithm under deletion channel.
[0086] The simulation process is as follows: the sequence generator generates an original binary sequence x of length L, and after the original sequence x passes through the deletion channel t times, t replica sequences with deletion errors are obtained. These t replica sequences are combined into a replica sequence matrix Y, and the replica sequence matrix Y is input into the sequence reconstructor to use the sequence reconstruction algorithm to reconstruct the sequence and obtain the reconstructed sequence
[0087] The hardware environment of the experimental simulation is the Window 10 operating system, the CPU is the Intel i7-9700 CPU, the programming language is C++, and the IDE is Visual Studio 2022.
[0088] Simulation content:
[0089] The algorithms used in the sequence reconstruction in the simulation are the bit majority alignment algorithm based on erasure detection code (BMA-DDC) mentioned by Hanna and the sequence reconstruction algorithm based on branch prediction (BPBMA-DDC) of the present invention. The parameters of the simulation system are as follows: d =0.01, the deletion detection code flag parameter δ=3, the prediction depth of branch prediction α=3, the reconstructed sequence length L=1000, and the sequence group length l=1 / p d =100.
[0090] The simulation results are as follows Figure 6 shown. Figure 6 The reconstruction accuracy comparison between the BPBMA-DDC algorithm proposed in this invention and the BMA-DDC algorithm is shown in the figure under different sizes of replica sequence matrices Y. Figure 6 The horizontal axis is the number of replica sequences t in the replica sequence matrix Y, and the vertical axis is the average normalized Levenshtein distance between the reconstructed sequence obtained by each algorithm performing 1000 sequence reconstructions at different t and the original sequence, using a semi-logarithmic coordinate system. Figure 6 The curve marked with a square in the figure is the average normalized Levenshtein distance of 1000 simulation experiments of the BMA-DDC algorithm with different numbers of replica sequences. Figure 6 The curve marked with a circle in FIG is the average normalized Levenshtein distance of 1000 simulation experiments of the BPBMA-DDC algorithm proposed in the present invention with different numbers of replica sequences.
[0091] Depend on Figure 6It can be seen that compared with the two existing sequence reconstruction algorithms under deletion channels, when the number of replica sequences t = 3, the normalized Levenshtein distance of the BMA-DDC algorithm is approximately twice that of the BPBMA-DDC algorithm. When the number of replica sequences t = 5, the normalized Levenshtein distance of the BMA-DDC algorithm is approximately four times that of the BPBMA-DDC algorithm. In general, under different numbers of replica sequences t, the normalized Levenshtein distance of the BPBMA-DDC algorithm proposed in the present invention decreases to varying degrees compared with the BMA algorithm and the BMA-DDC algorithm, that is, the sequence reconstruction accuracy is improved to varying degrees, indicating that the BPBMA-DDC algorithm of the present invention can significantly improve the similarity between the reconstructed sequence and the original sequence, and the sequence reconstruction accuracy is higher; and as the number of replica sequences t used increases, the improvement in the sequence reconstruction accuracy of the BPBMA-DDC algorithm of the present invention relative to the BMA-DDC algorithm will also increase. This is because in the sequence reconstruction process, compared with the BMA-DDC algorithm, which only relies on a single bit in each replica sequence for voting when voting, the BPBMA-DDC algorithm of the present invention is based on the branch prediction idea during reconstruction, and simultaneously considers multiple consecutive bits in each replica sequence, which can make more full use of the information in the replica sequence, thereby improving the sequence reconstruction accuracy.
Claims
1. A high-precision sequence reconstruction method based on branch prediction, characterized in that: The following steps are involved: Step 1: Get the replica sequence matrix Y, set the sequence reconstruction parameters and calculate the sequence group length l. The sequence reconstruction parameters include the reconstructed sequence length L, the deletion probability p of the deletion channel d , the deletion detection code flag parameter δ and the number of copy sequences t; The expression of the replica sequence matrix Y is as follows: Y={y1,y2,...,y t } T Among them, y i represents the i-th copy sequence, i.e., the sequence with erasure errors obtained by the original binary sequence x after the i-th erasure channel, i = [1, t]; Step 2: Based on the erasure detection code, the i-th copy sequence y in the copy sequence matrix Y i Group and get the copy sequence y i The m group starting position set start i ; start i ={start i1 ,start i2 ,...,start im } Among them, start ik Represents the i-th copy sequence y i The starting position of the kth group, k∈[1,m], Indicates the number of groups; Step 3: Repeat step 2 until all t copies of sequence y are completed i The groups are divided into t copies of sequence y i The m group starting position set start i ; According to the t copy sequence y i The m group starting position set start i , get the grouped copy sequence matrix Y grouped , the expression is as follows: AND grouped ={And 1_grouped ,AND 2_grouped ,...,AND m_grouped } Among them, Y k_grouped represents the kth set of replica sequence matrix, Y k_grouped ={y 1k ,y 2k ,...,y tk } T ,y ik Represents the i-th copy sequence y i The kth group, that is, the copy sequence y i Start ik to the start i(k+1) -1-bit subsequence; in particular, y im Represents the copy sequence y i The mth group, that is, the copy sequence y i Start im bit to copy sequence y i The subsequence consisting of the end of ; Step 4: Set the pointer array index[t] = {index1, index2, ..., index t }, where index i Points to the i-th copy sequence y i Pointer to the voting position, all pointers index i Initialized to 1; set an initial sequence of length l And initialize it to an empty sequence; at the same time, set the current reconstruction bit pos and initialize the reconstruction bit pos to 1; set the prediction length α of branch prediction, α>1; based on the sequence reconstruction algorithm of branch prediction, the kth group of copies sequence matrix Y k_grouped Perform sequence reconstruction to obtain a pre-reconstruction result of length α If pos+α-1≥l, the pre-reconstructed result Fill to initial sequence The lth position, at this time the kth group of copy sequence matrix Y k_grouped The reconstruction is completed and the reconstructed sequence of length l is obtained Otherwise the result will be pre-reconstructed Fill to initial sequence From the posth bit to the pos+α-1th bit, let pos=pos+α and perform the next round of branch prediction pre-reconstruction; Step 5: Repeat step 4 until all m sets of copy sequence matrices Y are completed k_grouped Reconstruction, we get m groups of reconstructed sequences of length l Reconstruct the sequence based on the length of m groups being l The final length of the reconstructed sequence is L. The expression is as follows:
2. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 4, the branch prediction process is as follows: A branch prediction tree is constructed based on a depth-first search strategy, where each path from the root node to the bottom leaf node is a branch. Each node represents a possible situation when performing branch prediction pre-reconstruction based on the voting bits pointed to by the pointer array index[t], including three situations: no deletion error, deletion 0 error, and deletion 1 error. Specifically: Case 1: The bit values of the t voting positions pointed to by the pointer array index[t] are exactly the same. It is predicted that no deletion error has occurred at the position pointed to by the pointer array index[t]. The bit value of the current position to be reconstructed is set to the bit value of the voting position pointed to by the pointer array index[t]. There is no need to change the error weight. All pointers in the pointer array index[t] are incremented by 1. Case 2: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. A deletion error occurs at the position pointed to by the predicted pointer array index[t], and it is considered that 0 has been deleted. The bit value of the current pre-reconstructed position is set to 0, and the error weight needs to be increased by 1 for each voting position pointed to by the pointer. After the error weight calculation is completed, the pointer array index[t] is updated. At this time, all pointers pointing to voting positions with a bit value of 0 are increased by 1. When voting for the next pre-reconstructed position in this sequence, it is necessary to vote at the position next to the position currently pointed to by the corresponding pointer in this sequence. Case 3: The bit values of the t voting positions pointed to by the pointer array index[t] are not exactly the same. It is predicted that a deletion error occurs at the position pointed to by the pointer array index[t]. It is considered that 1 is deleted, and the bit value of the current pre-reconstructed position is set to 1. For every time a pointer points to a voting position with a bit value of 0, the error weight needs to be increased by one. After the error weight calculation is completed, the pointer array index[t] is updated. At this time, all pointers pointing to voting positions with a bit value of 1 are increased by 1. When voting for the next pre-reconstructed bit in this sequence, it is necessary to use the position next to the position currently pointed to by the corresponding pointer in this sequence to vote.
3. The high-precision sequence reconstruction method based on branch prediction according to claim 2, characterized in that: In step 4, in each round of branch prediction, the error weights of all branch paths are compared, and the branch with the smallest error weight is selected as the pre-reconstruction result. And update the pointer array to the situation corresponding to the branch path.
4. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 4, fill Y with characters other than 0 and 1 k_grouped Each sequence in , so that the length of each sequence is l.
5. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 4, before each round of branch prediction pre-reconstruction begins, the initial error weight weight=0.
6. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 1, the reconstructed sequence length L adopts the known length of the original binary sequence.
7. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 1, the calculation formula of the sequence group length l is as follows: Among them, p d is the deletion probability of the deleted channel.
8. The high-precision sequence reconstruction method based on branch prediction according to claim 1, characterized in that: In step 2, the copy sequence y i The starting position set after grouping i The determination process is as follows: If the starting position of the current group is start i1 , that is, k=1, then let start i1 =1, and start i1 Add the starting position set start i middle; If the starting position of the current group is start ik , k∈[1,m], first scan the copy sequence y i Start i(k-1) +l-δ position to the start i(k-1) +l-1 bit, find the position where the first redundant bit appears. If no redundant bit appears, it means that no deletion error occurs in the group, then start ik =start i(k-1) +l; otherwise, the position where the first redundant bit appears is error k-1 , error k-1 ∈[start i(k-1) +l-δ,start i(k-1) +l-1], represents the copy sequence y i The k-1th group has errornum k-1 =δ-[error k-1 -(start k-1 +l-δ)] deletion errors, so start ik =start i(k-1) +l-errornum k-1 ; After completing the judgment process, start ik Add the starting position set start i Until the replica sequence y is determined i The starting position of m groups, get the copy sequence y i The m group starting position set start i .