CN115982310B - Chain table generation method with verification function and electronic equipment - Google Patents
Chain table generation method with verification function and electronic equipment Download PDFInfo
- Publication number
- CN115982310B CN115982310B CN202310277064.5A CN202310277064A CN115982310B CN 115982310 B CN115982310 B CN 115982310B CN 202310277064 A CN202310277064 A CN 202310277064A CN 115982310 B CN115982310 B CN 115982310B
- Authority
- CN
- China
- Prior art keywords
- suffix
- linked list
- character
- suffixes
- positive sequence
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Landscapes
- Collating Specific Patterns (AREA)
- Document Processing Apparatus (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请适用于计算机技术领域,提供了一种自带验证功能的链表生成方法及电子设备,所述方法包括:根据字符类型数组生成关于原始字符串的多个特殊正序后缀;对多个所述特殊正序后缀进行归纳排序,确定第一顺序;根据各个特殊正序后缀生成用于指纹验证的第一链表;根据第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定第二顺序;根据各个第二后缀生成用于指纹验证的第二链表;根据各个第二字符类型的所述第二链表,生成原始字符串对应的后缀链表。使用本实施例的方法可以将验证过程集成在构造过程中,因此构造出的后缀链表无需单独验证,可以提高后缀链表的验证效率。
This application is applicable to the field of computer technology, and provides a linked list generation method with its own verification function and electronic equipment. The method includes: generating a plurality of special positive sequence suffixes about the original character string according to an array of character types; The above special positive sequence suffixes are inductively sorted to determine the first order; the first linked list for fingerprint verification is generated according to each special positive sequence suffix; a plurality of second suffixes about the second character type are inductively sorted according to the first linked list, Determining the second order; generating a second linked list for fingerprint verification according to each second suffix; generating a suffix linked list corresponding to the original character string according to the second linked list of each second character type. Using the method of this embodiment, the verification process can be integrated in the construction process, so the constructed suffix linked list does not need to be verified separately, and the verification efficiency of the suffix linked list can be improved.
Description
技术领域technical field
本申请实施例属于计算机技术领域,特别是涉及一种自带验证功能的链表生成方法及电子设备。The embodiments of the present application belong to the field of computer technology, and in particular relate to a method for generating a linked list with a verification function and an electronic device.
背景技术Background technique
后缀链表,是一种按照链表后缀的顺序信息链接起来的单链表,后缀链表中的每一个后缀都指向字典序更大或者字典序更小的后缀,从而能够根据后缀链表中各个后缀间的指向关系实现字符数据的读取。由于后缀链表是一种可以基于后缀进行全文索引的数据结构,因此后缀链表常被应用于数据压缩领域。在利用后缀链表进行数据压缩时,后缀链表的正确性直接影响压缩算法的正确性和压缩效率,因此如何确保后缀链表的正确性则成为了数据压缩过程的关键。The suffix linked list is a single linked list linked according to the order information of the suffixes in the linked list. Each suffix in the suffix linked list points to a suffix with a larger or smaller lexicographical order, so that it can The relation implements the reading of character data. Since the suffix linked list is a data structure that can perform full-text indexing based on suffixes, the suffix linked list is often used in the field of data compression. When using the suffix linked list for data compression, the correctness of the suffix linked list directly affects the correctness and compression efficiency of the compression algorithm, so how to ensure the correctness of the suffix linked list becomes the key to the data compression process.
在现有技术中,验证后缀链表正确性的方法主要有以下两种。第一,根据各后缀的指向关系遍历后缀链表,从字符串中读取后缀链表的相邻后缀进行比较。第二,在对后缀链表进行解压后,将解压后得到的字符串与原始字符串进行比较。然而,第一种验证方法需要耗费大量时间,而第二种验证方法的不能保证较高的压缩率。因此,现有技术难以在保证较高压缩率的同时实现对后缀链表的快速验证。In the prior art, there are mainly the following two methods for verifying the correctness of the suffix linked list. First, traverse the suffix linked list according to the pointing relationship of each suffix, and read the adjacent suffixes of the suffix linked list from the string for comparison. Second, after decompressing the suffix linked list, compare the decompressed character string with the original character string. However, the first verification method takes a lot of time, and the second verification method cannot guarantee a high compression ratio. Therefore, it is difficult in the prior art to realize fast verification of the suffix linked list while ensuring a high compression rate.
发明内容Contents of the invention
有鉴于此,本申请实施例提供了一种自带验证功能的链表生成方法,用以将后缀链表的验证过程集成在链表的构造过程中,使得构造出的后缀链表无需单独验证。In view of this, the embodiment of the present application provides a linked list generation method with its own verification function, which is used to integrate the verification process of the suffix linked list in the construction process of the linked list, so that the constructed suffix linked list does not need to be verified separately.
本申请实施例的第一方面提供了一种自带验证功能的链表生成方法,包括:The first aspect of the embodiment of the present application provides a method for generating a linked list with its own verification function, including:
根据字符类型数组生成关于原始字符串的多个特殊正序后缀;所述字符类型数组是根据所述原始字符串中各个字符对应的字符类型生成的;所述第一后缀为后缀首字符的字符类型为特殊正序类型的后缀;所述各个字符的字符类型由所述各个字符与其相邻字符之间的字符大小确定;Generate a plurality of special positive sequence suffixes about the original string according to the character type array; the character type array is generated according to the character type corresponding to each character in the original string; the first suffix is the character of the first character of the suffix The type is a suffix of a special positive sequence type; the character type of each character is determined by the character size between each character and its adjacent characters;
对多个所述特殊正序后缀进行归纳排序,确定所述多个特殊正序后缀的第一顺序;performing inductive sorting on the multiple special positive sequence suffixes, and determining the first order of the multiple special positive sequence suffixes;
根据各个所述特殊正序后缀在所述第一顺序中的次序以及所述后缀首字符在所述原始字符串内的字符位置,生成用于指纹验证的第一链表;Generate a first linked list for fingerprint verification according to the order of each of the special positive sequence suffixes in the first order and the character position of the first character of the suffix in the original character string;
根据所述第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定所述多个第二后缀的第二顺序;根据各个所述第二后缀在所述第二顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置,生成用于指纹验证的第二链表;According to the first linked list, a plurality of second suffixes related to the second character type are inductively sorted to determine the second order of the plurality of second suffixes; according to each of the second suffixes in the second order Order and the character position of the first character of the suffix in the original character string to generate a second linked list for fingerprint verification;
根据各个所述第二字符类型的所述第二链表,生成所述原始字符串对应的后缀链表。A suffix linked list corresponding to the original character string is generated according to the second linked list of each of the second character types.
本申请实施例的第二方面提供了一种自带验证功能的链表生成装置,包括:The second aspect of the embodiment of the present application provides a linked list generation device with its own verification function, including:
特殊正序后缀确定模块,用于根据字符类型数组生成关于原始字符串的多个特殊正序后缀;所述字符类型数组是根据所述原始字符串中各个字符对应的字符类型生成的;所述特殊正序后缀为后缀首字符的字符类型为特殊正序类型的后缀;所述各个字符的字符类型由所述各个字符与其相邻字符之间的字符大小确定;The special positive sequence suffix determination module is used to generate a plurality of special positive sequence suffixes about the original character string according to the character type array; the character type array is generated according to the character type corresponding to each character in the original character string; the The special positive sequence suffix is the character type of the first character of the suffix is the suffix of the special positive sequence type; the character type of each character is determined by the character size between each character and its adjacent characters;
第一顺序确定模块,用于对多个所述特殊正序后缀进行归纳排序,确定所述多个特殊正序后缀的第一顺序;A first order determination module, configured to inductively sort the plurality of special positive sequence suffixes, and determine the first order of the plurality of special positive sequence suffixes;
第一链表生成模块,用于根据各个所述特殊正序后缀在所述第一顺序中的次序以及所述后缀首字符在所述原始字符串内的字符位置,生成用于指纹验证的第一链表;The first linked list generation module is used to generate the first list for fingerprint verification according to the order of each of the special positive sequence suffixes in the first order and the character position of the first character of the suffix in the original string. linked list;
第二链表生成模块,用于根据所述第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定所述多个第二后缀的第二顺序;根据各个所述第二后缀在所述第二顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置,生成用于指纹验证的第二链表;The second linked list generation module is used to inductively sort a plurality of second suffixes related to the second character type according to the first linked list, and determine the second order of the plurality of second suffixes; according to each of the second suffixes In the order in the second order and the character position of the first character of the suffix in the original character string, generate a second linked list for fingerprint verification;
后缀链表生成模块,用于根据各个所述第二字符类型的所述第二链表,生成所述原始字符串对应的后缀链表。A suffix linked list generating module, configured to generate a suffix linked list corresponding to the original character string according to the second linked list of each of the second character types.
本申请实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的自带验证功能的链表生成方法。The third aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, when the processor executes the computer program Realize the linked list generation method with built-in verification function as described in the first aspect above.
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的自带验证功能的链表生成方法。The fourth aspect of the embodiments of the present application 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 self-contained Linked list generation method for validation functions.
本申请实施例的第五方面提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行上述第一方面所述的自带验证功能的链表生成方法。The fifth aspect of the embodiments of the present application provides a computer program product, which, when running on a computer, causes the computer to execute the linked list generation method with its own verification function described in the first aspect above.
与现有技术相比,本申请实施例具有以下优点:Compared with the prior art, the embodiment of the present application has the following advantages:
本申请实施例中,电子设备通过确定多个特殊正序后缀并对多个特殊正序后缀进行归纳排序,生成用于指纹验证的第一链表。在生成第一链表后,电子设备可以基于第一链表对多个第二字符类型的第二后缀进行归纳排序,生成用于指纹验证的第二链表。通过第二链表,电子设备可以构造出原始字符串对应的后缀链表。在本申请实施例中,由于第一链表和第二链表都可以用于指纹验证,将后缀链表的验证过程集成在了后缀链表的构造过程中。因此,本实施例提供的后缀链表生成方法可以直接对生成的后缀链表进行正确性验证,可以提高后缀链表的验证效率。In the embodiment of the present application, the electronic device generates the first linked list for fingerprint verification by determining a plurality of special positive sequence suffixes and inductively sorting the multiple special positive sequence suffixes. After the first linked list is generated, the electronic device may sort the plurality of second suffixes of the second character type based on the first linked list to generate a second linked list for fingerprint verification. Through the second linked list, the electronic device can construct a suffix linked list corresponding to the original character string. In the embodiment of the present application, since both the first linked list and the second linked list can be used for fingerprint verification, the verification process of the suffix linked list is integrated in the construction process of the suffix linked list. Therefore, the method for generating the suffix linked list provided in this embodiment can directly verify the correctness of the generated suffix linked list, and can improve the verification efficiency of the suffix linked list.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Apparently, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative efforts.
图1是本申请实施例提供的字符串X的后缀数组和后缀链表存储结构示意图;Fig. 1 is a schematic diagram of the storage structure of the suffix array and the suffix linked list of the character string X provided by the embodiment of the present application;
图2是本申请实施例提供的字符串X的后缀数组的元素示意图;Fig. 2 is a schematic diagram of the elements of the suffix array of the character string X provided by the embodiment of the present application;
图3是本申请实施例提供的字符串X的两种后缀链表的结构示意图;Fig. 3 is a schematic structural diagram of two kinds of suffix linked lists of character string X provided by the embodiment of the present application;
图4是本申请实施例提供的一种自带验证功能的链表生成方法的示意图;FIG. 4 is a schematic diagram of a method for generating a linked list with a verification function provided in an embodiment of the present application;
图5是本申请实施例提供的S404的一种可能实现方式的示意图;FIG. 5 is a schematic diagram of a possible implementation of S404 provided in the embodiment of the present application;
图6是本申请实施例提供的一种自带验证功能的链表生成装置的示意图;Fig. 6 is a schematic diagram of a linked list generating device with its own verification function provided by the embodiment of the present application;
图7是本申请实施例提供的一种终端设备的示意图。FIG. 7 is a schematic diagram of a terminal device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域技术人员应当清楚,在没有这些具体细节的其他实施例中也可以实现本申请。在其他情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。In the following description, specific details such as specific system structures and technologies are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
后缀链表是一种基于字符串后缀的升序或降序链接起来的后缀单链表。通过将给定字符串按照升序或降序链接起来的后缀的位置保存在一个整型数组中,便可以构造出一个后缀链表。构造出的后缀链表中的每个后缀都可以指向字典序更大或者字典序更小的下一个后缀。后缀链表主要应用于数据压缩领域,著名的压缩算法LZ77因子分解的预备阶段就是通过将给定字符串的按升序或降序链接起来以构造出后缀单链表。后缀数组和后缀链表都是一种基于后缀的全文索引数据结构,都保存着字符串后缀的顺序信息,其中后缀数组属于顺序存储结构,后缀链表属于链式存储结构。对于给定输入长度为n的字符串X[1,n],字符串X中可以包含n个不同长度的后缀,例如,用suf(X, i)表示X中从第i个字符开始至结尾的后缀,即字符串X[i, n],i∈[1,n]。例如,字符串X[1,12]=“bbcbbabbcbba”,则字符串X的长度可以为12,字符串X中可以包含12个长度不同的后缀。suf(X,2)可以表示字符串X中从第2个字符开始至结尾的后缀,即suf(X,2)=bcbbabbcbba。字符串X的后缀链表是一个基于整型数组Y[0, n]的单链表,Y[0]为链表头,Y[0]可以指向后缀链表中字典序最大或字典序最小后缀,其余元素Y[i]保存着比后缀suf(X,i)大或小的下一个后缀的开始位置,若不存在比后缀suf(X, i)大或小的下一个后缀,则元素Y[i]可以指向链表头Y[0]。因此,X的后缀链表是一种基于数组的链式存储结构的后缀索引。The suffix linked list is a suffix singly linked list linked in ascending or descending order based on string suffixes. A linked list of suffixes can be constructed by storing the positions of the suffixes linked by a given string in ascending or descending order in an integer array. Each suffix in the constructed suffix list can point to the next suffix with a larger or smaller lexicographic order. The suffix linked list is mainly used in the field of data compression. The preparatory stage of the factorization of the famous compression algorithm LZ77 is to construct a suffix single linked list by linking the given strings in ascending or descending order. Both the suffix array and the suffix linked list are suffix-based full-text index data structures, both of which store the sequence information of string suffixes. The suffix array belongs to the sequential storage structure, and the suffix linked list belongs to the linked storage structure. For a given input string X[1,n] with an input length of n, the string X can contain n suffixes of different lengths, for example, use suf(X, i) to represent X from the i-th character to the end The suffix of , that is, the string X[i, n], i∈[1,n]. For example, if the string X[1,12]="bbcbbabbcbba", the length of the string X can be 12, and the string X can contain 12 suffixes with different lengths. suf(X,2) can represent the suffix from the second character to the end in the string X, that is, suf(X,2)=bcbbabbcbba. The suffix linked list of the string X is a single linked list based on the integer array Y[0, n], Y[0] is the head of the linked list, Y[0] can point to the largest or smallest suffix in the lexicographic order in the suffix linked list, and the remaining elements Y[i] holds the starting position of the next suffix larger or smaller than the suffix suf(X,i), if there is no next suffix larger or smaller than the suffix suf(X,i), the element Y[i] It can point to the head of the linked list Y[0]. Therefore, the suffix linked list of X is a suffix index of an array-based linked storage structure.
后缀链表的正确性直接决定着LZ77压缩算法的正确性和压缩效率。目前,后缀链表的正确性验证方法大致有以下二种。The correctness of the suffix linked list directly determines the correctness and compression efficiency of the LZ77 compression algorithm. At present, there are roughly two methods for verifying the correctness of the suffix linked list as follows.
第一种验证方法是通过遍历后缀链表的方式,根据后缀链表中相邻后缀的位置从原始字符串X中读取出对应的后缀进行比较,以实现后缀链表的正确性验证。第一种验证方法由于涉及大量的内存随机读写,因此验证时间开销大。The first verification method is to read the corresponding suffixes from the original string X according to the positions of the adjacent suffixes in the suffix list by traversing the suffix list for comparison, so as to verify the correctness of the suffix list. The first verification method involves a large amount of memory random reading and writing, so the verification time is high.
第二种方法是将基于后缀链表生成的压缩字符串进行解压缩,将解压恢复出的字符串可以与原始字符串进行比较,若两者一致,则说明后缀链表大概率是正确的。在第二种方法中,如果后缀链表中极少数后缀顺序不正确,也可能恢复出正确的原始字符串,但是包含了错误后缀顺序的后缀链表会导致压缩率减小。因此,在需要严格验证链表的正确性的应用场景,通常采用第一种方法,但是通过第一种验证方法进行后缀链表的正确性验证需要花费大量时间。理想的后缀链表正确性验证方法应该不占用过多的内存空间,同时具有较快的速度和较高的准确率。The second method is to decompress the compressed string generated based on the suffix linked list, and compare the decompressed and restored string with the original string. If the two are consistent, it means that the suffix linked list is probably correct. In the second method, if very few suffixes in the suffix list are in the wrong order, the correct original string may also be recovered, but the suffix list containing the wrong suffix order will cause the compression rate to decrease. Therefore, in the application scenario where the correctness of the linked list needs to be strictly verified, the first method is usually adopted, but it takes a lot of time to verify the correctness of the suffix linked list through the first verification method. An ideal method for verifying the correctness of the suffix linked list should not occupy too much memory space, and at the same time have faster speed and higher accuracy.
下面通过具体实施例来说明本申请的技术方案。The technical solutions of the present application are illustrated below through specific examples.
首先,关于本申请实施例可能涉及的名词,在此进行说明。First, nouns that may be involved in the embodiments of the present application are described here.
字符串X:由n个字符X[1]...X[n]组成的字符数组X[1, n],X的字符集可以用Σ表示。其中,字典序(dictionaryorder),又称字母序(alphabetical order),原意是表示英文单词在字典中的先后顺序,在计算机领域中扩展为根据英文单词在字典中的先后顺序确定的两个任意字符串的大小关系。String X: A character array X[1, n] consisting of n characters X[1]...X[n]. The character set of X can be represented by Σ. Among them, the dictionary order (dictionary order), also known as the alphabetical order (alphabetical order), originally intended to represent the order of English words in the dictionary, in the computer field, it is extended to two arbitrary characters determined according to the order of English words in the dictionary string size relationship.
字符类型:字符串X中的字符分为L和S两种类型。如果字符X[i]满足X[i]<X[i+1],或满足X[i]=X[i+1]且X[i+1]为S类型字符时,字符X[i]可以为S类型字符(又称正序字符),否则字符X[i]为L类型字符(又称逆序字符),其中,1≤i≤n-1。进一步地,如果X[i-1]为L类型字符,且X [i]为S类型字符时,那么X[i]为S*类型(又称特殊正序字符)。其中,S*类型是S类型字符的子类型。特别的,结尾字符X[n]可以为S*类型字符。Character type: The characters in the string X are divided into two types: L and S. If the character X[i] satisfies X[i]<X[i+1], or satisfies X[i]=X[i+1] and X[i+1] is an S-type character, the character X[i] It can be an S type character (also known as a positive sequence character), otherwise the character X[i] is an L type character (also known as a reverse sequence character), where 1≤i≤n-1. Further, if X[i-1] is a character of type L, and X [i] is a character of type S, then X[i] is of type S* (also known as a special positive sequence character). Among them, the S* type is a subtype of the S type character. In particular, the ending character X[n] can be an S* type character.
后缀类型:后缀的类型由其后缀首字符的字符类型决定,因此后缀可以分为L和S两种类型,其中S*类型后缀是S类型后缀的子集。Suffix type: The type of suffix is determined by the character type of the first character of the suffix, so the suffix can be divided into two types: L and S, where the S* type suffix is a subset of the S type suffix.
前继字符:后缀X[i, n]的前继字符可以为X[i-1]。Preceding character: The preceding character of the suffix X[i, n] can be X[i-1].
前继后缀:后缀X[i, n]的前继后缀可以为后缀X[i-1,n]。Prefix and suffix: The prefix and suffix of the suffix X[i, n] can be the suffix X[i-1,n].
后缀数组(SA):字符串X的后缀数组是一个长度为n的整型数组,后缀数组可以表示为SA(X)[1, n],后缀数组中可以从左至右按照后缀升序保存着多个后缀的开始位置。Suffix array (SA): The suffix array of string X is an integer array with a length of n. The suffix array can be expressed as SA(X)[1, n]. The suffix array can be stored in ascending order of suffixes from left to right. The starting position of multiple suffixes.
升序后缀链表ψ:长度为n+1的基于数组的单链表,按照字典序升序将后缀链接起来便可以得到一个后缀链表ψ。其中,ψ[0]可以为后缀链表ψ的链表头,ψ[0]可以指向字符串X的最小后缀。ψ[SA[n]]为后缀链表ψ的链表尾,ψ[SA[n]]可以指向链表头ψ[0]。后缀链表ψ中的其他链表节点可以指向比它大的下一个后缀的开始位置。进一步,链表ψL可以表示L类型后缀升序单链表,将L类型后缀按照升序链接到L类型位置中,便可以生成链表ψL。在本申请实施例中,链表ψL还可以称为逆序类型后缀升序单链表。表ψS可以表示S类型后缀升序单链表,将S类型后缀按照升序链接到S类型位置中,便可以生成链表ψS。在本申请实施例中,链表ψS还可以称为正序类型后缀升序单链表。链表ψS*可以表示S*类型后缀升序单链表,将S*类型后缀按照升序链接到S*类型位置中,便可以生成链表ψS*。在本申请实施例中,链表ψS*还可以称为特殊正序类型后缀升序单链表。Ascending suffix linked list ψ: an array-based singly linked list with a length of n+1, linking suffixes in ascending lexicographical order to obtain a suffix linked list ψ. Among them, ψ[0] can be the head of the suffix list ψ, and ψ[0] can point to the smallest suffix of the string X. ψ[SA[n]] is the tail of the suffix list ψ, and ψ[SA[n]] can point to the head of the list ψ[0]. Other linked list nodes in the suffix linked list ψ can point to the start position of the next suffix larger than it. Further, the linked list ψ L can represent an ascending single linked list of L-type suffixes, and the linked list ψ L can be generated by linking the L-type suffixes to the L-type positions in ascending order. In the embodiment of the present application, the linked list ψ L may also be called a reverse type suffix ascending single linked list. The table ψ S can represent a single-linked list of S-type suffixes in ascending order, and the linked list ψ S can be generated by linking S-type suffixes to S-type positions in ascending order. In the embodiment of the present application, the linked list ψ S may also be called a positive sequence type suffix ascending single linked list. The linked list ψ S* can represent a single linked list of S* type suffixes in ascending order, and the linked list ψ S* can be generated by linking the S* type suffixes to the S* type positions in ascending order. In the embodiment of the present application, the linked list ψ S* may also be called a special positive sequence type suffix ascending single linked list.
降序后缀链表φ:长度为n+1的基于数组的单链表,按照字典序降序将后缀链接起来便可以得到一个后缀链表φ。其中,φ[0]可以为后缀链表φ的链表头,φ[0]可以指向字符串X中的最大后缀。φ[SA[1]]可以为后缀链表φ的链表尾,φ[SA[1]]可以指向链表头φ[0]。后缀链表φ中的其他链表节点可以指向比它小的下一个后缀的开始位置。进一步,链表φL可以表示L类型后缀降序单链表,其中链表φL可以通过将多个L类型后缀按照降序链接到L类型后缀的链接位置的方式生成。在本申请实施例中,链表φL还可以称为逆序类型后缀降序单链表。链表φS可以表示S类型后缀降序单链表,其中链表φS可以通过将多个S类型后缀按照降序链接到S类型后缀的链接位置的方式生成。在本申请实施例中,链表φS还可以称为正序类型后缀降序单链表。链表φS*可以表示S*类型后缀降序单链表,其中链表φS*可以通过将多个S*类型后缀按照降序链接到S*类型后缀的链接位置的方式生成。在本申请实施例中,链表φS*还可以称为特殊正序类型后缀降序单链表。Descending suffix linked list φ: an array-based singly linked list with a length of n+1, linking the suffixes in descending lexicographical order can obtain a suffix linked list φ. Wherein, φ[0] may be the head of the suffix list φ, and φ[0] may point to the largest suffix in the string X. φ[SA[1]] can be the tail of the suffix list φ, and φ[SA[1]] can point to the head of the list φ[0]. Other linked list nodes in the suffix linked list φ can point to the start position of the next suffix smaller than it. Further, the linked list φ L can represent a single linked list of L-type suffixes in descending order, where the linked list φ L can be generated by linking multiple L-type suffixes to the link positions of the L-type suffixes in descending order. In the embodiment of the present application, the linked list φ L may also be called a reverse type suffix descending single linked list. The linked list φ S can represent a single linked list of S-type suffixes in descending order, where the linked list φ S can be generated by linking multiple S-type suffixes to the link positions of the S-type suffixes in descending order. In the embodiment of the present application, the linked list φ S may also be referred to as a positive sequence type suffix descending single linked list. The linked list φ S* can represent a single linked list in descending order of S* type suffixes, wherein the linked list φ S* can be generated by linking multiple S* type suffixes to the link positions of S* type suffixes in descending order. In the embodiment of the present application, the linked list φ S* can also be called a special positive sequence type suffix descending single linked list.
后缀链表的归纳排序过程:第一步,对S*类型后缀进行排序,计算生成链表ψS*;第二步,遍历链表ψS*,归纳推导多个L类型后缀的顺序,计算生成链表φL;第三步,遍历链表φL,归纳推导多个S类型后缀顺序,计算生成链表φS。其中,归纳排序可以是原地排序。在构造后缀链表的过程中,后缀数组SA以及不同类型的后缀链表φ和ψ都复用相同数组Y的存储空间。数组Y中各元素的元素类型与字符串X中各个字符的字符类型一一对应。例如,如果X[i]为L类型的字符,则Y[i]也为L类型的数组元素。The inductive sorting process of the suffix linked list: the first step is to sort the S* type suffixes, calculate and generate the linked list ψ S* ; the second step, traverse the linked list ψ S* , inductively deduce the order of multiple L type suffixes, and calculate and generate the linked list φ L ; the third step is to traverse the linked list φ L , inductively deduce the order of multiple S-type suffixes, and calculate and generate the linked list φ S . Wherein, inductive sorting may be in-place sorting. In the process of constructing the suffix linked list, the suffix array SA and the different types of suffix linked lists φ and ψ all reuse the storage space of the same array Y. The element type of each element in the array Y is in one-to-one correspondence with the character type of each character in the string X. For example, if X[i] is a character of type L, then Y[i] is also an array element of type L.
桶链表:以相同字符c开始的L类型后缀链接起来形成的单链表可以称为c的L型桶链表。以相同字符c开始的S类型后缀链接起来形成的单链表可以称为c的S型桶链表。为便于表述,可以分别用数组Lbkts[|Σ|]和Lbkte[|Σ|]记录各L类型桶链表的开始和结束指针,可以分别用数组Sbkts[|Σ|]和Sbkte[|Σ|]记录各S类型桶链表的开始和结束指针。Bucket linked list: The singly linked list formed by linking L-type suffixes starting with the same character c can be called the L-type bucket linked list of c. A singly linked list formed by linking S-type suffixes starting with the same character c can be called an S-type bucket list of c. For the convenience of expression, the arrays Lbkts[|Σ|] and Lbkte[|Σ|] can be used to record the start and end pointers of each L-type bucket list, and the arrays Sbkts[|Σ|] and Sbkte[|Σ|] can be used respectively Record the start and end pointers of each S-type bucket list.
Karp-Rabin指纹函数:Karp-Rabin指纹函数可以计算字符串或序列的指纹(即:哈希值),通过调节计算指纹函数中的公式的参数可以控制字符串或序列的出错概率。Karp-Rabin指纹函数具有迭代性质和组合性质,通过公式(1-1)至(1-3)可以迭代计算出任意长度的子串或序列的指纹。其中,FP(a,b)可以表示子串或序列从a到b元素的指纹,参数δ和K均为质数且δ<K。特别地,δ和K越大则出错概率越低。Karp-Rabin fingerprint function: The Karp-Rabin fingerprint function can calculate the fingerprint (ie: hash value) of a string or sequence, and the error probability of the string or sequence can be controlled by adjusting the parameters of the formula in the fingerprint calculation function. The Karp-Rabin fingerprint function has iterative and combined properties, and the fingerprints of substrings or sequences of any length can be iteratively calculated through formulas (1-1) to (1-3). Among them, FP(a,b) can represent the fingerprint of a substring or sequence from a to b elements, and the parameters δ and K are both prime numbers and δ<K. In particular, the larger δ and K are, the lower the error probability is.
FP(0, -1) = 0 (1-1)FP(0, -1) = 0 (1-1)
FP(0, p) = (FP(0,p-1)*δ + x[p]) mod K (1-2)FP(0, p) = (FP(0,p-1)*δ + x[p]) mod K (1-2)
FP(p, q) = (FP(0,q) - fp(0, p-1)*δq-p+1) mod K (1-3)FP(p, q) = (FP(0,q) - fp(0, p-1)*δ q-p+1 ) mod K (1-3)
需要说明的是,在本申请实施例中,升序或降序可以由各个后缀的字典序决定。多个正序后缀按字典序降序链接起来,可以生成降序正序链表。多个正序后缀按字典序升序链接起来可以生成升序正序链表。多个逆序后缀按字典序降序链接起来,可以生成降序逆序链表。多个逆序后缀按字典序升序链接起来可以生成升序逆序链表。It should be noted that in this embodiment of the application, the ascending or descending order may be determined by the lexicographical order of each suffix. Multiple positive-order suffixes are linked in descending lexicographical order, and a descending positive-order linked list can be generated. Multiple positive order suffixes are linked in ascending lexicographical order to generate an ascending positive order linked list. Multiple reverse suffixes are linked in descending lexicographical order, and a descending reverse linked list can be generated. Multiple reverse suffixes are linked in ascending lexicographical order to generate an ascending reverse linked list.
以字符串X[1,12]=“bbcbbabbcbba”为例,解释上述各个名词的具体内容:Take the string X[1,12]="bbcbbabbcbba" as an example to explain the specific content of the above nouns:
如图1所示,为字符串X的后缀数组和后缀链表的存储结构示意图。As shown in FIG. 1 , it is a schematic diagram of the storage structure of the suffix array and the suffix linked list of the character string X.
参见图1,示出了字符串X中的各个字符的具体字符类型。例如,在字符串X中由于字符X[02]=b的字典序小于字符X[03]=c的字典序,因此字符X[02]=b的字符类型可以为S类型;在字符串X中由于字符X[01]=b的字典序与字符X[02]=b的字典序相同,所以字符X[01]=b的字符类型可以由字符X[02]=b的字符类型决定,又由于字符X[02]的字符类型S类型,所以字符X[01]=b的字符类型可以为S类型。Referring to FIG. 1 , the specific character types of each character in the character string X are shown. For example, in the string X, since the lexicographic order of the character X[02]=b is smaller than the lexicographic order of the character X[03]=c, the character type of the character X[02]=b can be S type; in the string X Since the lexicographic order of the character X[01]=b is the same as that of the character X[02]=b, the character type of the character X[01]=b can be determined by the character type of the character X[02]=b. And because the character type S of character X[02], so the character type of character X[01]=b can be S type.
参见图1,示出了字符串X的后缀数组的存储结构。其中,字符串X的后缀数组SA(X)可以是一个长度为n的整型数组,数组中可以保存X的多个已排序后缀的开始位置。例如,SA[01]=12中可以保存字符串X中字典序最小的后缀的开始位置12,该后缀可以由一个字符X[12]=a组成;SA[12]=03中可以保存字符串X中最大的后缀(suf(X, 03)=X[03, 12]=cbbabbcbba)的开始位置03。Referring to FIG. 1 , it shows the storage structure of the suffix array of the character string X. Wherein, the suffix array SA(X) of the character string X may be an integer array with a length of n, and the array may store the start positions of multiple sorted suffixes of X. For example, SA[01]=12 can save the starting
如图2所示,为本申请实施例提供的字符串X的后缀数组的元素示意图。图2给出了字符串X的后缀数组SA(X)的各个元素所对应的后缀。其中,图2中的序号可以表示SA(X)的第几个元素,也可以理解为该元素对应的后缀的字典序或顺序。例如,第2个元素SA[02]=06,对应的后缀可以为X[06, 12]=abbcbba,它在X的后缀中的顺序可以为2。As shown in FIG. 2 , it is a schematic diagram of the elements of the suffix array of the character string X provided in the embodiment of the present application. Fig. 2 shows the suffix corresponding to each element of the suffix array SA(X) of the character string X. Wherein, the serial number in FIG. 2 may indicate which element of SA(X), and may also be understood as the lexicographic order or order of the suffix corresponding to the element. For example, the second element SA[02]=06, the corresponding suffix can be X[06, 12]=abbcbba, and its order in the suffix of X can be 2.
如图3所示,为本申请实施例提供的字符串X的两种后缀链表的结构示意图。其中,字符串X的后缀链表可以包括升序后缀链表ψ(X)和降序后缀链表φ(X)。升序后缀链表ψ(X)和降序后缀链表φ(X)可以是长度为n+1的整型数组。图3给出了升序后缀链表ψ(X)和降序后缀链表φ(X)中的各个元素完整的链接顺序。在电子设备在遍历后缀链表时可以从后缀链表的链表头遍历整个链表,后缀链表的链表尾按照惯例指向链表头的位置。在后缀链表中首字符相同的后缀可以链接在一起构成一个桶链表,首字符相同的后缀构成的桶链表可以包括L类型桶链表和S类型桶链表。例如,以字符b开始的后缀链接在一起构成字符b的桶链表,该桶链表可以由以字符b为首字符的L类型桶链表和以字符b为首字符的S类型桶链表构成。As shown in FIG. 3 , it is a schematic structural diagram of two kinds of suffix linked lists of character string X provided in the embodiment of the present application. Wherein, the suffix linked list of the string X may include an ascending suffix linked list ψ(X) and a descending suffix linked list φ(X). The ascending suffix list ψ(X) and the descending suffix list φ(X) can be integer arrays with a length of n+1. Figure 3 shows the complete link order of each element in the ascending suffix list ψ(X) and the descending suffix list φ(X). When traversing the suffix linked list, the electronic device can traverse the entire linked list from the head of the suffix linked list, and the tail of the suffix linked list points to the position of the head of the linked list according to the convention. In the suffix list, suffixes with the same first character can be linked together to form a bucket list, and the bucket list formed by suffixes with the same first character can include L-type bucket list and S-type bucket list. For example, the suffixes starting with the character b are linked together to form a bucket list of the character b, which can be composed of an L-type bucket list with the character b as the first character and an S-type bucket list with the character b as the first character.
参见图3中的(a),为字符串X的升序后缀链表ψ(X)的结构示意图。其中,升序后缀链表ψ(X)可以由链表头、字符a的S类型桶链表、字符b的L类型桶链表、字符b的S类型桶链表和字符c的L类型桶链表依次链接而成。在升序后缀链表ψ(X)中,ψ[0]可以是升序后缀链表ψ(X)的链表头,ψ[0]可以指向字符串X的最小的后缀suf(X, 12)的后缀位置12。ψ[03]可以是升序后缀链表ψ(X)的链表尾,ψ[03]可以指向链表头ψ[0]。在升序后缀链表ψ(X)中,除了链表头和链表尾以外的其他位置i可以保存着比后缀suf(X, i)的字典序大的下一个后缀的后缀位置。例如,字典序比suf(X, 04)大的下一个后缀为后缀suf(X, 07),因此在升序后缀链表ψ(X)中ψ[04]可以指向ψ[07],即ψ[04]=07。See (a) in Figure 3, which is a schematic structural diagram of the ascending suffix list ψ(X) of the string X. Among them, the ascending suffix linked list ψ(X) can be formed by sequentially linking the head of the linked list, the S-type bucket list of character a, the L-type bucket list of character b, the S-type bucket list of character b, and the L-type bucket list of character c. In the ascending suffix list ψ(X), ψ[0] can be the head of the ascending suffix list ψ(X), and ψ[0] can point to the
参见图3中的(b),为字符串X的降序后缀链表φ(X)的结构示意图。其中,降序后缀链表φ(X)可以由链表头、字符c的L类型桶链表、字符b的S类型桶链表、字符b的L类型桶链表和字符a的S类型桶链表依次链接而成。在降序后缀链表φ(X)中,φ[0]可以是降序后缀链表φ(X)的链表头,φ[0]可以指向字符串X的最大后缀suf(X, 03)的后缀位置03。φ[12]可以是降序后缀链表φ(X)的链表尾,φ[12]可以指向链表头φ[0]。在降序后缀链表φ(X)中,除了链表头和链表尾以外的其他位置i可以保存着比后缀suf(X, i)的字典序小的下一个后缀的后缀位置。例如,字典序比suf(X, 04)小的下一个后缀为后缀suf(X, 10),因此在降序后缀链表φ(X)中φ[04]可以指向φ[10],即φ[04]=10。See (b) in Figure 3, which is a schematic structural diagram of the descending suffix list φ(X) of the character string X. Among them, the descending suffix linked list φ(X) can be sequentially linked by the head of the linked list, the L-type bucket list of character c, the S-type bucket list of character b, the L-type bucket list of character b, and the S-type bucket list of character a. In the descending suffix list φ(X), φ[0] can be the head of the descending suffix list φ(X), and φ[0] can point to the
下面通过具体实施例来说明本申请的技术方案。The technical solutions of the present application are illustrated below through specific examples.
参照图4,示出了本申请实施例提供的一种自带验证功能的链表生成方法的示意图,在本实施例中,该链表生成方法的执行主体为一电子设备,该电子设备可以为:智能手机、计算机设备、服务器以及其他能够进行数据处理的设备。具体可以包括如下步骤:Referring to FIG. 4 , it shows a schematic diagram of a method for generating a linked list with its own verification function provided by the embodiment of the present application. In this embodiment, the execution subject of the method for generating the linked list is an electronic device, and the electronic device can be: Smartphones, computer equipment, servers and other devices capable of data processing. Specifically, the following steps may be included:
S401、根据字符类型数组生成关于原始字符串的多个特殊正序后缀;所述字符类型数组是根据所述原始字符串中各个字符对应的字符类型生成的;所述第一后缀为后缀首字符的字符类型为特殊正序类型的后缀;所述各个字符的字符类型由所述各个字符与其相邻字符之间的字符大小确定;S401. Generate a plurality of special positive sequence suffixes on the original character string according to the character type array; the character type array is generated according to the character type corresponding to each character in the original character string; the first suffix is the first character of the suffix The character type of is the suffix of the special positive sequence type; the character type of each character is determined by the character size between each character and its adjacent characters;
在本申请实施例中,当电子设备需要通过压缩算法LZ77因子分解算法来压缩原始字符串时,电子设备可以先基于原始字符串生成原始字符串对应的后缀链表。电子设备在基于某一原始字符串构造该原始字符串相应的后缀链表时,可以先获取该原始字符串对应的字符类型数组。根据获取到的原始字符串对应的字符类型数组,电子设备可以生成多个后缀首字符的字符类型为特殊正序类型的后缀,即电子设备可以基于字符类型数组生成多个特殊正序后缀。其中,字符类型数组可以是根据原始字符串中各个字符对应的字符类型生成的。字符串数组中可以包含原始字符串中各个字符的字符类型信息。其中,各个字符与其相邻字符之间的字符大小可以通过各个字符与其相邻字符之间的字典序大小来确定。例如字符a的字典序小于字符b,则字符a小于字符b。In the embodiment of the present application, when the electronic device needs to compress the original character string through the compression algorithm LZ77 factorization algorithm, the electronic device can first generate a suffix linked list corresponding to the original character string based on the original character string. When the electronic device constructs a suffix linked list corresponding to an original character string based on the original character string, it may first acquire a character type array corresponding to the original character string. According to the obtained character type array corresponding to the original string, the electronic device can generate multiple suffixes whose first character is a special positive sequence type, that is, the electronic device can generate multiple special positive sequence suffixes based on the character type array. Wherein, the character type array may be generated according to the character type corresponding to each character in the original character string. The character type information of each character in the original string can be included in the string array. Wherein, the character size between each character and its adjacent characters can be determined by the lexicographical size between each character and its adjacent characters. For example, the lexicographic order of character a is less than character b, then character a is less than character b.
在本实施例中,原始字符串可以包含多个多种不同类型的字符,如特殊正序字符和逆序字符。基于原始字符串中的多个字符电子设备可以生成多个后缀。原始字符串的后缀可以是原始字符串中任一位置的字符开始至原始字符串的结尾字符之间的多个字符构成的字符串。例如,若某原始字符串X = "bbcbbabbcbba"的长度为12,字符串X的后缀可以是字符串X中任一位置i(1≤i≤12)开始至结尾位置12之间的多个字符组成的字符串,后缀首字符可以是后缀的第一个字符。例如,在上述字符串X的后缀suf(X,10)=bba,其首字符可以是b。本申请实施例中,关于字符类型和后缀类型的说明可以参见说明书中名词说明部分的内容,在此不再赘述。In this embodiment, the original character string may contain a plurality of different types of characters, such as special forward-order characters and reverse-order characters. Multiple suffixes can be generated based on multiple character electronics in the original string. The suffix of the original string may be a string composed of multiple characters between the beginning of the character at any position in the original string and the end character of the original string. For example, if the length of an original string X = "bbcbbabbcbba" is 12, the suffix of the string X can be multiple characters from any position i (1≤i≤12) to the
在本申请实施例中,电子设备可以通过扫描原始字符串,依次比较原始字符串中各个字符与其相邻字符之间的大小关系,从而确定原始字符串中各个字符的字符类型。在确定原始字符串中各个字符的字符类型后,可以将其字符类型记录于数组t中。其中,记录着原始字符串中各个字符的字符类型的数组t便可以成为字符类型数组。例如,图1中字符串X各个字符的类型可以保存在类型数组t中,电子设备可以通过说明书中名词说明部分的内容确定字符串X中的各个字符的字符类型。即电子设备可以通过比较字符串X中各个字符X[i]与其后继字符X[i+1]的大小及其类型,确定X[i]的类型。例如,由于字符串X第1个位置的字符b的后继字符也为b,且后继字符b的字符类型为S类型,所以字符串X第1个位置的字符b可以为正序字符;字符串X第2个位置的字符b小于其后继字符c,所以字符串X第2个位置的字符可以为正序字符;字符串X第6个位置字符a为正序字符,其前继字符b为逆序字符,因此字符串X第6个位置的字符a可以为特殊正序字符;字符串X第12个位置上的字符a,按照惯例可以为特殊正序字符;其中,特殊正序字符同样属于正序字符,是正序字符中的一种特殊类型。在本申请例中,电子设备通过用1代表正序字符,用0代表逆序字符,可以将字符串X中各个字符的字符类型记录于数组t,并生成字符串X相应的字符类型数组t。因此,字符串X的字符类型数组t可以是t=110001110001。根据字符类型数组t电子设备可以确定字符串X的多个特殊正序后缀,即电子设备可以确定suf(X, 06)=X[06,12]=abbcbba和suf(X, 12)=X[12]=a为特殊正序后缀。In the embodiment of the present application, the electronic device may scan the original character string and sequentially compare the size relationship between each character in the original character string and its adjacent characters, so as to determine the character type of each character in the original character string. After determining the character type of each character in the original character string, its character type can be recorded in the array t. Wherein, the array t recording the character type of each character in the original character string can become a character type array. For example, the type of each character in the character string X in FIG. 1 can be stored in the type array t, and the electronic device can determine the character type of each character in the character string X through the contents of the term description part in the manual. That is, the electronic device can determine the type of X[i] by comparing the size and type of each character X[i] in the character string X with its successor character X[i+1]. For example, since the successor character of the character b at the first position of the string X is also b, and the character type of the successor b is S type, the character b at the first position of the string X can be a positive sequence character; The character b at the second position of X is smaller than its successor character c, so the character at the second position of the string X can be a positive sequence character; the character a at the sixth position of the string X is a positive sequence character, and its predecessor b is Characters in reverse order, so the character a at the 6th position of the string X can be a special positive sequence character; the character a at the 12th position of the string X can be a special positive sequence character by convention; among them, the special positive sequence character also belongs to A positive sequence character is a special type of positive sequence characters. In this application example, the electronic device can record the character type of each character in the string X in the array t by using 1 to represent the forward sequence character and 0 to represent the reverse sequence character, and generate the character type array t corresponding to the string X. Therefore, the character type array t of the string X can be t=110001110001. According to the character type array t, the electronic device can determine multiple special positive sequence suffixes of the character string X, that is, the electronic device can determine suf(X, 06)=X[06,12]=abbcbba and suf(X, 12)=X[ 12]=a is a special positive sequence suffix.
S402、对多个所述特殊正序后缀进行归纳排序,确定所述多个特殊正序后缀的第一顺序;S402. Perform inductive sorting on the multiple special positive sequence suffixes, and determine the first sequence of the multiple special positive sequence suffixes;
在本申请实施例中,电子设备在基于字符类型数组生成多个关于原始字符串的特殊正序后缀后,可以通过分治递归的方法对生成的多个特殊正序后缀进行排序,从而获得多个递归层。基于获得的多个递归层,通过归纳排序的方法,电子设备可以获得多个特殊正序后缀的第一顺序。In the embodiment of this application, after the electronic device generates multiple special positive sequence suffixes on the original character string based on the character type array, it can sort the generated multiple special positive sequence suffixes through a divide-and-conquer recursive method, thereby obtaining multiple positive sequence suffixes. recursive layer. Based on the obtained multiple recursive layers, the electronic device can obtain the first order of multiple special positive sequence suffixes through an inductive sorting method.
在本申请中,由于分治递归算法是通过将原始问题分解为多个子问题,分解出来的子问题互相独立且与原问题形式相同。通过递归地解分解出来的子问题,得到各个子问题的解,最后将各子问题的解合并得到原问题的解。因此,通过分治递归算法获得的多个递归层中可以包含部分特殊正序后缀的顺序。根据各个递归层中的部分特殊正序后缀的顺序,对各个递归层进行归纳排序,便可以获得原始字符串的多个特殊正序后缀的第一顺序。In this application, since the divide-and-conquer recursive algorithm decomposes the original problem into multiple sub-problems, the decomposed sub-problems are independent of each other and have the same form as the original problem. By recursively solving the decomposed sub-problems, the solution of each sub-problem is obtained, and finally the solution of each sub-problem is combined to obtain the solution of the original problem. Therefore, the multiple recursive layers obtained by the divide-and-conquer recursive algorithm may contain some special positive sequence suffixes. According to the order of some special positive sequence suffixes in each recursive layer, the first order of multiple special positive sequence suffixes of the original string can be obtained by inductively sorting each recursive layer.
S403、根据各个所述特殊正序后缀在所述第一顺序中的次序以及所述后缀首字符在所述原始字符串内的字符位置,生成用于指纹验证的第一链表;S403. Generate a first linked list for fingerprint verification according to the order of each special positive sequence suffix in the first sequence and the character position of the first character of the suffix in the original character string;
在本申请实施例中,电子设备在确定关于原始字符串的多个特殊正序后缀的第一顺序后,可以根据字符类型数组确定原始字符串中的多个特殊正序后缀的后缀首字符的字符位置。根据各个特殊正序后缀在第一顺序中的次序和各个特殊正序后缀的后缀首字符在原始字符串中的字符位置,电子设备生成第一链表。其中,由于后缀链表可以由多个节点构成,各个节点中可以包括用于存储后缀本身的数据域和用于存储指针的指针域。因此,电子设备基于特殊正序后缀的后缀首字符的字符位置可以决定特殊正序后缀在第一链表中的特殊正序后缀位置,特殊正序后缀在第一顺序中的次序可以决定第一链表中各个特殊正序后缀的指针指向。电子设备生成的第一链表可以用于进行指纹验证。In the embodiment of the present application, after the electronic device determines the first order of the multiple special positive sequence suffixes of the original character string, it can determine the first character of the suffixes of the multiple special positive sequence suffixes in the original character string according to the character type array. character position. According to the order of each special positive sequence suffix in the first sequence and the character position of the first character of each special positive sequence suffix in the original character string, the electronic device generates the first linked list. Wherein, since the suffix linked list may be composed of multiple nodes, each node may include a data field for storing the suffix itself and a pointer field for storing pointers. Therefore, the electronic device can determine the position of the special positive sequence suffix in the first linked list based on the character position of the first character of the special positive sequence suffix, and the order of the special positive sequence suffix in the first sequence can determine the first linked list. The pointers to each special positive sequence suffix in . The first linked list generated by the electronic device can be used for fingerprint verification.
在本申请实施例中,电子设备在根据各个特殊正序后缀在第一顺序中的次序和各个特殊正序后缀的后缀首字符在原始字符串中的字符位置生成第一链表的过程中,可以通过指纹函数计算多个特殊正序后缀的第一指纹。由于第一指纹值可以由电子设备通过指纹函数计算多个特殊正序后缀的序列的方式获得,因此第一指纹值可以用于描述生成第一链表时的多个特殊正序后缀的第一顺序。In the embodiment of the present application, in the process of generating the first linked list according to the order of each special positive sequence suffix in the first sequence and the character position of the first character of each special positive sequence suffix in the original string, the electronic device can The first fingerprints of multiple special positive sequence suffixes are calculated by a fingerprint function. Since the first fingerprint value can be obtained by the electronic device by calculating the sequence of multiple special positive sequence suffixes through the fingerprint function, the first fingerprint value can be used to describe the first sequence of multiple special positive sequence suffixes when generating the first linked list .
在本申请实施例中,由于电子设备在生成第一链表时,根据多个特殊正序后缀生成第一指纹值,且第一指纹值可以用于描述生成第一链表时的多个特殊正序后缀的第一顺序。因此通过本申请实施例提供的后缀链表构造方法生成后缀链表,可以在生成后缀链表后,通过比较第一指纹值与第二指纹值是否相等电子设备便可以判断后缀链表是否正确。因此通过本实施例通过的方法电子设备可以直接根据第一指纹值验证后缀链表的正确性,可以提高后缀链表正确性验证的效率。In the embodiment of this application, since the electronic device generates the first fingerprint value according to multiple special positive sequence suffixes when generating the first linked list, and the first fingerprint value can be used to describe the multiple special positive sequence values when generating the first linked list. First order of suffixes. Therefore, through the suffix linked list construction method provided by the embodiment of the present application to generate the suffix linked list, the electronic device can determine whether the suffix linked list is correct by comparing whether the first fingerprint value and the second fingerprint value are equal after the suffix linked list is generated. Therefore, through the method adopted in this embodiment, the electronic device can directly verify the correctness of the suffix linked list according to the first fingerprint value, which can improve the efficiency of verifying the correctness of the suffix linked list.
在另一种实现方式中,电子设备在基于各个特殊正序后缀的第一顺序生成第一链表时,可以先根据多个特殊正序后缀的第一顺序,将多个特殊正序后缀的开始位置按照第一顺序的升序写入特殊正序后缀数组中进行保存。其中,特殊正序后缀数组中可以从左至右按照特殊正序后缀的第一顺序升序保存着多个关于原始字符串的特殊正序后缀的开始位置。电子设备在生成特殊正序后缀数组后,可以通过扫描字符类型数组的方式,确定多个特殊类型字符在原始字符串中的字符位置。根据各个特殊类型字符在原始字符串中的字符位置,电子设备可以确定特殊正序后缀数组中的各个特殊正序后缀的后缀首字符的字符位置。In another implementation, when the electronic device generates the first linked list based on the first order of each special positive-sequence suffix, the first sequence of the multiple special positive-sequence suffixes can be firstly set to The positions are stored in a special positive-order suffix array in ascending order of the first order. Wherein, the special positive sequence suffix array can store the start positions of multiple special positive sequence suffixes on the original string in ascending order from left to right according to the first order of the special positive sequence suffixes. After the electronic device generates the special positive sequence suffix array, it can determine the character positions of multiple special type characters in the original string by scanning the character type array. According to the character position of each special type character in the original character string, the electronic device can determine the character position of the first character of the suffix of each special positive sequence suffix in the special positive sequence suffix array.
在本申请实施例中,电子设备在各个特殊正序后缀的后缀首字符的字符位置后,可以通过从右往左依次扫描特殊正序后缀数组的方式,依次将多个特殊正序后缀按照特殊正序后缀在第一顺序中的降序次序,写入各个特殊正序后缀相应的临时位置中,以生成临时链表。在将各个特殊正序后缀按照第一顺序中的降序次序写入临时位置的过程中,电子设备可以通过指纹函数对多个特殊正序后缀的序列进行迭代计算,以生成第一移动指纹。其中,各个特殊正序后缀的临时位置可以是各个特殊正序后缀的后缀首字符在原始字符串中的字符位置的左邻位。由于第一移动指纹值是在电子设备按照第一顺序中的降序次序将多个特殊正序后缀写入临时位置的过程中生成的,因此第一移动指纹中可以包含多个特殊正序后缀的降序次序信息。In this embodiment of the application, after the first character of the suffix of each special positive sequence suffix, the electronic device can sequentially scan the array of special positive sequence suffixes from right to left, and sequentially scan multiple special positive sequence suffixes according to the special The descending order of the positive-order suffixes in the first order is written into the corresponding temporary positions of each special positive-order suffix to generate a temporary linked list. In the process of writing each special positive sequence suffix into the temporary location in descending order in the first sequence, the electronic device can iteratively calculate the sequence of multiple special positive sequence suffixes through a fingerprint function to generate the first mobile fingerprint. Wherein, the temporary position of each special positive sequence suffix may be the left adjacent position of the first character of the suffix of each special positive sequence suffix in the original character string. Since the first mobile fingerprint value is generated when the electronic device writes multiple special positive sequence suffixes into the temporary location in descending order in the first sequence, the first mobile fingerprint may contain multiple special positive sequence suffixes. Descending order information.
在本申请实施例中,由于特殊正序字符是前继字符为逆序字符的正序字符,因此特殊正序字符对应的字符位置的左邻位可以是逆序字符的位置。因此,电子设备在将多个特殊正序后缀按照降序次序写入临时位置,生成临时链表后,可以通过从右向左扫描特殊正序后缀数组的方式,依次将多个特殊正序后缀按照第一顺序的升序次序,从临时位置链接至特殊正序后缀位置中,以生成第一链表。在将各个特殊正序后缀按照第一顺序中的升序次序写入特殊正序后缀位置的过程中,电子设备可以通过指纹函数对多个特殊正序后缀的序列进行迭代计算,以生成第一链接指纹。其中,各个特殊正序后缀的特殊正序后缀位置可以是各个特殊正序后缀的后缀首字符在原始字符串中的字符位置。由于第一链接指纹值是在电子设备按照第一顺序中的升序次序将多个特殊正序后缀写入特殊正序后缀位置的过程中生成的,因此第一链接指纹中可以包含多个特殊正序后缀的升序次序信息。In the embodiment of the present application, since the special forward-sequence character is a forward-sequence character whose predecessor is a reverse-sequence character, the left neighbor of the character position corresponding to the special forward-sequence character may be the position of the reverse-sequence character. Therefore, after the electronic device writes multiple special positive-order suffixes into the temporary location in descending order and generates a temporary linked list, it can scan the array of special positive-order suffixes from right to left, sequentially write the multiple special positive-order suffixes A sequential ascending order, linked from the temporary position into the special forward suffix position, to generate the first linked list. In the process of writing each special positive sequence suffix to the position of the special positive sequence suffix in ascending order in the first sequence, the electronic device can iteratively calculate the sequence of multiple special positive sequence suffixes through the fingerprint function to generate the first link fingerprint. Wherein, the special positive sequence suffix position of each special positive sequence suffix may be the character position of the first character of the suffix of each special positive sequence suffix in the original string. Since the first link fingerprint value is generated when the electronic device writes multiple special positive sequence suffixes into the special positive sequence suffix positions in ascending order in the first sequence, the first link fingerprint may contain multiple special positive sequence suffixes. Ascending order information for ordinal suffix.
在本申请实施例中,电子设备在依次将多个特殊正序后缀按照第一顺序的升序次序从临时位置链接至特殊正序后缀位置的过程中,电子设备还可以根据各个特殊正序后缀的后缀首字符生成多个特殊正序桶链表。其中,特殊正序桶链表可以是多个后缀首字符相同的特殊正序后缀链接起来形成的单链表。例如,以相同字符c开始的多个特殊正序后缀链接起来形成的单链表可以称为c的特殊正序桶链表。在生成了多个特殊正序桶链表后,电子设备可以获得各个特殊正序桶链表的开始后缀和结束后缀。在获得了多个开始后缀和结束后缀后,电子设备可以将多个特殊正序桶链表的开始后缀保存至特殊正序开始数组中,电子设备还可以将多个特殊正序桶链表的结束后缀保存至特殊正序结束数组中。In this embodiment of the application, when the electronic device sequentially links multiple special positive sequence suffixes from the temporary position to the special positive sequence suffix position in the ascending order of the first sequence, the electronic device can also link the special positive sequence suffixes according to the The first character of the suffix generates multiple special positive sequence bucket linked lists. Wherein, the special positive sequence bucket linked list may be a single linked list formed by linking multiple special positive sequence suffixes with the same initial character of the suffix. For example, a singly linked list formed by linking multiple special positive sequence suffixes starting with the same character c can be called a special positive sequence bucket list of c. After generating multiple special positive sequence bucket lists, the electronic device can obtain the start suffix and end suffix of each special positive sequence bucket list. After obtaining multiple start suffixes and end suffixes, the electronic device can save the start suffixes of multiple special positive sequence bucket linked lists in the special positive sequence start array, and the electronic device can also store the end suffixes of multiple special positive sequence bucket linked lists Stored in a special positive order ending array.
在本申请实施例中,电子设备在将多个特殊正序后缀按照第一顺序中的降序次序写入临时位置的过程中,通过指纹函数对多个特殊正序后缀的序列进行迭代计算生成第一移动指纹。并且,电子设备在将多个特殊正序后缀按照第一顺序中的升序次序写入临时位置的过程中,也通过指纹函数对多个特殊正序后缀的序列进行迭代计算生成第一链接指纹。由于第一移动指纹和第一链接指纹中均包含了特殊正序后缀的序列信息。因此,在后缀链表构造完成后,电子设备便可以通过第一移动指纹和第一链接指纹确定在构造后缀链表的过程中,多个特殊正序后缀的序列是否发生变化,从而确定后缀链表的正确性。因此,通过本申请实施例提供的方法构造后缀链表,可以直接将链表的正确性验证过程集成在链表的构造过程中。后缀链表构造完成后,无需其他操作便可直接验证后缀链表的正确性。本申请实施例提供的后缀链表构造方法,可以减少后缀链表的验证时间,从而提高后缀链表的构造效率。In the embodiment of the present application, when the electronic device writes multiple special positive sequence suffixes into the temporary location in descending order in the first order, iteratively calculates the sequence of multiple special positive sequence suffixes through the fingerprint function to generate the first sequence. A mobile fingerprint. Moreover, when the electronic device writes the multiple special positive sequence suffixes into the temporary location in ascending order in the first sequence, iteratively calculates the sequence of multiple special positive sequence suffixes through the fingerprint function to generate the first link fingerprint. Since both the first mobile fingerprint and the first link fingerprint contain sequence information of a special positive sequence suffix. Therefore, after the construction of the suffix linked list is completed, the electronic device can determine whether the sequence of multiple special positive sequence suffixes changes during the process of constructing the suffix linked list through the first mobile fingerprint and the first link fingerprint, so as to determine the correctness of the suffix linked list. sex. Therefore, by constructing the suffix linked list through the method provided by the embodiment of the present application, the correctness verification process of the linked list can be directly integrated into the construction process of the linked list. After the construction of the suffix linked list is completed, the correctness of the suffix linked list can be directly verified without other operations. The construction method of the suffix linked list provided by the embodiment of the present application can reduce the verification time of the suffix linked list, thereby improving the construction efficiency of the suffix linked list.
S404、根据所述第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定所述多个第二后缀的第二顺序;根据各个所述第二后缀在所述第二顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置,生成用于指纹验证的第二链表;S404. Inductively sort a plurality of second suffixes related to the second character type according to the first linked list, and determine a second order of the plurality of second suffixes; according to each of the second suffixes in the second order The order in and the character position of the first character of the suffix in the original character string generate a second linked list for fingerprint verification;
在本申请实施例中,电子设备在生成第一链表后,可以基于第一链表对多个第二字符类型的第二后缀进行归纳排序。通过归纳排序的方法,电子设备可以确定多个第二后缀的第二顺序。在确定多个第二后缀的第二顺序后,电子设备可以根据各个第二后缀的后缀首字符在原始字符串中的字符位置,确定各个第二后缀在第二链表中的特殊正序后缀位置。电子设备还可以根据各个第二后缀在第二顺序中的次序确定各个第二后缀在第二链表中的指针指向。由于第二链表可以由多个节点构成,第二链表中的各个节点可以由存储后缀的数据域和存储后缀对应指针的指针域构成。因此在确定某一第二后缀的特殊正序后缀位置后,电子设备便可以确定该第二后缀写入的节点,通过读取节点的指针域内容,确定某一第二后缀的指针指向,继而电子设备便可以确定该第二后缀的指针。因此,电子设备在根据各个第二后缀在第二顺序中的次序以及后缀首字符在原始字符串内的字符位置,确认多个第二后缀的特殊正序后缀位置和指针指向后,可以生成用于指纹验证的第二链表。In the embodiment of the present application, after the first linked list is generated, the electronic device may perform inductive sorting on the plurality of second suffixes of the second character type based on the first linked list. Through the method of inductive sorting, the electronic device can determine the second sequence of multiple second suffixes. After determining the second sequence of multiple second suffixes, the electronic device can determine the special positive sequence suffix position of each second suffix in the second linked list according to the character position of the suffix first character of each second suffix in the original character string . The electronic device may also determine the pointers of the second suffixes in the second linked list according to the order of the second suffixes in the second sequence. Since the second linked list may be composed of multiple nodes, each node in the second linked list may be composed of a data field storing a suffix and a pointer field storing a pointer corresponding to the suffix. Therefore, after determining the special positive sequence suffix position of a certain second suffix, the electronic device can determine the node where the second suffix is written, and determine the pointer point of a certain second suffix by reading the content of the pointer field of the node, and then The electronic device can determine the pointer of the second suffix. Therefore, after confirming the special positive sequence suffix positions and pointers of multiple second suffixes according to the order of each second suffix in the second sequence and the character position of the first character of the suffix in the original character string, the electronic device can generate The second linked list for fingerprint verification.
在一种可能实现方式中,电子设备在生成第二链表的过程中,由于电子设备可以基于第一链表对多个第二字符类型的第二后缀进行归纳排序。因此,在生成第二链表的过程中,电子设备可以根据多个特殊正序后缀生成第二链表。由于第一指纹值可以由电子设备通过指纹函数计算多个特殊正序后缀的序列的方式获得,因此第一指纹值可以用于描述生成第二链表过程中,使用的多个特殊正序后缀的第一顺序。In a possible implementation manner, when the electronic device is generating the second linked list, the electronic device may sort multiple second suffixes of the second character type based on the first linked list. Therefore, during the process of generating the second linked list, the electronic device can generate the second linked list according to multiple special positive sequence suffixes. Since the first fingerprint value can be obtained by the electronic device by calculating the sequence of multiple special positive sequence suffixes through the fingerprint function, the first fingerprint value can be used to describe the multiple special positive sequence suffixes used in the process of generating the second linked list first order.
在本申请实施例中,需要说明的是,在本申请实施例中,第二字符类型可以包括正序类型和逆序类型,第二后缀可以包括正序后缀和逆序后缀。因此,如图5所示,S404中还可以包括S4041-S4044。In the embodiment of the present application, it should be noted that in the embodiment of the present application, the second character type may include a forward sequence type and a reverse sequence type, and the second suffix may include a forward sequence suffix and a reverse sequence suffix. Therefore, as shown in FIG. 5, S404 may also include S4041-S4044.
S4041、根据所述第一链表确定多个所述逆序后缀的所述逆序后缀顺序;S4041. Determine the sequence of the reverse suffixes of the plurality of reverse suffixes according to the first linked list;
在本申请中,电子设备可以通过遍历第一链表的方式,确定原始字符串中的多个逆序后缀和各个逆序后缀对应的逆序后缀位置。在通过第一链表确定多个逆序后缀和各个逆序后缀对应的逆序后缀位置后,电子设备可以通过归纳排序的方法,确定多个逆序后缀的逆序后缀顺序。In this application, the electronic device may determine multiple reverse suffixes in the original character string and the corresponding reverse suffix positions of each reverse suffix by traversing the first linked list. After determining the multiple reverse suffixes and the corresponding reverse suffix positions of each reverse suffix through the first linked list, the electronic device can determine the sequence of the reverse suffixes of the multiple reverse suffixes through an inductive sorting method.
S4042、根据各个所述逆序后缀在所述逆序后缀顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置生成逆序链表和所述逆序链表指纹;所述逆序链表指纹用于对所述逆序链表进行验证;S4042. Generate a reversed linked list and a fingerprint of the reversed linked list according to the order of each reversed suffix in the reversed suffix sequence and the character position of the first character of the suffix in the original character string; the reversed linked list fingerprint Used to verify the reverse linked list;
在本申请实施例中,电子设备可以根据各个逆序后缀在逆序后缀顺序中的次序确定逆序链表中各个逆序后缀的指针指向,电子设备还可以根据各个逆序后缀的后缀首字符在原始字符串内的字符位置确定各个逆序后缀在逆序链表中的后缀位置。根据各个逆序后缀对应的指针指向和后缀位置,电子设备可以生成逆序后缀链表。电子设备在生成逆序后缀链表的过程中,还可以通过指纹函数计算逆序链表指纹。在生成逆序链表后,电子设备可以基于逆序链表指纹对逆序链表进行正确性验证。In this embodiment of the application, the electronic device can determine the pointer of each reverse suffix in the reverse order linked list according to the order of each reverse suffix in the reverse order suffix sequence, and the electronic device can also determine the position of the initial character of each reverse suffix in the original string The character position determines the suffix position of each reversed suffix in the reversed linked list. According to the pointers and suffix positions corresponding to each reverse suffix, the electronic device can generate a reverse suffix linked list. During the process of generating the reverse suffix linked list, the electronic device can also calculate the fingerprint of the reverse linked list through the fingerprint function. After the reverse linked list is generated, the electronic device can verify the correctness of the reverse linked list based on the fingerprint of the reverse linked list.
另一种可能实现方式中,电子设备在基于第一链表生成逆序链表之前,还可以在生成第一链表的过程中,根据后缀首字符生成多个特殊正序桶链表。电子设备在生成多个特殊正序桶链表的过程中,还可以将各个特殊正序桶链表的开始后缀和结束后缀分别写入特殊正序开始数组和特殊正序结束数组中。电子设备还可以生成多个逆序桶链表。其中,逆序桶链表可以是多个后缀首字符相同的逆序后缀链接起来形成的单链表。电子设备在生成多个逆序桶链表后,可以获得各个逆序桶链表的开始后缀和结束后缀。在获得了逆序桶链表的多个开始后缀和结束后缀后,电子设备可以将多个逆序桶链表的开始后缀保存至逆序开始数组中,电子设备还可以将多个逆序桶链表的结束后缀保存至逆序结束数组中。In another possible implementation manner, before the electronic device generates the reverse-sequence linked list based on the first linked list, during the process of generating the first linked list, multiple special positive-sequence bucket linked lists may be generated according to the first character of the suffix. In the process of generating multiple special positive sequence bucket linked lists, the electronic device can also write the start suffix and end suffix of each special positive sequence bucket linked list into the special positive sequence start array and the special positive sequence end array respectively. The electronic device can also generate multiple reverse bucket linked lists. Wherein, the reverse-order bucket list may be a single-link list formed by linking multiple reverse-order suffixes with the same initial character of the suffix. After the electronic device generates multiple reverse bucket linked lists, it can obtain the start suffix and end suffix of each reverse bucket linked list. After obtaining multiple start suffixes and end suffixes of the reverse bucket linked list, the electronic device can save the start suffixes of multiple reverse bucket linked lists to the reverse start array, and the electronic device can also save the end suffixes of multiple reverse bucket linked lists to Reverse order ends in the array.
在本申请实施例中,电子设备在确定多个特殊正序桶链表和多个逆序桶链表后,可以根据多个特殊正序桶链表和多个逆序桶链表确定多个逆序后缀在逆序后缀顺序中的次序和多个逆序后缀在逆序链表中的逆序后缀位置。电子设备在确定多个逆序后缀的次序和逆序后缀位置之后,可以在生成逆序链表的过程中通过指纹函数生成逆序链表指纹。其中,逆序链表指纹是电子设备在逆序链表的生成过程中通过指纹函数计算多个特殊正序后缀的序列的方式生成的。In the embodiment of the present application, after the electronic device determines multiple special forward-sequence bucket lists and multiple reverse-order bucket lists, it can determine multiple reverse-sequence suffixes in the order of reverse-sequence suffixes according to multiple special forward-sequence bucket lists and multiple reverse-sequence bucket lists. The sequence in and the reverse suffix positions of multiple reverse suffixes in the reverse linked list. After the electronic device determines the sequence and position of the multiple reverse suffixes, it can generate the fingerprint of the reverse linked list through a fingerprint function during the process of generating the reverse linked list. Wherein, the reverse sequence linked list fingerprint is generated by the electronic device in the process of generating the reverse sequence linked list by calculating the sequence of multiple special positive sequence suffixes through a fingerprint function.
在一种可能的实现方式中,电子设备在生成逆序链表时,由于特殊正序桶链表是由多个后缀首字符相同的特殊正序后缀链接起来形成的单链表,逆序桶链表是由多个后缀首字符相同的逆序后缀链接起来形成的单链表。因此在生成逆序链表时,电子设备可以按照后缀首字符的字典序升序的方式,依次遍历多个特殊正序桶链表和逆序桶链表,以确定多个逆序后缀在逆序后缀顺序中的次序和多个逆序后缀在逆序链表中的逆序后缀位置。对于后缀首字符相同的特殊正序桶链表和逆序桶链表,电子设备可以先遍历逆序桶链表,再遍历特殊正序桶链表。例如,现有后缀首字符为字符a的特殊正序桶链表、后缀首字符为字符a的逆序桶链表、后缀首字符为字符c的特殊正序桶链表以及后缀首字符为字符c的逆序桶链表。因此,电子设备可以先遍历后缀首字符为字符a的逆序桶链表,再遍历后缀首字符为字符a的特殊正序桶链表,然后遍历后缀首字符为字符c的逆序桶链表,最后遍历后缀首字符为字符c的特殊正序桶链表。In a possible implementation, when the electronic device generates a reverse-sequence linked list, since the special positive-sequence bucket list is a single-linked list formed by linking multiple special positive-sequence suffixes with the same initial character of the suffix, the reverse-sequence bucket list is composed of multiple A singly linked list formed by linking reverse suffixes with the same initial character of the suffix. Therefore, when generating the reverse-order linked list, the electronic device can sequentially traverse multiple special forward-order bucket linked lists and reverse-order bucket linked lists in order to determine the order and number of multiple reverse-order suffixes in the reverse-order suffix order in ascending order according to the lexicographical order of the first character of the suffix. The reverse order suffix positions of the reverse order suffixes in the reverse order linked list. For the special forward-sequence bucket list and the reverse-sequence bucket list with the same suffix first character, the electronic device can traverse the reverse-sequence bucket list first, and then traverse the special forward-sequence bucket list. For example, there are special forward-sequence bucket lists whose suffix starts with the character a, reverse-order bucket lists whose suffix starts with the character a, special forward-sequence bucket lists whose suffix starts with the character c, and reverse-order buckets whose suffix starts with the character c linked list. Therefore, the electronic device can first traverse the reverse sequence bucket list whose suffix first character is character a, then traverse the special positive sequence bucket list whose suffix first character is character a, then traverse the reverse sequence bucket list whose suffix first character is character c, and finally traverse the suffix first character The character is a special positive sequence bucket list of character c.
在本申请实施例中,电子设备在遍历逆序桶链表时,可以先从逆序开始数组中获取当前需要遍历的逆序桶链表的开始后缀,并从逆序结束数组中获取当前需要遍历的逆序桶链表的结束后缀。根据获取到的开始后缀,电子设备可以通过链表指针依次遍历当前逆序桶链表中的各个逆序后缀,直至链表指针指向当前逆序桶链表的结束后缀。在遍历逆序桶链表的过程中,当链表指针指向逆序桶链表中的某一逆序后缀时,电子设备可以先确定链表指针指向的逆序后缀的逆序后缀位置。在确定链表指针指向的逆序后缀的逆序后缀位置后,电子设备可以通过字符类型数组,确定链表指针指向的逆序后缀对应的前继后缀的后缀类型,即通过字符类型数组确定前继后缀的首字符的字符类型。电子设备可以判断数组中存储的前继后缀的后缀类型是否为逆序后缀类型。若前继后缀的后缀类型为逆序后缀类型,则电子设备可以从原始字符串中读取该前继后缀。获取到后缀类型为逆序后缀类型的前继后缀后,电子设备可以根据该前继后缀的后缀首字符,确定该前继后缀所属的逆序桶链表。将获取到的前继后缀连接到该前继后缀所属的逆序桶链表的末尾,并将前继后缀作为写入的逆序桶链表的结束后缀,更新逆序结束数组。而后,电子设备可以根据链表指针遍历当前遍历的逆序桶链表的下一逆序后缀,直至链表指针指向当前遍历的逆序桶链表的结束后缀。In the embodiment of the present application, when traversing the reverse bucket list, the electronic device can first obtain the start suffix of the reverse bucket list that needs to be traversed from the reverse start array, and obtain the reverse bucket list that needs to be traversed from the reverse end array. end suffix. According to the obtained start suffix, the electronic device can sequentially traverse each reverse suffix in the current reverse bucket linked list through the linked list pointer until the linked list pointer points to the end suffix of the current reverse bucket linked list. In the process of traversing the reverse bucket linked list, when the linked list pointer points to a certain reverse suffix in the reverse bucket linked list, the electronic device can first determine the reverse suffix position of the reverse suffix pointed to by the linked list pointer. After determining the reverse suffix position of the reverse suffix pointed to by the linked list pointer, the electronic device can determine the suffix type of the prefix and suffix corresponding to the reverse suffix pointed to by the linked list pointer through the character type array, that is, determine the first character of the prefix and suffix through the character type array character type. The electronic device can determine whether the suffix type of the prefix and suffix stored in the array is a reverse suffix type. If the suffix type of the prefix and suffix is a reverse suffix type, the electronic device can read the prefix and suffix from the original character string. After obtaining the prefix and suffix whose suffix type is the reverse suffix type, the electronic device can determine the reverse bucket linked list to which the prefix and suffix belongs according to the first character of the suffix of the prefix and suffix. Connect the obtained prefix and suffix to the end of the reverse bucket list to which the prefix and suffix belongs, and use the prefix and suffix as the end suffix of the written reverse bucket list, and update the reverse end array. Then, the electronic device can traverse the next reverse suffix of the currently traversed reverse bucket linked list according to the linked list pointer until the linked list pointer points to the end suffix of the currently traversed reverse bucket linked list.
例如,电子设备在遍历后缀首字符为字符c的逆序桶链表时。电子设备可以从逆序开始数组中获取后缀首字符为字符c的逆序桶链表的开始后缀。然后电子设备可以通过链表指针依次遍历首字符为字符c的逆序桶链表中的各个逆序后缀,直到链表指针指向逆序桶链表的结束后缀。假设链表指针指向的逆序后缀为suf(X, pos),其中X为原始字符串,pos为逆序后缀的后缀位置。电子设备可以首先根据t[pos-1]计算逆序后缀suf(X, pos)的前继后缀的后缀类型,其中t为字符类型数组,pos-1为前继后缀的后缀位置。当字符类型数组中,用0代表逆序字符,用1代表正序字符时,如果t[pos-1]=0,即其前继后缀为的后缀类型为逆序后缀类型。则电子设备可以从原始字符串X中读取前继字符X[pos-1]。然后电子设备可以执行Y[Lbkte[Y[pos-1]]]=pos-1,将前继后缀链接至其所属后缀桶链表的末尾。链接完成后,电子设备可以执行Lbkte[Y[pos-1]]=pos-1更新前继后缀所属等后缀桶链表的结束指针。电子设备可以循环执行上述步骤,直到链表指针指向逆序后缀桶链表的结束后缀。For example, when the electronic device is traversing the reverse bucket list whose suffix starts with the character c. The electronic device can acquire the start suffix of the reverse bucket linked list whose suffix begins with the character c from the reverse start array. Then the electronic device can sequentially traverse each reverse suffix in the reverse bucket linked list whose first character is the character c through the linked list pointer until the linked list pointer points to the end suffix of the reverse bucket linked list. Assume that the reverse suffix pointed to by the linked list pointer is suf(X, pos), where X is the original string, and pos is the suffix position of the reverse suffix. The electronic device can first calculate the suffix type of the prefix and suffix of the reverse suffix suf(X, pos) according to t[pos-1], where t is an array of character types, and pos-1 is the suffix position of the prefix and suffix. When in the character type array, 0 is used to represent reverse sequence characters, and 1 is used to represent positive sequence characters, if t[pos-1]=0, that is, the suffix type of its predecessor and suffix is reverse sequence suffix type. Then the electronic device can read the preceding character X[pos-1] from the original character string X. Then the electronic device can execute Y[Lbkte[Y[pos-1]]]=pos-1 to link the prefix and suffix to the end of the suffix bucket list to which it belongs. After the link is completed, the electronic device can execute Lbkte[Y[pos-1]]=pos-1 to update the end pointer of the equal suffix bucket linked list to which the prefix and suffix belong. The electronic device may perform the above steps in a loop until the pointer of the linked list points to the end suffix of the reverse suffix bucket linked list.
在本申请实施例中,电子设备在遍历特殊正序桶链表时,可以先从特殊正序开始数组中获取当前需要遍历的特殊正序桶链表的开始后缀,并从特殊正序结束数组中获取当前需要遍历的特殊正序桶链表的结束后缀。根据获取到的开始后缀,电子设备可以通过链表指针依次遍历当前特殊正序桶链表中的各个特殊正序后缀,直至链表指针指向当前遍历的特殊正序桶链表的结束后缀。在遍历特殊正序桶链表的过程中,当链表指针指向特殊正序桶链表中的某一特殊正序后缀时,电子设备可以先确定链表指针指向的特殊正序后缀的特殊正序后缀位置。在确定链表指针指向的特殊正序后缀的特殊正序后缀位置后,电子设备可以通过字符类型数组,确定链表指针指向的特殊正序后缀对应的前继后缀的后缀类型,即通过字符类型数组确定前继后缀的首字符的字符类型。电子设备可以判断数组中存储的前继后缀的后缀类型是否为逆序后缀类型。若前继后缀的后缀类型为逆序后缀类型,则电子设备可以从原始字符串中读取该前继后缀。获取到后缀类型为逆序后缀类型的前继后缀后,电子设备可以根据该前继后缀的后缀首字符,确定该前继后缀所属的逆序桶链表。将获取到的前继后缀连接到该前继后缀所属的逆序桶链表的末尾,并将前继后缀作为写入的逆序桶链表的结束后缀,更新逆序结束数组。在更新完逆序结束数组后,电子设备可以根据当前链表指针指向的特殊正序后缀的后缀位置,通过指纹函数迭代计算多个特殊正序后缀的逆序链表指纹。而后,电子设备可以根据链表指针遍历当前遍历的特殊正序桶链表的下一特殊正序后缀,直至链表指针指向当前遍历的特殊正序桶链表的结束后缀。In this embodiment of the application, when the electronic device traverses the special positive sequence bucket linked list, it can first obtain the start suffix of the special positive sequence bucket linked list that needs to be traversed from the special positive sequence start array, and obtain it from the special positive sequence end array. The end suffix of the special forward-ordered bucket list that needs to be traversed currently. According to the obtained start suffix, the electronic device can sequentially traverse each special positive sequence suffix in the current special positive sequence bucket linked list through the linked list pointer until the linked list pointer points to the end suffix of the currently traversed special positive sequence bucket linked list. In the process of traversing the special positive sequence bucket linked list, when the linked list pointer points to a special positive sequence suffix in the special positive sequence bucket linked list, the electronic device can first determine the special positive sequence suffix position of the special positive sequence suffix pointed to by the linked list pointer. After determining the special positive sequence suffix position of the special positive sequence suffix pointed to by the linked list pointer, the electronic device can determine the suffix type of the prefix and suffix corresponding to the special positive sequence suffix pointed to by the linked list pointer through the character type array, that is, determine through the character type array The character type of the first character following the prefix and suffix. The electronic device can determine whether the suffix type of the prefix and suffix stored in the array is a reverse suffix type. If the suffix type of the prefix and suffix is a reverse suffix type, the electronic device can read the prefix and suffix from the original character string. After obtaining the prefix and suffix whose suffix type is the reverse suffix type, the electronic device can determine the reverse bucket linked list to which the prefix and suffix belongs according to the first character of the suffix of the prefix and suffix. Connect the obtained prefix and suffix to the end of the reverse bucket list to which the prefix and suffix belongs, and use the prefix and suffix as the end suffix of the written reverse bucket list, and update the reverse end array. After updating the reverse-order end array, the electronic device can iteratively calculate the reverse-order linked list fingerprints of multiple special forward-order suffixes through the fingerprint function according to the suffix position of the special forward-order suffix pointed to by the current linked list pointer. Then, the electronic device can traverse the next special positive sequence suffix of the currently traversed special positive sequence bucket linked list according to the linked list pointer until the linked list pointer points to the end suffix of the currently traversed special positive sequence bucket linked list.
例如,电子设备在遍历后缀首字符为字符c的特殊正序桶链表时。电子设备可以从特殊正序开始数组中获取后缀首字符为字符c的特殊正序桶链表的开始后缀。然后电子设备可以通过链表指针依次遍历首字符为字符c的特殊正序桶链表中的各个特殊正序后缀,直到链表指针指向特殊正序桶链表的结束后缀。假设链表指针指向的特殊正序后缀为suf(X, pos),其中X为原始字符串,pos为特殊正序后缀的后缀位置。电子设备可以首先根据t[pos-1]计算特殊正序后缀suf(X, pos)的前继后缀的后缀类型,其中t为字符类型数组,pos-1为前继后缀的后缀位置。当字符类型数组中,用0代表逆序字符,用1代表正序字符时,如果t[pos-1]=0,即其前继后缀为的后缀类型为逆序后缀类型。则电子设备可以从原始字符串X中读取前继字符X[pos-1]。然后电子设备可以执行Y[Lbkte[Y[pos-1]]]=pos-1,将前继后缀链接至其所属后缀桶链表的末尾。链接完成后,电子设备可以执行Lbkte[Y[pos-1]]=pos-1更新前继后缀所属等后缀桶链表的结束指针。最后根据特殊正序后缀的后缀位置pos,使用指纹函数FP迭代就计算升序特殊正序后缀的逆序链表指纹fp2。电子设备可以循环执行上述步骤,直到链表指针指向特殊正序后缀桶链表的结束后缀。For example, when an electronic device is traversing a special positive sequence bucket list whose suffix begins with the character c. The electronic device can obtain the start suffix of the special positive sequence bucket list whose suffix begins with the character c from the special positive sequence start array. Then the electronic device can sequentially traverse each special positive sequence suffix in the special positive sequence bucket list whose first character is the character c through the linked list pointer until the linked list pointer points to the end suffix of the special positive sequence bucket linked list. Assume that the special positive sequence suffix pointed to by the linked list pointer is suf(X, pos), where X is the original string, and pos is the suffix position of the special positive sequence suffix. The electronic device can first calculate the suffix type of the prefix and suffix of the special positive sequence suffix suf(X, pos) according to t[pos-1], where t is an array of character types, and pos-1 is the suffix position of the prefix and suffix. When in the character type array, 0 is used to represent reverse sequence characters, and 1 is used to represent positive sequence characters, if t[pos-1]=0, that is, the suffix type of its predecessor and suffix is reverse sequence suffix type. Then the electronic device can read the preceding character X[pos-1] from the original character string X. Then the electronic device can execute Y[Lbkte[Y[pos-1]]]=pos-1 to link the prefix and suffix to the end of the suffix bucket list to which it belongs. After the link is completed, the electronic device can execute Lbkte[Y[pos-1]]=pos-1 to update the end pointer of the equal suffix bucket linked list to which the prefix and suffix belong. Finally, according to the suffix position pos of the special positive sequence suffix, use the fingerprint function FP iteration to calculate the reverse sequence linked list fingerprint fp2 of the ascending special positive sequence suffix. The electronic device can perform the above steps in a loop until the linked list pointer points to the end suffix of the special positive sequence suffix bucket linked list.
在本申请实施例中,由于在构造正序链表的过程中,电子设备通过指纹函数迭代计算多个升序特殊正序后缀的后缀位置可以获得逆序链表指纹。由于逆序链表指纹是电子设备在构造逆序链表的过程中,通过多个特殊正序后缀的对应的后缀位置计算出来的,因此逆序链表指纹中可以包含构造逆序链表的过程中,多个特殊正序后缀的升序序列信息。因此,电子设备可以直接通过判断正序链表指纹与第一链接指纹是否相等的方式,确定逆序链表是否正确。因此通过本申请实施例提供的方法构造后缀链表,可以在构造后缀链表的过程中确定构造出的逆序链表的正确性,无需对逆序链表进行解压缩等操作。因此,本申请实施例提供的方法可以节约后缀链表的验证时间和验证空间。此外由于本申请实施例将逆序链表的正确性验证方法,集成到链表构造过程中,因此逆序链表构造结束的同时电子设备可以基于第一移动指纹和逆序链表指纹给出逆序链表的验证结果,可以提高后缀链表的验证效率。In the embodiment of the present application, since the electronic device iteratively calculates the suffix positions of multiple ascending special forward-order suffixes through the fingerprint function during the process of constructing the forward-order linked list, the fingerprint of the reverse-order linked list can be obtained. Since the fingerprint of the reverse linked list is calculated by the corresponding suffix positions of multiple special positive sequence suffixes in the process of constructing the reverse linked list, the fingerprint of the reverse linked list can include multiple special positive sequence suffixes in the process of constructing the reverse linked list. Suffix information in ascending order. Therefore, the electronic device can directly determine whether the reverse sequence linked list is correct by judging whether the fingerprint of the forward sequence linked list is equal to the first link fingerprint. Therefore, by constructing the suffix linked list through the method provided by the embodiment of the present application, the correctness of the constructed reversed linked list can be confirmed during the process of constructing the suffix linked list, without decompressing the reversed linked list. Therefore, the method provided by the embodiment of the present application can save the verification time and verification space of the suffix linked list. In addition, because the embodiment of the present application integrates the correctness verification method of the reverse linked list into the process of constructing the linked list, the electronic device can give the verification result of the reversed linked list based on the first mobile fingerprint and the fingerprint of the reversed linked list when the construction of the reversed linked list is completed, and can Improve the verification efficiency of the suffix linked list.
S4043、根据所述逆序链表确定多个所述正序后缀的正序后缀顺序;S4043. Determine the sequence of the positive sequence suffixes of the plurality of positive sequence suffixes according to the reverse sequence linked list;
在本申请实施例中,电子设备可以通过遍历逆序链表的方式,确定原始字符串中的多个正序后缀和各个正序后缀对应的逆序后缀位置。在通过第一链表确定多个正序后缀和各个正序后缀对应的正序后缀位置后,电子设备可以通过归纳排序的方法,确定多个正序后缀的正序后缀顺序。In the embodiment of the present application, the electronic device can determine the position of the reverse sequence suffix corresponding to the multiple normal sequence suffixes in the original character string by traversing the reverse sequence linked list. After determining the multiple positive-sequence suffixes and the corresponding positive-sequence suffix positions through the first linked list, the electronic device can determine the order of the multiple positive-sequence suffixes through an inductive sorting method.
S4044、根据各个所述正序后缀在所述正序后缀顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置生成正序链表和所述正序链表指纹;所述正序链表指纹用于对所述正序链表进行验证。S4044. Generate a positive sequence linked list and a fingerprint of the positive sequence linked list according to the order of each positive sequence suffix in the positive sequence suffix sequence and the character position of the first character of the suffix in the original character string; The positive sequence linked list fingerprint is used to verify the positive sequence linked list.
在本申请实施例中,电子设备可以根据各个正序后缀在正序后缀顺序中的次序确定正序链表中各个正序后缀的指针指向,电子设备还可以根据各个正序后缀的后缀首字符在原始字符串内的字符位置确定各个正序后缀在正序链表中的后缀位置。根据各个正序后缀对应的指针指向和后缀位置,电子设备可以生成正序后缀链表。电子设备在生成正序后缀链表的过程中,还可以通过指纹函数计算正序链表指纹。在生成正序链表后,电子设备可以基于正序链表指纹对正序链表进行正确性验证。In this embodiment of the application, the electronic device can determine the pointers of each positive-sequence suffix in the positive-sequence linked list according to the order of each positive-sequence suffix in the sequence of the positive-sequence suffix. The character position in the original string determines the suffix position of each positive-sequence suffix in the positive-sequence linked list. According to the pointers and suffix positions corresponding to each positive sequence suffix, the electronic device can generate a positive sequence suffix linked list. In the process of generating the positive sequence suffix linked list, the electronic device can also calculate the fingerprint of the positive sequence linked list through the fingerprint function. After the positive sequence linked list is generated, the electronic device can verify the correctness of the positive sequence linked list based on the positive sequence linked list fingerprint.
另一种可能实现方式中,电子设备在基于逆序链表生成正序链表之前,还可以在生成逆序链表的过程之前,根据后缀首字符生成多个逆序桶链表。电子设备在生成多个逆序桶链表的过程中,还可以将各个逆序桶链表的开始后缀和结束后缀分别写入逆序开始数组和逆序结束数组中。此外,电子设备还可以生成多个正序桶链表。其中,正序桶链表可以是多个后缀首字符相同的正序后缀链接起来形成的单链表。电子设备在生成多个正序桶链表后,可以获得各个正序桶链表的开始后缀和结束后缀。在获得了正序桶链表的多个开始后缀和结束后缀后,电子设备可以将多个正序桶链表的开始后缀保存至正序开始数组中,电子设备还可以将多个正序桶链表的结束后缀保存至正序结束数组中。In another possible implementation manner, before the electronic device generates the forward-sequence linked list based on the reverse-sequence linked list, before the process of generating the reverse-sequence linked list, it may generate multiple reverse-sequence bucket linked lists according to the first character of the suffix. During the process of generating multiple reverse bucket linked lists, the electronic device may also write the start suffix and end suffix of each reverse bucket linked list into the reverse start array and the reverse end array respectively. In addition, the electronic device can also generate multiple positive sequence bucket linked lists. Wherein, the positive sequence bucket linked list may be a single linked list formed by linking multiple positive sequence suffixes with the same initial character of the suffix. After the electronic device generates multiple positive sequence bucket lists, it can obtain the start suffix and end suffix of each positive sequence bucket list. After obtaining multiple start suffixes and end suffixes of the positive sequence bucket list, the electronic device can save the start suffixes of the multiple positive sequence bucket list in the positive sequence start array, and the electronic device can also save the multiple positive sequence bucket list The end suffix is stored in the end array in positive order.
在本申请实施例中,电子设备在确定多个正序桶链表和多个逆序桶链表后,可以根据多个正序桶链表和多个逆序桶链表确定多个正序后缀在正序后缀顺序中的次序和多个正序后缀在正序链表中的正序后缀位置。电子设备在确定多个正序后缀的次序和逆序后缀位置之后,可以在生成正序链表的过程中通过指纹函数生成正序链表指纹。其中,正序链表指纹是电子设备在正序链表的生成过程中通过指纹函数计算多个特殊正序后缀的序列的方式生成的。In the embodiment of the present application, after the electronic device determines the multiple forward-sequence bucket lists and the multiple reverse-order bucket lists, it can determine the order of the forward-sequence suffixes in the forward-sequence suffixes according to the multiple forward-sequence bucket lists and the multiple reverse-sequence bucket lists. The order in and the positive-order suffix positions of multiple positive-order suffixes in the positive-order linked list. After the electronic device determines the order of the multiple forward-sequence suffixes and the positions of the reverse-order suffixes, it can generate the fingerprint of the forward-sequence linked list through a fingerprint function during the process of generating the forward-sequence linked list. Wherein, the positive sequence linked list fingerprint is generated by the electronic device in the process of generating the positive sequence linked list by calculating the sequence of multiple special positive sequence suffixes through a fingerprint function.
在一种可能的实现方式中,电子设备在生成正序链表时,由于正序桶链表是由多个后缀首字符相同的正序后缀链接起来形成的单链表。逆序桶链表都是由多个后缀首字符相同的逆序后缀链接起来形成的单链表。因此在生成正序链表时,电子设备可以按照后缀首字符的字典序升序的方式,依次遍历多个正序桶链表和逆序桶链表,以确定多个正序后缀在正序后缀顺序中的次序和多个正序后缀在正序链表中的正序后缀位置。对于后缀首字符相同的正序桶链表和逆序桶链表,电子设备可以先遍历正序桶链表,再遍历逆序桶链表。例如,现有后缀首字符为字符a的正序桶链表、后缀首字符为字符a的逆序桶链表、后缀首字符为字符c的正序桶链表以及后缀首字符为字符c的逆序桶链表。因此,电子设备可以先遍历后缀首字符为字符a的正序桶链表,再遍历后缀首字符为字符a的逆序桶链表,然后遍历后缀首字符为字符c的正序桶链表,最后遍历后缀首字符为字符c的逆序桶链表。In a possible implementation manner, when the electronic device generates the positive sequence linked list, the positive sequence bucket linked list is a single linked list formed by linking multiple positive sequence suffixes with the same initial character of the suffix. The reverse bucket linked list is a singly linked list formed by linking multiple reverse suffixes with the same initial character of the suffix. Therefore, when generating a forward-sequence linked list, the electronic device can sequentially traverse multiple forward-sequence bucket linked lists and reverse-sequence bucket linked lists in ascending order according to the lexicographical order of the first character of the suffix to determine the order of multiple forward-sequence suffixes in the positive-sequence suffix order and the positive-order suffix positions of multiple positive-order suffixes in the positive-order linked list. For the forward-sequence bucket list and the reverse-sequence bucket list with the same suffix first character, the electronic device can traverse the forward-sequence bucket list first, and then traverse the reverse-sequence bucket list. For example, there are existing positive-sequence bucket lists whose suffix starts with the character a, reverse-order bucket lists whose suffix starts with the character a, forward-order bucket lists whose suffix starts with the character c, and reverse-order bucket lists whose suffix starts with the character c. Therefore, the electronic device can first traverse the positive sequence bucket list whose suffix first character is the character a, then traverse the reverse sequence bucket list whose suffix first character is the character a, then traverse the positive sequence bucket list whose suffix first character is the character c, and finally traverse the suffix first The character is a reverse bucket list of character c.
在本申请实施例中,电子设备在遍历正序桶链表时,可以先从正序开始数组中获取当前需要遍历的正序桶链表的开始后缀,并从正序结束数组中获取当前需要遍历的正序桶链表的结束后缀。根据获取到的开始后缀,电子设备可以通过链表指针依次遍历当前正序桶链表中的各个正序后缀,直至链表指针指向当前遍历的正序桶链表的结束后缀。在遍历正序桶链表的过程中,当链表指针指向正序桶链表中的某一正序后缀时,电子设备可以先确定链表指针指向的正序后缀的正序后缀位置。在确定链表指针指向的正序后缀的正序后缀位置后,电子设备可以通过字符类型数组,确定链表指针指向的正序后缀对应的前继后缀的后缀类型,即通过字符类型数组确定前继后缀的首字符的字符类型。电子设备可以判断数组中存储的前继后缀的后缀类型是否为正序后缀类型。若前继后缀的后缀类型为正序后缀类型,则电子设备可以从原始字符串中读取该前继后缀。获取到后缀类型为正序后缀类型的前继后缀后,电子设备可以根据该前继后缀的后缀首字符,确定该前继后缀所属的逆序桶链表。将获取到的前继后缀连接到该前继后缀所属的逆序桶链表的末尾,并将前继后缀作为写入的正序桶链表的结束后缀,更新正序结束数组。在更新完正序结束数组后,电子设备可以根据字符类型数组判断当前链表指针指向的正序后缀和/或该正序后缀对应的前继后缀是否为特殊正序后缀。若当前链表指针指向的正序后缀和/或该正序后缀对应的前继后缀为特殊正序后缀,则电子设备可以根据特殊正序后缀对应的后缀位置,通过指纹函数迭代计算多个特殊正序后缀的正序链表指纹。电子设备可以根据链表指针遍历当前遍历的正序桶链表的下一正序后缀,直至链表指针指向当前遍历的正序桶链表的结束后缀。In the embodiment of the present application, when traversing the positive sequence bucket list, the electronic device can first obtain the start suffix of the positive sequence bucket list that needs to be traversed from the positive sequence start array, and obtain the current sequence bucket list to be traversed from the positive sequence end array. The end suffix of the positive order bucket list. According to the obtained start suffix, the electronic device can sequentially traverse each positive sequence suffix in the current positive sequence bucket linked list through the linked list pointer until the linked list pointer points to the end suffix of the currently traversed positive sequence bucket linked list. In the process of traversing the positive sequence bucket linked list, when the linked list pointer points to a certain positive sequence suffix in the positive sequence bucket linked list, the electronic device can first determine the positive sequence suffix position of the positive sequence suffix pointed to by the linked list pointer. After determining the positive sequence suffix position of the positive sequence suffix pointed to by the linked list pointer, the electronic device can determine the suffix type of the prefix and suffix corresponding to the positive sequence suffix pointed to by the linked list pointer through the character type array, that is, determine the prefix and suffix through the character type array The character type of the first character of . The electronic device can determine whether the suffix type of the prefix and suffix stored in the array is a positive sequence suffix type. If the suffix type of the prefix and suffix is a positive sequence suffix type, the electronic device can read the prefix and suffix from the original character string. After obtaining the prefix and suffix whose suffix type is the positive sequence suffix type, the electronic device can determine the reverse-order bucket list to which the prefix and suffix belongs according to the first character of the suffix of the prefix and suffix. Connect the obtained prefix and suffix to the end of the reverse-order bucket list to which the prefix and suffix belongs, and use the prefix and suffix as the end suffix of the written positive-order bucket list to update the positive-order end array. After updating the positive sequence end array, the electronic device can determine whether the positive sequence suffix pointed to by the current linked list pointer and/or the preceding and suffix corresponding to the positive sequence suffix are special positive sequence suffixes according to the character type array. If the positive sequence suffix pointed to by the current linked list pointer and/or the corresponding prefix and suffix of the positive sequence suffix is a special positive sequence suffix, the electronic device can iteratively calculate multiple special positive sequence suffixes through the fingerprint function according to the suffix position corresponding to the special positive sequence suffix. Ordinal linked list fingerprint of sequence suffix. The electronic device can traverse the next positive sequence suffix of the currently traversed positive sequence bucket linked list according to the linked list pointer until the linked list pointer points to the end suffix of the currently traversed positive sequence bucket linked list.
例如,电子设备在遍历后缀首字符为字符c的正序桶链表时。电子设备可以从正序开始数组中获取后缀首字符为字符c的正序桶链表的开始后缀。然后电子设备可以通过链表指针依次遍历首字符为字符c的正序桶链表中的各个正序后缀,直到链表指针指向正序桶链表的结束后缀。假设链表指针指向的正序后缀为suf(X, pos),其中X为原始字符串,pos为正序后缀的后缀位置。电子设备可以首先根据t[pos-1]计算正序后缀suf(X, pos)的前继后缀的后缀类型,其中t为字符类型数组,pos-1为前继后缀的后缀位置。当字符类型数组中,用0代表逆序字符,用1代表正序字符时,如果t[pos-1]=1,即其前继后缀为的后缀类型为正序后缀类型。则电子设备可以从原始字符串X中读取前继字符X[pos-1]。然后电子设备可以执行Y[Sbkte[Y[pos-1]]]=pos-1,将前继后缀链接至其所属后缀桶链表的末尾。链接完成后,电子设备可以执行Sbkte[Y[pos-1]]=pos-1更新前继后缀所属等后缀桶链表的结束指针。最后电子设备可以基于链表指针当前指向的正序后缀的对应后缀位置pos和该正序后缀的前继后缀对应的后缀位置pos-1,通过字符类型数组判断链表指针当前指向的正序后缀和/或该正序后缀的前继后缀是否为特殊正序后缀。若链表指针当前指向的正序后缀和/或该正序后缀的前继后缀为特殊正序后缀,则电子设备可以使用指纹函数FP迭代就计算多个降序特殊正序后缀的正序链表指纹fp3。电子设备可以循环执行上述步骤,直到链表指针指向正序后缀桶链表的结束后缀。For example, when the electronic device is traversing the positive sequence bucket list whose suffix starts with the character c. The electronic device can obtain the start suffix of the positive sequence bucket list whose suffix starts with the character c from the positive sequence start array. Then the electronic device can sequentially traverse each positive sequence suffix in the positive sequence bucket linked list whose first character is the character c through the linked list pointer until the linked list pointer points to the end suffix of the positive sequence bucket linked list. Assume that the positive sequence suffix pointed to by the linked list pointer is suf(X, pos), where X is the original string, and pos is the suffix position of the positive sequence suffix. The electronic device can first calculate the suffix type of the prefix and suffix of the positive sequence suffix suf(X, pos) according to t[pos-1], where t is an array of character types, and pos-1 is the suffix position of the prefix and suffix. When in the character type array, 0 is used to represent reverse sequence characters, and 1 is used to represent positive sequence characters, if t[pos-1]=1, that is, the suffix type of its predecessor and suffix is positive sequence suffix type. Then the electronic device can read the preceding character X[pos-1] from the original character string X. Then the electronic device can execute Y[Sbkte[Y[pos-1]]]=pos-1, and link the prefix and suffix to the end of the suffix bucket list to which it belongs. After the link is completed, the electronic device can execute Sbkte[Y[pos-1]]=pos-1 to update the end pointer of the equal suffix bucket linked list to which the prefix and suffix belong. Finally, based on the corresponding suffix position pos of the positive sequence suffix currently pointed to by the linked list pointer and the corresponding suffix position pos-1 of the prefix and suffix of the positive sequence suffix, the electronic device can determine the positive sequence suffix currently pointed to by the linked list pointer and / through the character type array Or whether the preceding suffix of the positive sequence suffix is a special positive sequence suffix. If the positive sequence suffix currently pointed to by the linked list pointer and/or the prefix and suffix of the positive sequence suffix is a special positive sequence suffix, the electronic device can use the fingerprint function FP to iterate and calculate the positive sequence linked list fingerprint fp3 of multiple descending special positive sequence suffixes . The electronic device can perform the above steps in a loop until the linked list pointer points to the end suffix of the positive sequence suffix bucket linked list.
在本申请实施例中,电子设备在遍历逆序桶链表时,可以先从逆序开始数组中获取当前需要遍历的逆序桶链表的开始后缀,并从逆序结束数组中获取当前需要遍历的逆序桶链表的结束后缀。根据获取到的开始后缀,电子设备可以通过链表指针依次遍历当前逆序桶链表中的各个逆序后缀,直至链表指针指向当前逆序桶链表的结束后缀。在遍历逆序桶链表的过程中,当链表指针指向逆序桶链表中的某一逆序后缀时,电子设备可以先确定链表指针指向的逆序后缀的逆序后缀位置。在确定链表指针指向的逆序后缀的逆序后缀位置后,电子设备可以通过字符类型数组,确定链表指针指向的逆序后缀对应的前继后缀的后缀类型,即通过字符类型数组确定前继后缀的首字符的字符类型。电子设备可以判断数组中存储的前继后缀的后缀类型是否为正序后缀类型。若前继后缀的后缀类型为正序后缀类型,则电子设备可以从原始字符串中读取该前继后缀。获取到后缀类型为正序后缀类型的前继后缀后,电子设备可以根据该前继后缀的后缀首字符,确定该前继后缀所属的正序桶链表。将获取到的前继后缀连接到该前继后缀所属的正序桶链表的末尾,并将前继后缀作为写入的正序桶链表的结束后缀,更新正序结束数组。而后,电子设备可以根据链表指针遍历当前遍历的逆序桶链表的下一逆序后缀,直至链表指针指向当前遍历的逆序桶链表的结束后缀。In the embodiment of the present application, when traversing the reverse bucket list, the electronic device can first obtain the start suffix of the reverse bucket list that needs to be traversed from the reverse start array, and obtain the reverse bucket list that needs to be traversed from the reverse end array. end suffix. According to the obtained start suffix, the electronic device can sequentially traverse each reverse suffix in the current reverse bucket linked list through the linked list pointer until the linked list pointer points to the end suffix of the current reverse bucket linked list. In the process of traversing the reverse bucket linked list, when the linked list pointer points to a certain reverse suffix in the reverse bucket linked list, the electronic device can first determine the reverse suffix position of the reverse suffix pointed to by the linked list pointer. After determining the reverse suffix position of the reverse suffix pointed to by the linked list pointer, the electronic device can determine the suffix type of the prefix and suffix corresponding to the reverse suffix pointed to by the linked list pointer through the character type array, that is, determine the first character of the prefix and suffix through the character type array character type. The electronic device can determine whether the suffix type of the prefix and suffix stored in the array is a positive sequence suffix type. If the suffix type of the prefix and suffix is a positive sequence suffix type, the electronic device can read the prefix and suffix from the original character string. After obtaining the prefix and suffix whose suffix type is the positive sequence suffix type, the electronic device can determine the positive sequence bucket list to which the prefix and suffix belongs according to the first character of the suffix of the prefix and suffix. Connect the obtained prefix and suffix to the end of the positive sequence bucket list to which the prefix and suffix belongs, and use the prefix and suffix as the end suffix of the written positive sequence bucket list to update the positive sequence end array. Then, the electronic device can traverse the next reverse suffix of the currently traversed reverse bucket linked list according to the linked list pointer until the linked list pointer points to the end suffix of the currently traversed reverse bucket linked list.
例如,电子设备在遍历后缀首字符为字符c的逆序桶链表时。电子设备可以从逆序开始数组中获取后缀首字符为字符c的逆序桶链表的开始后缀。然后电子设备可以通过链表指针依次遍历首字符为字符c的逆序桶链表中的各个逆序后缀,直到链表指针指向逆序桶链表的结束后缀。假设链表指针指向的逆序后缀为suf(X, pos),其中X为原始字符串,pos为逆序后缀的后缀位置。电子设备可以首先根据t[pos-1]计算逆序后缀suf(X, pos)的前继后缀的后缀类型,其中t为字符类型数组,pos-1为前继后缀的后缀位置。当字符类型数组中,用0代表逆序字符,用1代表正序字符时,如果t[pos-1]=1,即其前继后缀为的后缀类型为正序后缀类型。则电子设备可以从原始字符串X中读取前继字符X[pos-1]。然后电子设备可以执行Y[Sbkte[Y[pos-1]]]=pos-1,将前继后缀链接至其所属后缀桶链表的末尾。链接完成后,电子设备可以执行Sbkte[Y[pos-1]]=pos-1更新前继后缀所属等后缀桶链表的结束指针。电子设备可以循环执行上述步骤,直到链表指针指向逆序后缀桶链表的结束后缀。For example, when the electronic device is traversing the reverse bucket list whose suffix starts with the character c. The electronic device can acquire the start suffix of the reverse bucket linked list whose suffix begins with the character c from the reverse start array. Then the electronic device can sequentially traverse each reverse suffix in the reverse bucket linked list whose first character is the character c through the linked list pointer until the linked list pointer points to the end suffix of the reverse bucket linked list. Assume that the reverse suffix pointed to by the linked list pointer is suf(X, pos), where X is the original string, and pos is the suffix position of the reverse suffix. The electronic device can first calculate the suffix type of the prefix and suffix of the reverse suffix suf(X, pos) according to t[pos-1], where t is an array of character types, and pos-1 is the suffix position of the prefix and suffix. When in the character type array, 0 is used to represent reverse sequence characters, and 1 is used to represent positive sequence characters, if t[pos-1]=1, that is, the suffix type of its predecessor and suffix is positive sequence suffix type. Then the electronic device can read the preceding character X[pos-1] from the original character string X. Then the electronic device can execute Y[Sbkte[Y[pos-1]]]=pos-1, and link the prefix and suffix to the end of the suffix bucket list to which it belongs. After the link is completed, the electronic device can execute Sbkte[Y[pos-1]]=pos-1 to update the end pointer of the equal suffix bucket linked list to which the prefix and suffix belong. The electronic device may perform the above steps in a loop until the pointer of the linked list points to the end suffix of the reverse suffix bucket linked list.
在本申请实施例中,由于在构造正序链表的过程中,电子设备通过指纹函数迭代计算多个降序特殊正序后缀的后缀位置可以获得正序链表指纹,由于正序链表指纹是电子设备在构造正序链表的过程中,通过多个特殊正序后缀的对应的后缀位置计算出来的,因此正序链表指纹中可以包含构造正序链表的过程中,多个特殊正序后缀的降序序列信息。因此,电子设备可以直接通过判断正序链表指纹与第一链接指纹是否相等的方式,确定正序链表是否正确。因此通过本申请实施例提供的方法构造后缀链表,可以在构造后缀链表的过程中确定构造出的正序链表的正确性。因此,本申请实施例提供的方法可以节约后缀链表的验证时间和空间。此外由于本申请实施例中,电子设备通过指纹函数迭代计算的方式,确定正序链表指纹和第一链接指纹,因此通过本申请实施例提供的方法验证后缀链表的准确性较高。In the embodiment of the present application, since the electronic device iteratively calculates the suffix positions of multiple descending special positive sequence suffixes through the fingerprint function in the process of constructing the positive sequence linked list, the fingerprint of the positive sequence linked list can be obtained. In the process of constructing the positive sequence linked list, it is calculated by the corresponding suffix positions of multiple special positive sequence suffixes, so the positive sequence linked list fingerprint can contain the descending sequence information of multiple special positive sequence suffixes in the process of constructing the positive sequence linked list . Therefore, the electronic device can directly determine whether the positive sequence linked list is correct by judging whether the positive sequence linked list fingerprint is equal to the first link fingerprint. Therefore, by constructing the suffix linked list through the method provided in the embodiment of the present application, the correctness of the constructed positive sequence linked list can be determined during the process of constructing the suffix linked list. Therefore, the method provided by the embodiment of the present application can save time and space for verifying the suffix linked list. In addition, because in the embodiment of the present application, the electronic device determines the fingerprint of the positive sequence linked list and the first link fingerprint through iterative calculation of the fingerprint function, the accuracy of verifying the suffix linked list through the method provided in the embodiment of the present application is relatively high.
S405、根据各个所述第二字符类型的所述第二链表,生成所述原始字符串对应的后缀链表。S405. Generate a suffix linked list corresponding to the original character string according to the second linked list of each of the second character types.
在本申请实施例中,电子设备在生成多个第二字符类型的第二链表后,可以通过将多个第二链表中的多个第二后缀链接起来的方式,生成原始字符串对应的后缀链表。In the embodiment of the present application, after the electronic device generates a plurality of second linked lists of the second character type, the suffix corresponding to the original character string can be generated by linking the plurality of second suffixes in the plurality of second linked lists. linked list.
在一种可能实现方式中,电子设备在生成逆序链表和正序链表之后,可以通过逆序开始数组和逆序结束数组,确定多个逆序桶链表的开始后缀和结束后缀。电子设备还可以通过正序开始数组和正序结束数组,确定多个正序桶链表的开始后缀和结束后缀。电子设备可以基于多个逆序桶链表的开始后缀和结束后缀以及多个正序桶链表的开始后缀和结束后缀,通过遍历正序链表和逆序链表的方式,将多个正序后缀和逆序后缀链接起来,生成原始字符串对应的后缀链表。其中正序链表和逆序链表可以是降序的正序链表和降序的逆序链表,相应的生成的后缀链表也可以是降序的后缀链表。In a possible implementation manner, after the electronic device generates the reverse-order linked list and the forward-order linked list, it can determine the start suffix and the end suffix of multiple reverse-order bucket linked lists through the reverse-order start array and the reverse-order end array. The electronic device can also determine the start suffix and end suffix of multiple positive sequence bucket linked lists through the positive sequence start array and the positive sequence end array. Based on the start suffix and end suffix of multiple reverse-sequence bucket linked lists and the start suffix and end suffix of multiple positive-sequence bucket linked lists, the electronic device can link multiple forward-order suffixes and reverse-order suffixes by traversing the forward-order linked list and reverse-order linked list Get up and generate the suffix linked list corresponding to the original string. The forward-order linked list and the reverse-order linked list may be a descending forward-order linked list and a descending reverse-order linked list, and the corresponding generated suffix linked list may also be a descending-order suffix linked list.
在本申请实施例中,电子设备在生成后缀链表后,可以根据第一指纹和第二指纹对后缀链表进行正确性验证。在一种可能实现方式中,第一指纹可以包括第一移动指纹和第一链接指纹,第二指纹可以包括逆序链表指纹和正序链表指纹。而第一移动指纹中包含多个特殊正序后缀的降序次序信息,第一链接指纹中包含多个特殊正序后缀的升序次序信息。逆序链表指纹中包含着构造逆序链表过程中使用的多个特殊正序后缀的降序次序信息。正序链表指纹中包含着构造正序链表过程中使用的多个特殊正序后缀的升序次序信息。In the embodiment of the present application, after the electronic device generates the suffix linked list, it can verify the correctness of the suffix linked list according to the first fingerprint and the second fingerprint. In a possible implementation manner, the first fingerprint may include a first mobile fingerprint and a first link fingerprint, and the second fingerprint may include a reverse-sequence linked list fingerprint and a forward-sequence linked list fingerprint. The first mobile fingerprint contains descending sequence information of multiple special positive sequence suffixes, and the first link fingerprint contains ascending sequence information of multiple special positive sequence suffixes. The reverse linked list fingerprint contains the descending order information of multiple special positive sequence suffixes used in the process of constructing the reverse linked list. The positive sequence linked list fingerprint contains the ascending order information of multiple special positive sequence suffixes used in the process of constructing the positive sequence linked list.
因此,电子设备可以通过判断第一移动指纹是否等于逆序链表指纹,确定在构造逆序链表的过程中多个特殊正序后缀的降序次序是否发生变化。若第一移动指纹等于逆序链表指纹,则电子设备可以判断在构造逆序链表的过程中多个特殊正序后缀的降序次序没有发生变化,即电子设备可以判断逆序链表是正确的,逆序链表中的各个逆序后缀没有遗漏,且各个逆序后缀的后缀位置正确。若第一移动指纹不等于逆序链表指纹,则电子设备可以判断在构造逆序链表的过程中多个特殊正序后缀的降序次序发生了变化,即电子设备可以判断在构造逆序链表的过程中可能出现了遗留逆序后缀或逆序后缀的后缀位置对应错误的情况。Therefore, the electronic device can determine whether the descending order of multiple special forward-order suffixes changes during the process of constructing the reverse-order linked list by judging whether the first mobile fingerprint is equal to the reverse-order linked list fingerprint. If the first mobile fingerprint is equal to the fingerprint of the reverse linked list, the electronic device can judge that the descending order of the multiple special positive sequence suffixes has not changed during the process of constructing the reverse linked list, that is, the electronic device can judge that the reverse linked list is correct. All reverse suffixes are not missing, and the suffix positions of each reverse suffix are correct. If the first mobile fingerprint is not equal to the fingerprint of the reverse linked list, the electronic device can judge that the descending order of multiple special positive sequence suffixes has changed during the process of constructing the reverse linked list, that is, the electronic device can judge that there may be The case where the legacy reverse suffix or the suffix position of the reverse suffix corresponds to an error has been fixed.
电子设备可以通过判断第一链接指纹是否等于正序链表指纹,确定在构造正序链表的过程中多个特殊正序后缀的升序次序是否发生变化。若第一链接指纹等于正序链表指纹,则电子设备可以判断在构造正序链表的过程中多个特殊正序后缀的升序次序没有发生变化,即电子设备可以判断正序链表是正确的,正序链表中的各个正序后缀没有遗漏,且各个正序后缀的后缀位置正确。若第一链接指纹不等于正序链表指纹,则电子设备可以判断在构造正序链表的过程中多个特殊正序后缀的升序次序发生了变化,即电子设备可以判断在构造正序链表的过程中可能出现了遗留正序后缀或正序后缀的后缀位置对应错误的情况。The electronic device can determine whether the ascending order of multiple special forward-sequence suffixes changes during the process of constructing the forward-sequence linked list by judging whether the first link fingerprint is equal to the forward-sequence linked list fingerprint. If the first link fingerprint is equal to the fingerprint of the positive-sequence linked list, the electronic device can judge that the ascending order of multiple special positive-sequence suffixes has not changed during the process of constructing the positive-sequence linked list, that is, the electronic device can judge that the positive-sequence linked list is correct. Each positive sequence suffix in the sequence linked list is not missing, and the suffix position of each positive sequence suffix is correct. If the first link fingerprint is not equal to the fingerprint of the positive sequence linked list, then the electronic device can judge that the ascending order of multiple special positive sequence suffixes has changed during the process of constructing the positive sequence linked list, that is, the electronic device can judge that in the process of constructing the positive sequence linked list There may be cases where the legacy positive sequence suffix or the suffix position of the positive sequence suffix corresponds incorrectly.
在本申请实施例中,针对任意长度的原始字符串X,电子设备首先使用归纳排序方法对特殊正序后缀进行原地排序,并将排序好的多个特殊正序后缀保存临时位置中。在保存期间电子设备可以使用指纹函数FP迭代计算降序特殊正序后缀的第一移动指纹。然后电子设备可以将特殊正序后缀升序链接至对应的特殊正序后缀对应的后缀位置中。在链接期间电子设备可以使用指纹函数FP迭代计算升序特殊正序后缀的第一链接指纹。接下来,在归纳排序逆序后缀和正序后缀链表的过程中,电子设备可以使用指纹函数FP迭代计算逆序链表指纹和正序链表指纹。最后电子设备可以通过判断第一移动指纹是否等于逆序链表指纹,以及判断第一链接指纹是否等于正序链表指纹,来验证整个后缀链表的正确性。如果第一移动指纹等于逆序链表指纹且第一链接指纹等于正序链表指纹,则电子设备可以判断后缀链表保存着正确的后缀顺序。若第一移动指纹不等于逆序链表指纹和/或第一链接指纹不等于正序链表指纹,否则电子设备可以判断后缀链表保存的后缀顺序不正确。其中的原理是,特殊正序后缀的顺序决定着逆序后缀的顺序,逆序后缀顺序决定着正序后缀的顺序。又因为特殊正序后缀是正序后缀的一种特殊情况。因此如果排序和链接结果正确,则在对L类型后缀排序之前的多个特殊正序后缀与S类型后缀排序之后的多个特殊正序后缀有相同的指纹,即特殊正序后缀序列保存着相同的后缀顺序信息。In the embodiment of the present application, for the original character string X of any length, the electronic device first uses the inductive sorting method to sort the special positive sequence suffixes in situ, and saves the sorted multiple special positive sequence suffixes in a temporary location. During saving, the electronic device may use the fingerprint function FP to iteratively calculate the first mobile fingerprint of the special positive sequence suffix in descending order. Then the electronic device can link the special positive sequence suffixes to the suffix positions corresponding to the corresponding special positive sequence suffixes in ascending order. During linking, the electronic device can use the fingerprint function FP to iteratively calculate the first link fingerprint of the ascending special positive sequence suffix. Next, in the process of inductively sorting the reverse-order suffix and forward-order suffix linked lists, the electronic device can use the fingerprint function FP to iteratively calculate the fingerprints of the reverse-order linked list and the forward-order linked list. Finally, the electronic device can verify the correctness of the entire suffix linked list by judging whether the first mobile fingerprint is equal to the fingerprint of the reverse-sequence linked list, and whether the first link fingerprint is equal to the fingerprint of the forward-sequence linked list. If the first mobile fingerprint is equal to the fingerprint of the reverse-sequence linked list and the first link fingerprint is equal to the fingerprint of the forward-sequence linked list, the electronic device can determine that the suffix linked list stores the correct suffix order. If the first mobile fingerprint is not equal to the fingerprint of the reverse-sequence linked list and/or the first link fingerprint is not equal to the fingerprint of the forward-sequence linked list, otherwise the electronic device may determine that the sequence of suffixes stored in the suffix linked list is incorrect. The principle is that the order of special forward suffixes determines the order of reverse suffixes, and the order of reverse suffixes determines the order of forward suffixes. And because the special positive sequence suffix is a special case of the positive sequence suffix. Therefore, if the sorting and linking results are correct, multiple special positive-order suffixes before sorting L-type suffixes have the same fingerprint as multiple special positive-order suffixes after sorting S-type suffixes, that is, the special positive-order suffixes retain the same suffix sequence information.
本申请实施例提出的后缀链表构造方法中,由于对构造出的后缀链表进行正确性验证的过程,仅需对比第一指纹值和第二指纹值,无需对构造出的后缀链表进行其他任何操作,也无需对原始字符串进行操作。因此,通过本申请实施例提供的后缀链表构造方法构造后缀链表,在对构造出的后缀链表进行正确性验证时,验证链表正确性的空间开销可以忽略不计,时间开销相对于构造链表的时间开销也非常小。此外,本申请实施例提供的集成正确性验证的后缀链表构造方法,避免了通过直接比较后缀字典序来验证后缀链表的正确性,实现了后缀链表构造过程中,同时验证链表的正确性。在实际应用情形中,采用本申请实施例提出的方法,不仅可以实现后缀链表的构造,而且可以验证构造结果的正确性,且验证方法的时间和空间开销非常小。In the construction method of the suffix linked list proposed in the embodiment of the present application, due to the process of verifying the correctness of the constructed suffix linked list, only the first fingerprint value and the second fingerprint value need to be compared, and no other operations are required on the constructed suffix linked list , and no need to operate on raw strings. Therefore, the suffix linked list construction method provided by the embodiment of the present application is used to construct the suffix linked list. When verifying the correctness of the constructed suffix linked list, the space overhead for verifying the correctness of the linked list is negligible, and the time overhead is relative to the time overhead of constructing the linked list. Also very small. In addition, the construction method of the suffix linked list integrated with correctness verification provided by the embodiment of the present application avoids verifying the correctness of the suffix linked list by directly comparing the suffix dictionary order, and realizes the verification of the correctness of the linked list during the construction of the suffix linked list. In practical application situations, using the method proposed in the embodiment of this application, not only can the construction of the suffix linked list be realized, but also the correctness of the construction result can be verified, and the time and space overhead of the verification method is very small.
需要说明的是,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be noted that the sequence numbers of the steps in the above embodiments do not mean the order of execution, the execution order of each process should be determined by its functions and internal logic, and should not constitute any limited.
参照图6,示出了本申请实施例提供的一种自带验证功能的链表生成装置的示意图,具体可以包括特殊正序后缀确定模块601、第一顺序确定模块602、第一链表生成模块603、第二链表生成模块604和后缀链表生成模块605,其中:Referring to FIG. 6 , it shows a schematic diagram of a linked list generation device with its own verification function provided by the embodiment of the present application, which may specifically include a special positive sequence
特殊正序后缀确定模块601,用于根据字符类型数组生成关于原始字符串的多个特殊正序后缀;所述字符类型数组是根据所述原始字符串中各个字符对应的字符类型生成的;所述特殊正序后缀为后缀首字符的字符类型为特殊正序类型的后缀;所述各个字符的字符类型由所述各个字符与其相邻字符之间的字符大小确定;The special positive sequence
第一顺序确定模块602,用于对多个所述特殊正序后缀进行归纳排序,确定所述多个特殊正序后缀的第一顺序;The first order determination module 602 is configured to perform inductive sorting on the plurality of special positive sequence suffixes, and determine the first order of the plurality of special positive sequence suffixes;
第一链表生成模块603,用于根据各个所述特殊正序后缀在所述第一顺序中的次序以及所述后缀首字符在所述原始字符串内的字符位置,生成用于指纹验证的第一链表;The first linked list generation module 603 is used to generate the first sequence for fingerprint verification according to the order of each of the special positive sequence suffixes in the first sequence and the character position of the first character of the suffix in the original string. a linked list;
第二链表生成模块604,用于根据所述第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定所述多个第二后缀的第二顺序;根据各个所述第二后缀在所述第二顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置,生成用于指纹验证的第二链表;The second linked list generation module 604 is configured to perform inductive sorting on a plurality of second suffixes related to the second character type according to the first linked list, and determine the second order of the plurality of second suffixes; according to each of the second suffixes The order of the suffix in the second order and the character position of the first character of the suffix in the original character string generate a second linked list for fingerprint verification;
后缀链表生成模块605,用于根据各个所述第二字符类型的所述第二链表,生成所述原始字符串对应的后缀链表。A suffix linked list generating module 605, configured to generate a suffix linked list corresponding to the original character string according to the second linked list of each of the second character types.
其中,第一链表生成模块603,还可以用于根据多个所述特殊正序后缀生成第一指纹;所述第一指纹用于描述生成所述第一链表时多个所述特殊正序后缀的第一顺序;Wherein, the first linked list generating module 603 can also be used to generate a first fingerprint according to a plurality of said special positive sequence suffixes; said first fingerprint is used to describe a plurality of said special positive sequence suffixes when generating said first linked list the first order of
第二链表生成模块604,还可以用于根据多个所述特殊正序后缀生成第二指纹;所述第二指纹用于描述生成所述第二链表时多个所述特殊正序后缀的第一顺序;The second linked list generation module 604 can also be used to generate a second fingerprint according to a plurality of said special positive sequence suffixes; said second fingerprint is used to describe the first of multiple said special positive sequence suffixes when generating said second linked list a sequence;
后缀链表生成模块605,还可以用于根据所述第一指纹和所述第二指纹对所述后缀链表进行验证。The suffix linked list generating module 605 may also be configured to verify the suffix linked list according to the first fingerprint and the second fingerprint.
第二链表生成模块604,还可以用于根据所述第一链表确定多个所述逆序后缀的所述逆序后缀顺序;根据各个所述逆序后缀在所述逆序后缀顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置生成逆序链表和所述逆序链表指纹;所述逆序链表指纹用于对所述逆序链表进行验证;根据所述逆序链表确定多个所述正序后缀的正序后缀顺序;根据各个所述正序后缀在所述正序后缀顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置生成正序链表和所述正序链表指纹;所述正序链表指纹用于对所述正序链表进行验证。The second linked list generating module 604 can also be used to determine the reverse suffix sequence of multiple reverse suffixes according to the first linked list; according to the order of each reverse suffix in the reverse suffix sequence and the suffix The character position of the first character in the original character string generates a reversed linked list and the fingerprint of the reversed linked list; the fingerprint of the reversed linked list is used to verify the reversed linked list; according to the reversed linked list, determine a plurality of positive The positive sequence suffix sequence of the sequential suffix; according to the order of each positive sequence suffix in the positive sequence suffix sequence and the character position of the first character of the suffix in the original character string, the positive sequence linked list and the A positive sequence linked list fingerprint; the positive sequence linked list fingerprint is used to verify the positive sequence linked list.
第一链表生成模块603,还可以用于根据所述字符类型数组,确定各个所述特殊正序后缀的后缀首字符在所述原始字符串内的字符位置;根据所述特殊正序后缀在所述第一顺序中的降序次序,依次将所述多个特殊正序后缀写入各个所述特殊正序后缀相应的临时位置中,生成临时链表;所述临时位置为各个所述后缀首字符在所述原始字符串中对应字符位置的相邻位置;根据指纹函数对多个所述特殊正序后缀的临时位置进行计算,生成第一移动指纹;根据所述特殊正序后缀在所述第一顺序中的升序次序,依次将所述多个特殊正序后缀写入各个所述特殊正序后缀相应的字符位置中,生成第一链表;根据指纹函数对多个所述特殊正序后缀的字符位置进行计算,生成第一链接指纹。The first linked list generation module 603 can also be used to determine the character position of the first character of the suffix of each of the special positive sequence suffixes in the original character string according to the character type array; In the descending order in the above-mentioned first order, write the plurality of special positive sequence suffixes in the temporary positions corresponding to each of the special positive sequence suffixes in turn to generate a temporary linked list; the temporary positions are the initial characters of each of the suffixes The adjacent position of the corresponding character position in the original character string; according to the fingerprint function, the temporary positions of a plurality of the special positive sequence suffixes are calculated to generate the first mobile fingerprint; according to the special positive sequence suffix in the first Ascending order in the order, sequentially write the plurality of special positive sequence suffixes into the corresponding character positions of each of the special positive sequence suffixes to generate a first linked list; The position is calculated to generate the first link fingerprint.
后缀链表生成模块605,还可以用于根据所述第一移动指纹、所述第一链接指纹、所述逆序链表指纹和所述正序链表指纹对所述后缀链表进行验证;若所述第一移动指纹等于所述逆序链表指纹且所述第一链接指纹等于所述正序链表指纹,则所述后缀链表验证通过。The suffix linked list generating module 605 can also be used to verify the suffix linked list according to the first mobile fingerprint, the first link fingerprint, the reverse sequence linked list fingerprint and the forward sequence linked list fingerprint; if the first If the moving fingerprint is equal to the fingerprint of the reverse-sequence linked list and the fingerprint of the first link is equal to the fingerprint of the forward-sequence linked list, then the verification of the suffix linked list passes.
第二链表生成模块604,还可以用于根据后缀首字符生成关于所述第一链表的多个特殊正序桶链表和多个逆序桶链表;所述逆序桶链表中包括多个所述逆序后缀;所述特殊正序桶链表中包括多个所述特殊正序后缀;根据多个所述特殊正序桶链表和多个所述逆序桶链表确定多个所述逆序后缀在所述逆序后缀顺序中的次序,并通过所述指纹函数生成关于多个所述特殊正序后缀的逆序链表指纹。The second linked list generation module 604 can also be used to generate a plurality of special forward-order bucket linked lists and a plurality of reverse-order bucket linked lists about the first linked list according to the first character of the suffix; the reverse-order bucket linked list includes a plurality of the reverse-order suffixes ; The special forward-sequence bucket list includes a plurality of the special forward-sequence suffixes; according to the plurality of the special forward-sequence bucket list and the plurality of reverse-sequence bucket lists, determine the order of the reverse-sequence suffixes in the reverse-sequence suffix , and generate reverse-order linked list fingerprints about multiple special positive-order suffixes through the fingerprint function.
第二链表生成模块604,还可以用于根据后缀首字符生成关于所述逆序链表的多个逆序桶链表和多个正序链表桶;所述逆序桶链表中包括多个所述逆序后缀;所述正序桶链表中包括多个所述正序后缀;根据所述多个正序桶链表和多个所述逆序桶链表确定多个所述正序后缀在所述正序后缀顺序中的次序,并通过所述指纹函数生成关于多个所述特殊正序后缀的正序链表指纹。The second linked list generation module 604 can also be used to generate multiple reversed bucket linked lists and multiple forward linked list buckets of the reversed linked list according to the first character of the suffix; the reversed bucket linked list includes multiple reversed suffixes; The positive sequence bucket linked list includes a plurality of the positive sequence suffixes; according to the multiple positive sequence bucket linked lists and the multiple reverse sequence bucket linked lists, the order of the multiple positive sequence suffixes in the positive sequence suffix sequence is determined , and generate positive sequence linked list fingerprints about a plurality of special positive sequence suffixes through the fingerprint function.
对于装置实施例而言,由于其与方法实施例基本相似,所以描述得比较简单,相关之处参见方法实施例部分的说明即可。As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related details, please refer to the description of the method embodiment.
参照图7,示出了本申请实施例提供的一种终端设备的示意图。如图7所示,本申请实施例中的终端设备700包括:处理器710、存储器720以及存储在所述存储器720中并可在所述处理器710上运行的计算机程序721。所述处理器710执行所述计算机程序721时实现上述自带验证功能的链表生成方法各个实施例中的步骤,例如图4所示的步骤S401至S405。或者,所述处理器710执行所述计算机程序721时实现上述各装置实施例中各模块/单元的功能,例如图6所示模块601至605的功能。Referring to FIG. 7 , it shows a schematic diagram of a terminal device provided by an embodiment of the present application. As shown in FIG. 7 , a
示例性的,所述计算机程序721可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器720中,并由所述处理器710执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段可以用于描述所述计算机程序721在所述终端设备700中的执行过程。例如,所述计算机程序721可以被分割成特殊正序后缀确定模块、第一顺序确定模块、第一链表生成模块、第二链表生成模块和后缀链表生成模块,各模块具体功能如下:Exemplarily, the
特殊正序后缀确定模块,用于根据字符类型数组生成关于原始字符串的多个特殊正序后缀;所述字符类型数组是根据所述原始字符串中各个字符对应的字符类型生成的;所述第一后缀为后缀首字符的字符类型为特殊正序类型的后缀;所述各个字符的字符类型由所述各个字符与其相邻字符之间的字符大小确定;The special positive sequence suffix determination module is used to generate a plurality of special positive sequence suffixes about the original character string according to the character type array; the character type array is generated according to the character type corresponding to each character in the original character string; the The first suffix is that the character type of the first character of the suffix is a suffix of a special positive sequence type; the character type of each character is determined by the character size between each character and its adjacent characters;
第一顺序确定模块,用于对多个所述特殊正序后缀进行归纳排序,确定所述多个特殊正序后缀的第一顺序;A first order determination module, configured to inductively sort the plurality of special positive sequence suffixes, and determine the first order of the plurality of special positive sequence suffixes;
第一链表生成模块,用于根据各个所述特殊正序后缀在所述第一顺序中的次序以及所述后缀首字符在所述原始字符串内的字符位置,生成用于指纹验证的第一链表;The first linked list generation module is used to generate the first list for fingerprint verification according to the order of each of the special positive sequence suffixes in the first order and the character position of the first character of the suffix in the original string. linked list;
第二链表生成模块,用于根据所述第一链表对多个关于第二字符类型的第二后缀进行归纳排序,确定所述多个第二后缀的第二顺序;根据各个所述第二后缀在所述第二顺序中的次序以及所述后缀首字符在所述原始字符串内的所述字符位置,生成用于指纹验证的第二链表;The second linked list generation module is used to inductively sort a plurality of second suffixes related to the second character type according to the first linked list, and determine the second order of the plurality of second suffixes; according to each of the second suffixes In the order in the second order and the character position of the first character of the suffix in the original character string, generate a second linked list for fingerprint verification;
后缀链表生成模块,用于根据各个所述第二字符类型的所述第二链表,生成所述原始字符串对应的后缀链表。A suffix linked list generating module, configured to generate a suffix linked list corresponding to the original character string according to the second linked list of each of the second character types.
所述终端设备700可以是前述各个实施例中的电子设备,该电子设备可以是桌上型计算机、云端服务器等计算设备。所述终端设备700可包括,但不仅限于,处理器710、存储器720。本领域技术人员可以理解,图7仅仅是终端设备700的一种示例,并不构成对终端设备700的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备700还可以包括输入输出设备、网络接入设备、总线等。The
所述处理器710可以是中央处理单元(CentralProcessing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-ProgrammableGate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The
所述存储器720可以是所述终端设备700的内部存储单元,例如终端设备700的硬盘或内存。所述存储器720也可以是所述终端设备700的外部存储设备,例如所述终端设备700上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(SecureDigital,SD)卡,闪存卡(Flash Card)等等。进一步地,所述存储器720还可以既包括所述终端设备700的内部存储单元也包括外部存储设备。所述存储器720用于存储所述计算机程序721以及所述终端设备700所需的其他程序和数据。所述存储器720还可以用于暂时地存储已经输出或者将要输出的数据。The
本申请实施例还公开了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如前述各个实施例所述的自带验证功能的链表生成方法。The embodiment of the present application also discloses a terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, the aforementioned The method for generating a linked list with a verification function described in each embodiment.
本申请实施例还公开了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如前述各个实施例所述的自带验证功能的链表生成方法。The embodiment of the present application also discloses a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it realizes the self-contained verification function as described in the foregoing embodiments Linked list generation method.
本申请实施例还公开了一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行前述各个实施例所述的自带验证功能的链表生成方法。The embodiment of the present application also discloses a computer program product. When the computer program product is run on a computer, the computer is made to execute the method for generating a linked list with a verification function described in the foregoing embodiments.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制。尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solution of the present application, but not to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: they can still modify the technical solutions described in the aforementioned embodiments, or perform equivalent replacements for some of the technical features; and these Any modification or replacement that does not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application shall be included within the protection scope of the present application.
Claims (7)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310277064.5A CN115982310B (en) | 2023-03-21 | 2023-03-21 | Chain table generation method with verification function and electronic equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310277064.5A CN115982310B (en) | 2023-03-21 | 2023-03-21 | Chain table generation method with verification function and electronic equipment |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115982310A CN115982310A (en) | 2023-04-18 |
| CN115982310B true CN115982310B (en) | 2023-05-16 |
Family
ID=85970889
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310277064.5A Active CN115982310B (en) | 2023-03-21 | 2023-03-21 | Chain table generation method with verification function and electronic equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115982310B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117271533B (en) * | 2023-11-22 | 2024-01-16 | 广东海洋大学 | Construction method and device of large data linked list and terminal equipment |
| CN117971826B (en) * | 2024-01-10 | 2024-10-25 | 广东海洋大学 | Construction method and construction device of large data linked list with verification function |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107015952A (en) * | 2017-03-24 | 2017-08-04 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | The correctness verification method and system of a kind of Suffix array clustering and most long common prefix |
| CN107015951A (en) * | 2017-03-24 | 2017-08-04 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | The correctness verification method and system of a kind of Suffix array clustering |
| CN108664459A (en) * | 2018-03-22 | 2018-10-16 | 佛山市顺德区中山大学研究院 | A kind of merging method that Suffix array clustering is adaptive and its device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8255398B2 (en) * | 2008-09-30 | 2012-08-28 | International Business Machines Corporation | Compression of sorted value indexes using common prefixes |
| TWI636372B (en) * | 2018-01-05 | 2018-09-21 | 國立交通大學 | Data processing method and system for gene sequencing data |
-
2023
- 2023-03-21 CN CN202310277064.5A patent/CN115982310B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107015952A (en) * | 2017-03-24 | 2017-08-04 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | The correctness verification method and system of a kind of Suffix array clustering and most long common prefix |
| CN107015951A (en) * | 2017-03-24 | 2017-08-04 | 广东顺德中山大学卡内基梅隆大学国际联合研究院 | The correctness verification method and system of a kind of Suffix array clustering |
| CN108664459A (en) * | 2018-03-22 | 2018-10-16 | 佛山市顺德区中山大学研究院 | A kind of merging method that Suffix array clustering is adaptive and its device |
Non-Patent Citations (2)
| Title |
|---|
| Building and Checking Suffix Array Simultaneously by Induced Sorting Method;Bin Lao 等;IEEE TRANSACTIONS ON COMPUTERS;第71卷(第4期);第756-765页 * |
| Checking Big Suffix and LCP Arrays by Probabilistic Methods;Yi Wu 等;IEEE TRANSACTIONS ON COMPUTERS;第66卷(第10期);第1667-1675页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115982310A (en) | 2023-04-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Adjeroh et al. | The burrows-wheeler transform: data compression, suffix arrays, and pattern matching | |
| US9647684B2 (en) | Memory-based history search | |
| CN109299086B (en) | Optimal sort key compression and index reconstruction | |
| CN115982310B (en) | Chain table generation method with verification function and electronic equipment | |
| RU2629440C2 (en) | Device and method for acceleration of compression and decompression operations | |
| Gawrychowski | Optimal pattern matching in LZW compressed strings | |
| CN114880523B (en) | String processing method, device, electronic device and storage medium | |
| US10078646B2 (en) | Hardware efficient fingerprinting | |
| CN107038026A (en) | The automatic machine update method and system of a kind of increment type | |
| US12229107B2 (en) | Compact probabilistic data structure for storing streamed log lines | |
| CN110472385A (en) | A kind of password cracking method and device | |
| CN117971826B (en) | Construction method and construction device of large data linked list with verification function | |
| CN117271533B (en) | Construction method and device of large data linked list and terminal equipment | |
| CN119420366A (en) | A method, device and terminal device for constructing large-scale data BWT | |
| CN112530522A (en) | Sequence error correction method, device, equipment and storage medium | |
| CN115982311B (en) | Method and device for generating linked list, terminal equipment and storage medium | |
| CN103793522A (en) | Method and system for rapidly scanning feature codes | |
| CN114492369A (en) | Text comparison method and device, electronic equipment and computer readable storage medium | |
| WO2023092723A1 (en) | Data error correction method and apparatus, and electronic device | |
| US12549333B1 (en) | Error-aware hashing engine | |
| US12493651B2 (en) | Compact probabilistic data structure for storing streamed log lines | |
| EP3051699B1 (en) | Hardware efficient rabin fingerprints | |
| CN115827920B (en) | Data processing method and device based on Merck tree | |
| US20240370423A1 (en) | Compact Probabilistic Data Structure For Storing Log Data | |
| CN112765938B (en) | Method for constructing suffix array, terminal equipment and computer readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250609 Address after: 230000 no.451 Huangshan Road, Shushan District, Hefei City, Anhui Province Patentee after: Anhui zhiconvex Technology Service Co.,Ltd. Country or region after: China Address before: 524000 Guangdong city of Zhanjiang province sea Mazhang District Road No. 1 Patentee before: Guangdong Ocean University Country or region before: China |
|
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250730 Address after: 310000 Zhejiang Province Hangzhou City Shangcheng District Tushan Yilong 2nd Lane 2nd Building 8503 Room Patentee after: Hangzhou Fazheng Chain Security Technology Co.,Ltd. Country or region after: China Address before: 230000 no.451 Huangshan Road, Shushan District, Hefei City, Anhui Province Patentee before: Anhui zhiconvex Technology Service Co.,Ltd. Country or region before: China |
