WO2022016327A1 - 一种安全的后缀索引外包计算方法及装置 - Google Patents
一种安全的后缀索引外包计算方法及装置 Download PDFInfo
- Publication number
- WO2022016327A1 WO2022016327A1 PCT/CN2020/103065 CN2020103065W WO2022016327A1 WO 2022016327 A1 WO2022016327 A1 WO 2022016327A1 CN 2020103065 W CN2020103065 W CN 2020103065W WO 2022016327 A1 WO2022016327 A1 WO 2022016327A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- array
- string
- suffix
- initial
- block
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
Definitions
- the present application belongs to the technical field of data processing, and in particular relates to a secure suffix index outsourcing calculation method and device.
- suffix array (or suffix index) is an important and widely used data structure, which can be used in data compression, genome alignment, full-text retrieval and other fields.
- suffix index is an array that can be used for full-text indexing.
- a feasible method for outsourcing the construction of the suffix array of strings is to transmit the strings that need to construct the suffix array to the cloud server, and then construct the suffix array of the strings in the cloud server.
- the security mechanism of the current cloud server does not It is completely reliable, and it is easy to cause data leakage. Therefore, the security of the original string cannot be guaranteed by directly transmitting the original string to the cloud server, resulting in poor security of the original string when constructing the suffix array.
- the embodiments of the present application provide a secure suffix index outsourcing calculation method and device, which can solve the problem of poor security of character strings when constructing suffix arrays of character strings by outsourcing.
- an embodiment of the present application provides a secure suffix index outsourcing calculation method, including:
- the expansion factor is used to represent the expansion digits of the initial character in the initial character string, and the expansion factor is a natural number greater than 1;
- an embodiment of the present application provides a secure suffix index outsourcing computing device, including:
- a data acquisition module used for acquiring the initial character string and expansion factor of the suffix array to be constructed, wherein the expansion factor is used to represent the expansion digits of the initial character in the initial character string, and the expansion factor is a natural number greater than 1;
- a data expansion module for expanding the initial character string based on the expansion factor to obtain an expanded array of the initial character string
- a string generation module for determining the target string of the initial string based on the expanded array, and uploading the target string to the cloud server;
- a suffix array generation module configured to obtain a first suffix array of the target string generated by the cloud server, and generate a second suffix array of the initial string based on the first suffix array.
- an embodiment of the present application provides a terminal device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes
- the computer program implements the secure suffix index outsourcing calculation method described in any one of the first aspects above.
- an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, wherein, when the computer program is executed by a processor, any one of the above-mentioned first aspect is implemented.
- a described secure suffix index outsourcing calculation method
- an embodiment of the present application provides a computer program product that, when the computer program product runs on a terminal device, enables the terminal device to execute the secure suffix index outsourcing calculation method described in any one of the first aspects above.
- the embodiments of the present application have the following beneficial effects: the present application expands the initial character string according to the expansion factor to obtain an expanded array, obtains the target character string of the initial character string based on the expanded data, and finally obtains the target character generated by the cloud server
- the first suffix array of the string, and the second suffix array of the initial string is obtained based on the first suffix array;
- the present application converts the initial string into a target string, and calculates the suffix array of the initial string through the target string, and does not directly use
- the suffix array is calculated from the initial string, which ensures the security of the initial string.
- the second suffix array obtained in this application is the same as the suffix array generated by directly using the initial string. Therefore, this application can ensure that the calculated suffix array is the initial string.
- the suffix array can also ensure that the initial string will not be leaked when calculating the suffix array, ensuring the security of the initial string.
- FIG. 1 is a schematic diagram of an application scenario of a secure suffix index outsourcing calculation method provided by an embodiment of the present application
- FIG. 2 is a schematic flowchart of a secure suffix index outsourcing calculation method provided by an embodiment of the present application
- FIG. 3 is a schematic flowchart of a method for determining an expanded character string provided by an embodiment of the present application
- FIG. 4 is a schematic flowchart of a method for determining a target character string provided by an embodiment of the present application
- FIG. 5 is a schematic flowchart of a specific implementation process of a method for determining a second array provided by an embodiment of the present application
- FIG. 6 is a schematic structural diagram of a secure suffix index outsourcing computing device provided by an embodiment of the present application.
- FIG. 7 is a schematic structural diagram of a terminal device provided by an embodiment of the present application.
- FIG. 8 is a block diagram of a partial structure of a computer provided by an embodiment of the present application.
- suffix array of strings there are many ways to calculate the suffix array of strings, but when the data scale is large, it is still difficult for ordinary computers to provide the computing power required to construct the suffix array.
- For a string S of length n use the current overall performance
- the best inductive sorting method to construct its suffix array requires O(n) time overhead and O(n log n) bit space overhead; when n is large, suffix sorting requires high computer configuration, and using the Internet
- the cloud server in the data center can obtain higher computing performance at a lower cost, and the cost performance is better.
- the cloud server is used to calculate the suffix array of the string, and the original string is directly uploaded to the cloud server without confidentiality.
- the security mechanism of the current cloud server is not completely reliable, which is easy to cause data leakage. Therefore, the original character string is directly uploaded to the cloud server.
- the method of uploading the string to the cloud server to calculate the suffix array is not very secure.
- the accurate original string suffix array can be obtained, and the The original string is guaranteed to be safe.
- FIG. 1 is a schematic diagram of an application scenario of a secure suffix index outsourcing calculation method provided by an embodiment of the present application.
- the above-mentioned secure suffix index outsourcing calculation method can be used to calculate a suffix array of a character string.
- the storage device 10 is used to store the initial character string and the expansion factor
- the terminal device 20 is used to obtain the initial character string and the expansion factor from the storage device 10, and generate the target character string of the initial character string based on the expansion factor and the initial character string
- Fig. 2 shows the schematic flow chart of the secure suffix index outsourcing calculation method provided by the present application, with reference to Fig. 2, the method is described in detail as follows:
- S101 Acquire an initial character string and an expansion factor of a suffix array to be constructed, wherein the expansion factor is used to represent the expansion digits of the initial character in the initial character string, and the expansion factor is a natural number greater than 1.
- the initial character string refers to the most primitive character string, that is, the character string of the suffix array to be constructed.
- the expansion factor refers to the number of digits to which a character in the initial string needs to be expanded, and can be set as required. For example, if the expansion factor is 3, it means that a character needs to be expanded to 3 digits, that is, 3 characters.
- the method for obtaining the initial string and the expansion factor may be sent from the storage device, or may be the initial string and the expansion factor input by the user.
- the expanded character string can be obtained based on the expansion factor, and the expanded character string can be formed into an expanded array.
- step S102 may include:
- each initial character needs to be expanded, and the expansion is based on the initial character string.
- the initial characters make up the extended string.
- the position of the extended string in the extended array in the extended array is the same as the position of the corresponding initial character in the initial string. For example, if the position of the initial character in the initial string is the third character, then the position of the third initial character The position of the extended string in the extended array is the 3rd string.
- the extended string of the first initial character b is ba
- the extended string of the second initial character a is an
- the extended string of the third initial character n is na
- the extended string of the third initial character n is na.
- the extended character of the 4 initial characters a is a, so the extended array composed of the extended string is [ba, an, na, a].
- step S1021 may include:
- S10211 Select the i-th initial character in the initial character string, where i ⁇ 1.
- the subscript of the initial character string is numbered from 0.
- the initial character string is banana$
- the subscript corresponding to the first character b is 0,
- the second character is the subscript corresponding to a It is marked as 1, and the 7th character is $ and the corresponding subscript is 6.
- the initial character that needs to be expanded since the initial character needs to be expanded, and the character added during the expansion is the character in the initial string that is connected to the initial character that needs to be expanded and is after the initial character, the initial character that needs to be expanded needs to be in the initial character string. The position in determines the expanded string.
- the initial string is banana$
- the expansion factor is 3.
- the extended string of 2 initial characters, that is, the extended string of the second initial character is ana.
- the number of initial characters after the i-th initial character is less than k-1, it is only necessary to use the i-th initial character to the n-th initial character as the extension characters of the i-th initial character String can be.
- the initial string is banana$ and the expansion factor is 3.
- the 7th initial character to the 7th initial character are used as the expansion string of the 7th initial character, that is, the 7th initial character
- the expanded string of initial characters is $.
- the target string is a constructed string that needs to be uploaded to the cloud server to calculate the suffix array instead of the initial string. Since the cloud server cannot directly restore the initial string from the transformed target string, the initial character string is guaranteed. String security.
- the cloud server generates the first suffix array of the target character string based on the inductive sorting method.
- S104 Acquire a first suffix array of the target character string generated by the cloud server, and generate a second suffix array of the initial character string based on the first suffix array.
- the cloud server After the cloud server generates the first suffix array of the target string, it transmits the first suffix array back to the terminal device, and the terminal device generates the second suffix array of the initial character string according to the first suffix array, and completes the process of identifying the initial character string. Construction of a suffix array of strings.
- the initial string is expanded according to the expansion factor to obtain an expanded array
- the target character string of the initial character string is obtained based on the expanded data
- the first suffix array of the target character string generated by the cloud server is obtained, based on the first suffix array
- the second suffix array of the initial string is obtained; the application converts the initial string into a target string, calculates the suffix array of the initial string through the target string, and does not directly use the initial string to calculate the suffix array, thereby ensuring that the initial string is
- the security of the second suffix array obtained in this application is the same as the suffix array generated by directly using the initial string, so this application can not only ensure that the calculated suffix array is the suffix array of the initial string, but also ensure that when calculating the suffix array The initial string will not be leaked, ensuring the security of the initial string.
- step S103 may include:
- the number of blocks represents the number of blocks into which the initial character in the initial character string is divided.
- the number of blocks may be input by the user, stored in the terminal device in advance, or obtained from an external device. obtained.
- the number of chunks can be set as desired, for example, set to 3, 4, or 5.
- the number of characters in each string block may be the same or different, that is, the initial characters may be equally distributed to each string block, or may not be equally distributed.
- the extended character strings corresponding to each character in the character string block are formed into an array block to obtain each array block of the extended data.
- the string block is obtained by dividing the initial string into blocks, so each character in the string block corresponds to an extended string, and the extended strings corresponding to the characters in the string block are placed in a In the array block, the block of the expanded array is completed.
- the string blocks obtained from the initial strings are [ba][nan][ana][na$]
- the expanded array of the initial strings is:
- the target string can be obtained through the string block and the array block.
- step S1033 may include:
- the last character exists in each string block, and the last character corresponds to a first subscript in the initial string, and the first subscript corresponding to the last character in all the string blocks mark to form the first array.
- the order of the first subscript in the first array is the same as the order in which the last character present in the string block is arranged in the initial string.
- the block end suffix of the character string block consists of the last character in the character string block to the last initial character of the initial character string.
- the number of the first suffix of the initial string is the same as the number of initial characters in the initial string. There are several initial characters, and there are several first suffixes of the initial string. For example, there are 11 initial characters in the initial string. characters, the initial string has 11 first suffixes.
- the last initial character of the initial string is a first suffix
- the gth initial character to the last initial character in the initial string form a first suffix, 1 ⁇ g ⁇ n, and n is the initial character string
- step S10332 may include:
- S103321 Obtain the block end suffix of the jth string block in the initial string, wherein the block end suffix of the jth string block is from the last character in the jth string block to the The last initial character of the initial string consists of 1 ⁇ j ⁇ m, where m is the number of blocks.
- the second string block has the block suffix nanana$
- the third string block has the block suffix nanana$.
- the end-of-block suffix of the string block is ana$
- the end-of-block suffix of the fourth string block is $.
- S103323 Acquire each first suffix of the initial character string, and sort each of the first suffixes in lexicographic order, where the last initial character of the initial character string is a first suffix, and the first suffix in the initial character string
- the g initial characters to the last initial character form a first suffix, where 1 ⁇ g ⁇ n, where n is the total number of initial characters in the initial character string.
- the first suffix of the initial string is $, a$, na$, ana$, nana$, anana$, nanana$, anananana$, nananana$, anananana$,bananaanana$;
- S103324 Number the sorted first suffixes to obtain the first numbers of the first suffixes.
- each sorted first suffix is numbered from 0, and each first suffix corresponds to a first number.
- the first suffix after sorting is $, a$, ana$, anana$, ananana$, anananana$, banananana$, na$, nana$, nanana$, nananana$, nananana$, then the first number of $ is 0 , the first number of a$ is 1, and so on, and the first number of nananana$ is 10.
- S103325 Use the number corresponding to the block end suffix of each character string block as the second array, where the number corresponding to the block end suffix is the first number of the first suffix that is the same as the block end suffix.
- each block end suffix can be found to be the same as the first suffix, and the first number of the same first suffix is taken as the number corresponding to the block end suffix, and the number corresponding to the block end suffix is used. form the second array.
- the array elements in the second array are in the same order as the array blocks corresponding to the end-of-block suffixes.
- the second string block has the block suffix nanana$
- the third string block has the block suffix nanana$.
- the end suffix of the string block is ana$
- the end suffix of the fourth string block is $;
- the first suffix after sorting is $, a$, ana$, anana$, ananana$, anananana$, banananana$, na$, nana$, nanana$, nananana$, nananana$, then the first number of $ is 0, a$
- the first number of 1 is 1, and so on, and the first number of nananana$ is 10;
- the number of the suffix anananana$ at the end of the block is 5
- the number of the suffix nanana$ at the end of the block is 9
- the code of the suffix ana$ at the end of the block is 2
- S10333 Obtain a third array based on the array block, the expanded array, the first array, and the second array.
- step S10333 may include:
- the first position refers to the position in the third array where the elements in the first array are stored. According to the corresponding relationship, the elements in the first array can be put into the third array to obtain the element in the third array. Part of the array element.
- the first array E[4] ⁇ 1,4,7,10 ⁇
- S103332 sort the target expansion strings according to lexicographical order, and use the subscripts corresponding to the sorted target expansion strings in the expansion array as the sixth array, wherein the target expansion strings refer to those not in the expansion array.
- each array block has a block end character string, so the expanded array includes both the block end character string and the non-block end character string.
- the subscript of the string at the end of the block in the extended array has been put into the third array through step S103331, so currently, it is only necessary to put the subscript of the string at the end of the block in the extended array into the third array.
- the augmented array is:
- the second suffix of the character string at the end of the block can be based on the and the size order of the third suffix of the non-end of block string puts the subscript of the non-end of block string into the third array.
- the third suffix of the non-block end character string is the first suffix of the initial character corresponding to the non-block end character string.
- the second suffix of the end-of-block character string is the end-of-block suffix of the character string block where the initial character corresponding to the end-of-block character string is located.
- the first array E[4] ⁇ 1,4,7,10 ⁇
- the expanded array is:
- the buckets in the third array can also be determined, and the subscripts corresponding to the same extended string are formed into a bucket.
- step S10334 may include:
- S103341 Sort the expanded strings in the expanded array according to lexicographical order to obtain a target array composed of the sorted expanded strings.
- the expanded strings are sorted according to the lexicographical order, and the sorted expanded strings can be obtained.
- specific conditions that should be satisfied by the sorting refer to the following specific implementation process.
- step S103341 may include:
- the same extended character string is sorted to obtain the target array.
- sorting the extended strings according to the lexicographical order obtains the result after the initial sorting, that is, if the same extended strings exist, the sequence of the same extended strings cannot be determined after the initial sorting. , so reorder the extended string sequence.
- the same extension string can be randomly arranged. If there are end-of-block strings in the same extension string, the same extension strings can be sorted based on the size of the second suffix of the end-of-block string and the third suffix of the non-end-of-block string.
- the third suffix of the non-block end character string is the first suffix of the initial character corresponding to the non-block end character string.
- the second suffix of the end-of-block character string is the end-of-block suffix of the character string block where the initial character corresponding to the end-of-block character string is located.
- the non-block-end string is placed in front of the block-end string, and vice versa. If two or more non-end-of-block strings are adjacent, they are arranged according to the position before and after the non-end-of-block strings in the expanded array.
- the augmented array is:
- S' [(ban)(ana)][(nan)(ana)(nan)][(ana)(nan)(ana)][(na$)(a$)($)], for extended characters
- (ana)(ana)(ana)(ana) are four identical extended strings, which are the end-of-block strings in the first array block, and the subscript is 1; the end-of-block characters in the third array block String, the subscript is 7; the other two are non-block end strings, the subscripts are 3 and 5 respectively; the second suffix of the block end string in the first array block is anananana$;
- the second suffix of the end-of-block string in the third array block is ana$
- the third suffix of the non-block end string with subscript 3 is ananana$;
- the third suffix of the non-block end string with subscript 5 is anana$
- S103342 Determine the position of the end-of-block character string in each of the character string blocks in the target array, where the end-of-block character string refers to the last character string in the group block.
- the arrangement order of the extended character strings is determined, and naturally the position of each block end character string in the arranged extended character string can be determined.
- the target array is:
- the numbering of the extended strings in the target array may start from 0, and then add 1 in sequence to obtain a fourth array, which is composed of numbers.
- the preset rules that specific numbers should satisfy are as follows.
- step S103343 may include:
- the target array is:
- step S10335 may include:
- the corresponding array element, Y[V[c]] is the array element corresponding to the subscript V[c] in the fifth array, 0 ⁇ c ⁇ n, and n is the total number of initial characters in the initial string.
- the fifth array can be obtained based on the third array and the fourth array.
- S10336 Divide the fifth array into data blocks based on the number of characters in each of the character string blocks.
- the number of characters in the character string block in the initial character string is the same as the number of characters in the data block
- the arrangement order of the data blocks is the same as the arrangement order of the character string blocks.
- the data blocks may be rearranged, and the array after the array is obtained is recorded as the target character string.
- step S10337 may include:
- the seventh array may be generated based on the fifth array, the array elements in the seventh array are composed of subscripts of the data blocks in the fifth array, and the subscripts of the data blocks are randomly arranged to obtain the seventh array array.
- the data blocks are rearranged to obtain the target character string.
- the seventh array can also be a combination of the subscripts of the data blocks in other arrangements, which will not be done here. limit;
- step S104 may include:
- the array elements in the eighth array represent the number of characters in the data block, and the array elements in the eighth array are arranged in the same order as the data blocks in the target string.
- the data blocks are [9,3,8][5, 4][6,1,0][3,7,2]
- step S1042 may include:
- the sum of the first array element to the d-th array element in the eighth array is taken as the d+1-th array element in the ninth array.
- step S1043 may include:
- the second suffix array is obtained, where f is based on the formula H[f ] ⁇ SA X [e] ⁇ H[f+1] is determined, SA S [e] is the array element corresponding to the subscript e in the second suffix array, E[P[f]] is the subscript P in the first array [f] corresponds to the array element, P[f] is the array element corresponding to the subscript f in the seventh array, W[f] is the array element corresponding to the subscript f in the eighth array, SA X [e] is the first The array element corresponding to the subscript e in the suffix array, H[f] is the array element corresponding to the subscript f in the ninth array, and H[f+1] is the array element corresponding to the subscript f+1 in the ninth array.
- FIG. 6 shows a structural block diagram of the secure suffix index outsourcing computing device provided by the embodiment of the present application. Example relevant part.
- the apparatus 200 may include: a data acquisition module 210 , a data expansion module 220 , a character string generation module 230 and a suffix array generation module 240 .
- the data acquisition module 210 is used to acquire the initial character string and expansion factor of the suffix array to be constructed, wherein the expansion factor is used to represent the expansion digits of the initial character in the initial character string, and the expansion factor is greater than 1 Natural number;
- a data expansion module 220 configured to expand the initial character string based on the expansion factor to obtain an expanded array of the initial character string
- a character string generation module 230 configured to determine the target character string of the initial character string based on the expanded array, and upload the target character string to the cloud server;
- the suffix array generation module 240 is configured to obtain a first suffix array of the target string generated by the cloud server, and generate a second suffix array of the initial string based on the first suffix array.
- the data expansion module 220 may specifically include:
- a data expansion unit configured to expand each initial character in the initial character string based on the expansion factor, obtain an expanded character string of each initial character, and form the expanded character string into the expanded array.
- the data expansion unit may specifically include:
- i+k-1 ⁇ n take the i-th initial character to the i+k-1-th initial character in the initial character string as the extended character string of the i-th initial character, where k is expansion factor, n is the total number of initial characters in the initial string, n>1;
- the i-th initial character to the n-th initial character in the initial character string are used as the extended character string of the i-th initial character.
- the string generation module 230 may specifically include:
- a first block unit for dividing the initial string into a preset number of string blocks
- a second block unit configured to divide the expanded array into array blocks based on the characters in the character string block
- a character string generating unit configured to determine a target character string of the initial character string based on the character string block and the array block.
- the second block unit may be specifically used for:
- the extended character strings corresponding to each character in the character string block are formed into an array block to obtain each array block of the extended data.
- the string generating unit may specifically include:
- the first array generation subunit is used to obtain a first array consisting of the first subscript based on the first subscript of the last character in each of the string blocks in the initial string;
- the second array generation subunit is used to obtain a second array consisting of ranking numbers based on the ranking of the block end suffixes of each of the string blocks in the first suffix of the initial string;
- a third array generation subunit configured to obtain a third array based on the array block, the expanded array, the first array and the second array;
- a fourth array generation subunit for determining the fourth array based on the expanded array
- a fifth array generation subunit for determining a fifth array based on the third array and the fourth array
- a data block generation subunit for dividing the fifth array into data blocks based on the number of characters in each of the character string blocks
- the target string generating subunit is used for reordering each of the data blocks to obtain the target string.
- the second array generation subunit can be specifically used for:
- the block end suffix of the jth string block is from the last character in the jth string block to the initial character
- the last initial character of the string consists of 1 ⁇ j ⁇ m, where m is the number of blocks;
- each first suffix of the initial string and sort each of the first suffixes in lexicographical order, wherein the last initial character of the initial string is a first suffix, and the gth suffix in the initial string
- the initial character to the last initial character forms a first suffix, 1 ⁇ g ⁇ n, where n is the total number of initial characters in the initial string;
- the number corresponding to the block end suffix of each character string block is used as the second array, wherein the number corresponding to the block end suffix is the first number of the first suffix that is the same as the block end suffix.
- the third array generates subunits, which can be used to:
- the subscript of the element, 0 ⁇ a ⁇ m, m is the number of blocks
- E[a] is the array element corresponding to the subscript a in the first array
- A[a] is the array corresponding to the subscript a in the second array element
- V[A[a]] is the array element corresponding to the subscript A[a] in the third array;
- Target expansion strings in lexicographical order, and use the corresponding subscripts of the sorted target expansion strings in the expansion array as the sixth array, wherein the target expansion strings refer to the expansion array that is not the end of the block A string of strings, the end-of-block string refers to the last string in the block;
- the fourth array generation subunit can be specifically used for:
- the expanded strings in the target array are numbered to obtain the fourth array.
- the fourth array generation subunit can also be specifically used for:
- the same extended character string exists in the extended character string sequence, and at least one of the same extended character strings is the end-of-block character string, based on the suffix of the initial character string and the initial character corresponding to the character string at the end of the block
- the suffix at the end of the block where the string block is located sort the same extended string to obtain the target array.
- the fourth array generation subunit can also be specifically used for:
- the fifth array generation subunit can be specifically used for:
- the corresponding array element, Y[V[c]] is the character corresponding to the subscript V[c] in the fifth array, 0 ⁇ c ⁇ n, and n is the total number of initial characters in the initial string.
- the target string generation subunit can be specifically used for:
- the method for generating the first suffix array includes:
- the first suffix array of the target string is generated based on the inductive sorting method.
- the suffix array generation module 240 may specifically include:
- an eighth array generation unit for determining an eighth array consisting of the number of characters in each of the data blocks based on the number of characters in each of the data blocks in the target string;
- a ninth array generation unit configured to determine the ninth array based on the eighth array
- the second suffix array generating unit is configured to obtain the second suffix array based on the ninth array and the first suffix array.
- the ninth array generation unit can be specifically used for:
- the sum of the first array element to the d-th array element in the eighth array is taken as the d+1-th array element in the ninth array.
- the second suffix array generation unit can be specifically used for:
- the second suffix array is obtained, where f is based on the formula H[f ] ⁇ SA X [e] ⁇ H[f+1] is determined, SA S [e] is the array element corresponding to the subscript e in the second suffix array, E[P[f]] is the subscript P in the first array [f] corresponds to the array element, P[f] is the array element corresponding to the subscript f in the seventh array, W[f] is the array element corresponding to the subscript f in the eighth array, SA X [e] is the first The array element corresponding to the subscript e in the suffix array, H[f] is the array element corresponding to the subscript f in the ninth array, and H[f+1] is the array element corresponding to the subscript f+1 in the ninth array.
- the terminal device 400 may include: at least one processor 410 , a memory 420 , and a terminal device stored in the memory 420 and available on the at least one processor 410
- the running computer program when the processor 410 executes the computer program, implements the steps in any of the foregoing method embodiments, for example, steps S101 to S104 in the embodiment shown in FIG. 2 .
- the processor 410 executes the computer program, the functions of the modules/units in the foregoing apparatus embodiments, such as the functions of the modules 210 to 240 shown in FIG. 6 , are implemented.
- the computer program may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 420 and executed by the processor 410 to complete the present application.
- the one or more modules/units may be a series of computer program segments capable of accomplishing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 400 .
- FIG. 7 is only an example of a terminal device, and does not constitute a limitation on the terminal device. It may include more or less components than the one shown in the figure, or combine some components, or different components, such as Input and output devices, network access devices, buses, etc.
- the processor 410 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuits) Integrated Circuit, ASIC), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory 420 may be an internal storage unit of the terminal device, or may be an external storage device of the terminal device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, and a flash memory card. (Flash Card) etc.
- the memory 420 is used to store the computer program and other programs and data required by the terminal device.
- the memory 420 may also be used to temporarily store data that has been output or will be output.
- the bus can be an industry standard architecture (Industry Standard Architecture, ISA) bus, Peripheral Component (PCI) bus, or Extended Industry Standard Architecture (Extended Industry Standard) Architecture, EISA) bus, etc.
- ISA Industry Standard Architecture
- PCI Peripheral Component
- EISA Extended Industry Standard Architecture
- the bus can be divided into address bus, data bus, control bus and so on.
- the buses in the drawings of the present application are not limited to only one bus or one type of bus.
- the secure suffix index outsourcing calculation method provided by the embodiments of the present application can be applied to computers, tablet computers, notebook computers, netbooks, personal digital assistants (personal digital assistants) On terminal devices such as assistant, PDA), the embodiments of the present application do not impose any restrictions on the specific type of the terminal device.
- FIG. 8 is a block diagram showing a partial structure of a computer provided by an embodiment of the present application.
- the computer includes: a communication circuit 510 , a memory 520 , an input unit 530 , a display unit 540 , an audio circuit 550 , a wireless fidelity (WiFi) module 560 , a processor 570 , and a power supply 580 .
- WiFi wireless fidelity
- the communication circuit 510 can be used for receiving and sending signals during sending and receiving information or during a call.
- a communication circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
- the communication circuit 510 may also communicate with networks and other devices through wireless communication.
- the above wireless communication can use any communication standard or protocol, including but not limited to the Global System for Mobile communication, GSM), General Packet Radio (General Packet Radio) Service, GPRS), Code Division Multiple Access (Code Division Multiple) Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division) Multiple Access (WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (Short Messaging Service, SMS), etc.
- GSM Global System for Mobile communication
- General Packet Radio General Packet Radio
- GPRS General Packet Radio
- Code Division Multiple Access Code Division Multiple
- CDMA Code Division Multiple Access
- WCDMA Wideband Code Division Multiple Access
- LTE Long Term Evolution
- SMS Short Messaging Service
- the memory 520 can be used to store software programs and modules, and the processor 570 executes various functional applications and data processing of the computer by running the software programs and modules stored in the memory 520 .
- the memory 520 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of a computer (such as audio data, phone books, etc.), etc.
- memory 520 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- the input unit 530 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the computer.
- the input unit 530 may include a touch panel 531 and other input devices 532 .
- the touch panel 531 also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable objects or accessories on or near the touch panel 531). operation), and drive the corresponding connection device according to the preset program.
- the touch panel 531 may include two parts, a touch detection device and a touch controller.
- the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller.
- the touch panel 531 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 530 may further include other input devices 532 .
- other input devices 532 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
- the display unit 540 may be used to display information input by the user or information provided to the user and various menus of the computer.
- the display unit 540 may include a display panel 541, and optionally, a liquid crystal display (Liquid Crystal Display, LCD), an organic light-emitting diode (Organic Light-Emitting Diode) can be used. Diode, OLED) etc. to configure the display panel 541 .
- the touch panel 531 may cover the display panel 541. When the touch panel 531 detects a touch operation on or near it, it transmits it to the processor 570 to determine the type of the touch event, and then the processor 570 determines the type of the touch event according to the touch event. Type provides corresponding visual output on display panel 541 .
- the touch panel 531 and the display panel 541 are used as two independent components to realize the input and input functions of the computer, in some embodiments, the touch panel 531 and the display panel 541 can be integrated to form Realize the input and output functions of the computer.
- Audio circuitry 550 may provide an audio interface between the user and the computer.
- the audio circuit 550 can convert the received audio data into an electrical signal, and transmit it to the speaker to be converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is converted into an electrical signal after being received by the audio circuit 550.
- the audio data, after being processed by the audio data output processor 570, is sent via the communication circuit 510 to, for example, another computer, or the audio data is output to the memory 520 for further processing.
- WiFi is a short-distance wireless transmission technology.
- the computer can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 560. It provides users with wireless broadband Internet access.
- FIG. 8 shows the WiFi module 560, it can be understood that it is not a necessary component of the computer, and can be completely omitted as required within the scope of not changing the essence of the invention.
- the processor 570 is the control center of the computer, using various interfaces and lines to connect various parts of the entire computer, by running or executing the software programs and/or modules stored in the memory 520, and calling the data stored in the memory 520, executing Various functions of the computer and processing data, so as to monitor the computer as a whole.
- the processor 570 may include one or more processing units; preferably, the processor 570 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc. , the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 570.
- the computer also includes a power supply 580 (such as a battery) for supplying power to various components.
- a power supply 580 (such as a battery) for supplying power to various components.
- the power supply 580 can be logically connected to the processor 570 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
- Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the above-mentioned secure suffix index outsourcing computing method can be implemented in each embodiment of the A step of.
- the embodiments of the present application provide a computer program product, when the computer program product runs on a mobile terminal, the steps in each embodiment of the above-mentioned secure suffix index outsourcing calculation method can be implemented when the mobile terminal executes the computer program product.
- the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
- the present application realizes all or part of the processes in the methods of the above embodiments, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium.
- the computer program includes computer program code
- the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
- the computer-readable medium may include at least: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media.
- ROM read-only memory
- RAM random access memory
- electrical carrier signals telecommunication signals
- software distribution media For example, U disk, mobile hard disk, disk or CD, etc.
- computer readable media may not be electrical carrier signals and telecommunications signals.
- the disclosed apparatus/network device and method may be implemented in other manners.
- the apparatus/network device embodiments described above are only illustrative.
- the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种安全的后缀索引外包计算方法及装置,适用于数据处理技术领域,该方法包括:获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数(S101);基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组(S102);基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器(S103);获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组(S104);该方法既可以计算了初始字符串的后缀数组,又可以保证在计算后缀数组时不会泄露初始字符串,保证了初始字符串的安全。
Description
本申请属于数据处理技术领域,尤其涉及一种安全的后缀索引外包计算方法及装置。
在数据处理中,后缀数组(或后缀索引)是一个重要且被广泛应用的数据结构,可以用于数据压缩、基因组比对、全文检索等多种领域。随着互联网技术的发展,需要存储的数据越来越多,为了有效管理及检索这些数据,亟需可高效构造和检索的全文索引,而后缀数组就是可用于进行全文索引的数组。
目前一种可行的外包构造字符串的后缀数组的方法是将需要构造后缀数组的字符串传输至云服务器中,在云服务器中构造字符串的后缀数组,但是目前的云服务器的安全机制并不完全可靠,容易造成数据泄露,因此直接将原始字符串传输至云服务器上无法保证原始字符串的安全,造成构造后缀数组时原始的字符串的安全性差。
本申请实施例提供了一种安全的后缀索引外包计算方法及装置,可以解决目前外包构造字符串的后缀数组时字符串的安全性差的问题。
第一方面,本申请实施例提供了一种安全的后缀索引外包计算方法,包括:
获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数;
基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组;
基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器;
获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
第二方面,本申请实施例提供了一种安全的后缀索引外包计算装置,包括:
数据获取模块,用于获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数;
数据扩充模块,用于基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组;
字符串生成模块,用于基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器;
后缀数组生成模块,用于获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
第三方面,本申请实施例提供了一种终端设备,包括:存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现上述第一方面中任一项所述的安全的后缀索引外包计算方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现上述第一方面中任一项所述的安全的后缀索引外包计算方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的安全的后缀索引外包计算方法。
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
本申请实施例与现有技术相比存在的有益效果是:本申请根据扩充因子扩充初始字符串,得到扩充数组,基于扩充数据得到初始字符串的目标字符串,最后获取云服务器生成的目标字符串的第一后缀数组,基于第一后缀数组得到初始字符串的第二后缀数组;本申请通过将初始字符串转换成目标字符串,通过目标字符串计算初始字符串的后缀数组,不直接使用初始字符串计算后缀数组,保证了初始字符串的安全性,本申请得到的第二后缀数组与直接使用初始字符串生成的后缀数组相同,因此本申请既能保证计算的后缀数组是初始字符串的后缀数组,又可以保证在计算后缀数组时不会泄露初始字符串,保证了初始字符串的安全。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例提供的安全的后缀索引外包计算方法的应用场景示意图;
图2是本申请一实施例提供的安全的后缀索引外包计算方法的流程示意图;
图3是本申请一实施例提供的扩充字符串的确定方法的流程示意图;
图4是本申请一实施例提供的目标字符串的确定方法的流程示意图;
图5是本申请一实施例提供的第二数组的确定方法的具体实现过程的流程示意图;
图6是本申请一实施例提供的安全的后缀索引外包计算装置的结构示意图;
图7是本申请一实施例提供的终端设备的结构示意图;
图8是本申请一实施例提供的计算机的部分结构的框图。
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
目前计算字符串的后缀数组的方法较多,但是在数据规模较大时,普通的计算机依然难以提供构建后缀数组所需要的计算能力,例如:对于长度为n的字符串S,使用目前整体性能最好的归纳排序方法构建其后缀数组需要O(n)的时间开销和O(n log n)位的空间开销;当n较大时,后缀排序对计算机的配置要求很高,而通过互联网使用数据中心的云服务器能够以较低成本获得较高的运算性能,性价比更优。
目前使用云服务器计算字符串的后缀数组是将原始的字符串不加保密的直接上传至云服务器,而目前的云服务器的安全机制并不完全可靠,容易造成数据泄露,因此直接将原始的字符串上传至云服务器计算后缀数组的方法安全性不高。
本申请通过将原始的字符串转换成目标字符串,将目标字符串上传至云服务器,通过目标字符串计算原始的字符串的后缀数组,既能得到准确的原始的字符串的后缀数组,又能保证原始的字符串的安全。
图1为本申请实施例提供的安全的后缀索引外包计算方法的应用场景示意图,上述安全的后缀索引外包计算方法可以用于计算字符串的后缀数组。其中,存储设备10用于存储初始字符串和扩充因子,终端设备20用于从存储设备10中获取初始字符串和扩充因子,并基于扩充因子和初始字符串生成初始字符串的目标字符串,将目标字符串发送至云服务器30,云服务器30生成目标字符串的第一后缀数组后将第一后缀数组发送至终端设备20,终端设备20通过第一后缀数组计算初始字符串的第二后缀数组。
以下结合图1对本申请实施例的安全的后缀索引外包计算方法进行详细说明。
图2示出了本申请提供的安全的后缀索引外包计算方法的示意性流程图,参照图2,对该方法的详述如下:
S101,获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数。
在本实施例中,初始字符串指的是最原始的字符串,也就是待构造后缀数组的字符串,例如,初始字符串可以是S[0,n)=banananana$,需要计算初始字符串的后缀数组。
扩充因子指的是需要将初始字符串中的一个字符扩充到的位数,可以根据需要设置,例如,扩充因子是3,则说明需要将一个字符扩充到3位,也就是3个字符。
获取初始字符串和扩充因子的方法可以是存储设备发送过来的,也可以是用户输入的初始字符串和扩充因子。
S102,基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组。
在本实施例中,由于扩充因子是用于扩充初始字符串中的初始字符的,所以基于扩充因子可以得到扩充后的字符串,并将扩充后的字符串组成扩充数组。
在一种可能的实现方式中,步骤S102的实现过程可以包括:
S1021,基于所述扩充因子,扩充所述初始字符串中的每个初始字符,得到每个初始字符的扩充字符串,并将所述扩充字符串组成所述扩充数组。
在本实施例中,对初始字符串中初始字符进行扩充,需要对每个初始字符均进行扩充,且在扩充时是基于初始字符串进行扩充的,需要根据扩充因子,将初始字符与其后面的初始字符组成扩充字符串。
扩充数组中扩充字符串在扩充数组中的位置与对应的初始字符在初始字符串中的位置相同,例如,初始字符在初始字符串中的位置是第3个字符,则第3个初始字符的扩充字符串在扩充数组中的位置是第3个字符串。
作为举例,如果初始字符串为bana,第1个初始字符b的扩充字符串为ba,第2个初始字符a的扩充字符串为an,第3个初始字符n的扩充字符串为na,第4个初始字符a的扩充字符为a,因此扩充字符串组成的扩充数组为[ba,an,na,a]。
如图3所示,具体的,步骤S1021的实现过程可以包括:
S10211,选取所述初始字符串中的第i个初始字符,其中,i≥1。
在本实施例中,初始字符串的下标是从0开始编号的,例如,初始字符串为banana$,第1个字符为b对应的下标为0,第2个字符为a对应的下标为1,第7个字符为$对应的下标为6。
从初始字符串的第1个初始字符开始选取,直到选取到最后一个初始字符,对初始字符串中每一个初始字符进行扩充。
S10212,若i+k-1≤n,则将所述初始字符串中的第i个初始字符至第i+k-1个初始字符作为所述第i个初始字符的扩充字符串,其中,k为扩充因子,n为所述初始字符串中初始字符的总数,n>1。
在本实施例中,由于需要扩充初始字符,且扩充时增加的字符是初始字符串中与需要扩充的初始字符相连且在初始字符之后的字符,所以需要根据需要扩充的初始字符在初始字符串中的位置确定扩充字符串。
作为举例,初始字符串为banana$,扩充因子为3,对于第1个初始字符b,由于i+k-1=1+3-1<7,则将第1个初始字符至第i+k-1=1+3-1=3个初始字符作为第1个初始字符的扩充字符串,即第1个初始字符的扩充字符串为ban。
对于第2个初始字符a,由于i+k-1=2+3-1<7,则将第2个初始字符至第i+k-1=2+3-1=4个初始字符作为第2个初始字符的扩充字符串,即第2个初始字符的扩充字符串为ana。
S10213,若i+k-1>n,则将所述初始字符串中的第i个初始字符至第n个初始字符作为所述第i个初始字符的扩充字符串。
在本实施例中,如果第i个初始字符之后的初始字符的个数小于k-1,则只需要将第i个初始字符至第n个初始字符作为所述第i个初始字符的扩充字符串即可。
作为举例,初始字符串为banana$,扩充因子为3,对于第6个初始字符a,由于i+k-1=6+3-1>7,则将第6个初始字符至第7个初始字符作为第6个初始字符的扩充字符串,即第6个初始字符的扩充字符串为a$。
对于第7个初始字符$,由于i+k-1=7+3-1>7,则将第7个初始字符至第7个初始字符作为第7个初始字符的扩充字符串,即第7个初始字符的扩充字符串为$。
S103,基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器。
在本实施例中,目标字符串是构建的需要代替初始字符串上传至云服务器计算后缀数组的字符串,由于云服务器不能直接从变换后的目标字符串恢复得到初始字符串,保证了初始字符串的安全。
在本实施例中,云服务器基于归纳排序方法生成所述目标字符串的第一后缀数组。
S104,获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
在本实施例中,云服务器生成目标字符串的第一后缀数组后,将第一后缀数组传回终端设备,终端设备根据第一后缀数组生成初始字符串的第二后缀数组,完成对初始字符串的后缀数组的构建。
本申请实施例中,根据扩充因子扩充初始字符串,得到扩充数组,基于扩充数据得到初始字符串的目标字符串,最后获取云服务器生成的目标字符串的第一后缀数组,基于第一后缀数组得到初始字符串的第二后缀数组;本申请通过将初始字符串转换成目标字符串,通过目标字符串计算初始字符串的后缀数组,不直接使用初始字符串计算后缀数组,保证了初始字符串的安全性,本申请得到的第二后缀数组与直接使用初始字符串生成的后缀数组相同,因此本申请既能保证计算的后缀数组是初始字符串的后缀数组,又可以保证在计算后缀数组时不会泄露初始字符串,保证了初始字符串的安全。
如图4所示,在一种可能的实现方式中,步骤S103的实现过程可以包括:
S1031,将所述初始字符串分成预设分块数量个字符串块。
在本实施例中,分块数量表征将初始字符串中的初始字符分成的块的数量,分块数量可以是用户输入的,也可以预先存储在终端设备中的,还可以是从外部设备中获取的。分块数量可以根据需要设置,例如,设置为3、4或5。
各个字符串块中的字符的数量可以相同也可以不同,也就是可以将初始字符平均分配到各个字符串块中,也可以不是平均分配的。
作为举例,如果分块数量为4,初始字符串为S=banananana$,则可以将初始字符串分块得到S=[ba][nan][ana][na$],其中[ba]、[nan]、[ana]、[na$]分别为4个字符串块。
S1032,基于所述字符串块中的字符,将所述扩充数组分成数组块。
具体的,将所述字符串块中的各个字符对应的扩充字符串组成一个数组块,得到所述扩充数据的各个数组块。
在本实施例中,字符串块是由初始字符串分块得到的,因此字符串块中的每个字符均对应一个扩充字符串,将字符串块中的字符对应的扩充字符串放在一个数组块中,即完成对扩充数组的分块。
作为举例,根据初始字符串得到的字符串块分别为[ba][nan][ana][na$],初始字符串的扩充数组为:
S’=(ban)(ana)(nan)(ana)(nan)(ana)(nan)(ana)(na$)(a$)($),则将扩充数组分块后得到:S’=[(ban)(ana)][(nan)(ana)(nan)][(ana)(nan)(ana)][(na$)(a$)($)],其中:[(ban)(ana)]、[(nan)(ana)(nan)]、[(ana)(nan)(ana)]、[(na$)(a$)($)]分别为4个数组块。
S1033,基于所述字符串块和所述数组块,确定所述初始字符串的目标字符串。
在本实施例中,通过字符串块和数组块即可得到目标字符串。
在一种可能的实现方式中,步骤S1033的实现过程可以包括:
S10331,基于各个所述字符串块中最后一个字符在所述初始字符串中的第一下标,得到由第一下标组成的第一数组。
在本实施例中,每个字符串块中均存在最后一个字符,且最后一个字符在初始字符串中对应一个第一下标,将所有的字符串块中的最后一个字符对应的第一下标组成第一数组。第一下标在第一数组中的排列顺序与字符串块中均存在的最后一个字符在初始字符串中的排列顺序相同。
作为举例,初始字符串S=banananana$,分块后得到S=[ba][nan][ana][na$],[ba]中最后一个字符a在初始字符串中的第一下标为1,[nan]中最后一个字符n在初始字符串中的第一下标为4,[ana]中最后一个字符a在初始字符串中的第一下标为7,[na$]中最后一个字符$在初始字符串中的第一下标为10,则第一数组E[4]={1,4,7,10}。
S10332,基于各个所述字符串块的块末后缀在所述初始字符串的第一后缀中的排名,得到由排名编号组成的第二数组。
在本实施例中,字符串块的块末后缀由该字符串块中的最后一个字符至所述初始字符串的最后一个初始字符组成。
初始字符串的第一后缀的个数与初始字符串中初始字符的个数相同,初始字符有几个,初始字符串的第一后缀就有几个,例如,初始字符串中有11个初始字符,则初始字符串有11个第一后缀。
其中,初始字符串最后一个初始字符为一个第一后缀,所述初始字符串中第g个初始字符至最后一个初始字符组成一个第一后缀,1≤g<n,n为所述初始字符串中初始字符的总数。
如图5所示,具体的,步骤S10332的实现过程可以包括:
S103321,获取所述初始字符串中的第j个字符串块的块末后缀,其中,所述第j个字符串块的块末后缀由第j个字符串块中的最后一个字符至所述初始字符串的最后一个初始字符组成,1≤j≤m,m为分块数量。
作为举例,S=[ba][nan][ana][na$]中第一个字符串块的块末后缀为anananana$,第二个字符串块的块末后缀为nanana$,第三个字符串块的块末后缀为ana$,第四个字符串块的块末后缀为$。
S103323,获取所述初始字符串的各个第一后缀,将各个所述第一后缀按照字典顺序排序,其中,所述初始字符串最后一个初始字符为一个第一后缀,所述初始字符串中第g个初始字符至最后一个初始字符组成一个第一后缀,1≤g<n,n为所述初始字符串中初始字符的总数。
作为举例,如果初始字符串为S=banananana$,初始字符串的第一后缀分别为$、a$、na$、ana$、nana$、anana$、nanana$、ananana$、nananana$、anananana$、banananana$;
将以上第一后缀进行排序得到$、a$、ana$、anana$、ananana$、anananana$、banananana$、na$、nana$、nanana$、nananana$。
S103324,对排序后的第一后缀进行编号,得到各个第一后缀的第一编号。
在本实施例中,每个排序后的第一后缀从0开始编号,每个第一后缀对应一个第一编号。
作为举例,排序后的第一后缀为$、a$、ana$、anana$、ananana$、anananana$、banananana$、na$、nana$、nanana$、nananana$,则$的第一编号为0,a$的第一编号为1,依次类推,得到nananana$的第一编号为10。
S103325,将每个字符串块的块末后缀对应的编号作为所述第二数组,其中,所述块末后缀对应的编号为与所述块末后缀相同的第一后缀的第一编号。
在本实施例中,每个块末后缀在第一后缀均可以找到与之相同的,将与之相同的第一后缀的第一编号作为块末后缀对应的编号,利用块末后缀对应的编号组成第二数组。
第二数组中数组元素的顺序与块末后缀对应的数组块的排序相同。
作为举例,S=[ba][nan][ana][na$]中第一个字符串块的块末后缀为anananana$,第二个字符串块的块末后缀为nanana$,第三个字符串块的块末后缀为ana$,第四个字符串块的块末后缀为$;
排序后的第一后缀为$、a$、ana$、anana$、ananana$、anananana$、banananana$、na$、nana$、nanana$、nananana$,则$的第一编号为0,a$的第一编号为1,依次类推,得到nananana$的第一编号为10;
则可以确定块末后缀anananana$的编号为5,块末后缀nanana$的编号为9,块末后缀ana$的编码为2,块末后缀$的编码为0,第二数组为A[4]={5,9,2,0}。
S10333,基于所述数组块、所述扩充数组、所述第一数组和所述第二数组,得到第三数组。
在一种可能的实现方式中,步骤S10333的实现过程可以包括:
S103331,基于公式V[A[a]]=E[a],将所述第一数组中的数组元素放入所述第三数组中对应的第一位置,其中,a为所述第一数组中数组元素的下标,0≤a<m,m为分块数量,E[a]为第一数组中下标a对应的数组元素,A[a]为第二数组中的下标a对应的数组元素;V[A[a]]为第三数组中下标A[a]对应的数组元素。
在本实施例中,第一位置指的是第三数组中存放第一数组中的元素的位置,根据对应关系可以将第一数组中的元素放入第三数组中,得到第三数组中的部分数组元素。
作为举例,第一数组E[4]={1,4,7,10},第二数组为A[4]={5,9,2,0},则:
a=0时,根据V[A[0]]=E[0]得到V[5]=1,也就是第三数组中下标5对应整数1;
a=1时,根据V[A[1]]=E[1]得到V[9]=4,也就是第三数组中下标9对应整数4;
a=2时,根据V[A[2]]=E[2]得到V[2]=7,也就是第三数组中下标2对应整数7;
a=3时,根据V[A[3]]=E[3]得到V[0]=10,也就是第三数组中下标0对应整数10。
S103332,将目标扩充字符串按照字典顺序进行排序,将排序后的各个目标扩充字符串在扩充数组中对应的下标作为第六数组,其中,所述目标扩充字符串指所述扩充数组中不是块末字符串的字符串,所述块末字符串指数组块中的最后一个字符串。
在本实施例中,由于将扩充数组分块后得到数组块,每个数组块中均有一个块末字符串,因此扩充数组中既包括块末字符串,又包括非块末字符串。块末字符串在扩充数组中的下标已经通过步骤S103331放入第三数组中,所以当前只需将非块末字符串在扩充数组中的下标放入第三数组即可。
作为举例,如果扩充数组为:
S’=[(ban)(ana)][(nan)(ana)(nan)][(ana)(nan)(ana)][(na$)(a$)($)],将扩充数组中的非块末字符串进行排序得到的第六数组为:Q={a$、ana、ana、ban、na$、nan、nan}对应的下标分别为9、3、5、0、8、6、2。
S103333,基于公式V[B
b]=M[b],将所述第六数组中的元素放入所述第三数组中对应的第二位置,其中,b≥1,M[b]为所述第六数组中的第b个位置上的数组元素,V[B
b]为第三数组中第二位置上的数组元素,B
b为第b个第二位置,第二位置为所述第三数组中除第一位置以外的位置。
在本实施例中,在将第六数组中的字符放入第三数组中时,非块末字符串中存在与块末字符串相同的字符串时,可以基于块末字符串的第二后缀和非块末字符串的第三后缀的大小顺序将非块末字符串的下标放入第三数组中。非块末字符串的第三后缀为该非块末字符串对应的初始字符的第一后缀。块末字符串的第二后缀为该块末字符串对应的初始字符所在字符串块的块末后缀。
作为举例,第一数组E[4]={1,4,7,10},第二数组为A[4]={5,9,2,0},扩充数组为:
S’=(ban)(ana)(nan)(ana)(nan)(ana)(nan)(ana)(na$)(a$)($),第六数组为Q={a$、ana、ana、ban、na$、nan、nan}对应的下标分别为9、3、5、0、8、6、2;
则得到的第三数组为V[11]={10,9,7,3,5,1,0,8,6,4,2}。
在本实施例中,得到第三数组后,还可以确定第三数组中的桶,将相同扩充字符串对应的下标组成一个桶。作为举例,以上第三数组为V[11]={10,9,7,3,5,1,0,8,6,4,2},扩充字符串ana构成的桶为[7、3、5、1],nan构成的桶为[6、4、2],还可以确定块末字符串在桶中的位置。
S10334,基于所述扩充数组,确定第四数组。
在一种可能的实现方式中,步骤S10334的实现过程可以包括:
S103341,按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到排序后的扩充字符串组成的目标数组。
在本实施例中,对扩充字符串按照字典顺序进行排序,可以得到排序后的扩充字符串,具体的排序应满足的条件可以参照以下具体实现过程。
在一种可能的实现方式中,步骤S103341的实现过程可以包括:
按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到扩充字符串序列;在所述扩充字符串序列中存在相同的扩充字符串,且相同的扩充字符串中至少一个是块末字符串时,基于所述初始字符串的后缀和所述块末字符串对应的初始字符所在字符串块的块末后缀,对所述相同的扩充字符串进行排序,得到所述目标数组。
在本实施例中,按照字典顺序对扩充字符串进行排序得到的是初次排序后的结果,也就是如果存在相同的扩充字符串,相同的扩充字符串的先后顺序在经过初次排序后是不能确定的,所以,还要对扩充字符串序列进行再次排序。
具体的,如果相同的扩充字符串中没有块末字符串,则相同的扩充字符串可以随意排列。如果相同的扩充字符串中存在块末字符串,可以基于块末字符串的第二后缀和非块末字符串的第三后缀的大小对相同的扩充字符串进行排序。非块末字符串的第三后缀为该非块末字符串对应的初始字符的第一后缀。块末字符串的第二后缀为该块末字符串对应的初始字符所在字符串块的块末后缀。
如果非块末字符串的第三后缀小于块末字符串的第二后缀,则将该非块末字符串放在该块末字符串的前面,反之在该块末字符串的后面。如果两个或多个非块末字符串相邻,则按照非块末字符串在扩充数组中的前后位置进行排列。
作为举例,如果扩充数组为:
初始字符串为S=banananana$;
S’=[(ban)(ana)][(nan)(ana)(nan)][(ana)(nan)(ana)][(na$)(a$)($)],对扩充字符串进行排序后得到的目标数组为:S’’=($)(a$)(ana)(ana)(ana)(ana)(ban)(na$)(nan)(nan)(nan)。
(ana)(ana)(ana)(ana)为四个相同的扩充字符串,分别为第一个数组块中的块末字符串,下标为1;第三个数组块中的块末字符串,下标为7;其他两个为非块末字符串,下标分别为3和5;第一个数组块中的块末字符串的第二后缀为anananana$;
第三个数组块中的块末字符串的第二后缀为ana$;
下标为3的非块末字符串的第三后缀为ananana$;
下标为5的非块末字符串的第三后缀为anana$;
因此排序后的(ana)(ana)(ana)(ana)对应的下标分别为7、3、5、1;
依照上述方法排序后的(nan)(nan)(nan)对应的下标分别为6、4、2。
S103342,确定各个所述字符串块中的块末字符串在所述目标数组中的位置,所述块末字符串指数组块中的最后一个字符串。
在本实施例中,确定了扩充字符串的排列顺序,自然可以确定各个块末字符串在排列后的扩充字符串中的位置。
作为举例,如果目标数组为:
S’’=($)(a$)(ana)(ana)(ana)(ana)(ban)(na$)(nan)(nan)(nan),其中,(ana)(ana)(ana)(ana)在扩充数组中对应的下标分别为7、3、5、1,(nan)(nan)(nan)在扩充数组中对应的下标分别为6、4、2,则块末字符串在所述目标数组中分别为下标为0、2、5、9的字符串。
S103343,对所述目标数组中的扩充字符串进行编号,得到所述第四数组。
在本实施例中,对所述目标数组中的扩充字符串进行编号可以从0开始,然后依次加1,得到第四数组,第四数组是由编号组成的。具体的编号应该满足的预设规则如下所述。
在一种可能的实现方式中,步骤S103343的实现过程可以包括:
依次对所述目标数组中的扩充字符串进行编号,其中,相同且相邻的非块末字符串具有相同的编号,相同且不相邻的非块末字符串具有不同的编号,块末字符串的编号不等于其他扩充字符串的编号。
作为举例,如果目标数组为:
S’’=($)(a$)(ana)(ana)(ana)(ana)(ban)(na$)(nan)(nan)(nan),其中,(ana)(ana)(ana)(ana)在扩充数组中对应的下标分别为7、3、5、1,(nan)(nan)(nan)在扩充数组中对应的下标分别为6、4、2,则块末字符串在所述目标数组中分别为下标为0、2、5、9的字符串,因此,第四数组为R[11]={0,1,2,3,3,4,5,6,7,8,9}。
S10335,基于所述第三数组和所述第四数组,确定第五数组。
在一种可能的实现方式中,步骤S10335的实现过程可以包括:
基于公式Y[V[c]]=R[c]确定第五数组,其中,R[c]为第四数组中下标c对应的数组元素,V[c]为第三数组中下标c对应的数组元素,Y[V[c]]为第五数组中下标V[c]对应的数组元素,0≤c<n,n为所述初始字符串中初始字符的总数。
在本实施例中,基于第三数组和第四数组中可以得到第五数组。
作为举例,第三数组为V[11]={10,9,7,3,5,1,0,8,6,4,2},第四数组为R[11]={0,1,2,3,3,4,5,6,7,8,9},则:
c=0时,根据Y[V[0]]=R[0],Y[10]=0;
c=1时,根据Y[V[1]]=R[1],Y[9]=1;依次计算,可得第五数组为Y[11]={5,4,9,3,8,3,7,2,6,1,0}。
S10336,基于各个所述字符串块中的字符数量,将所述第五数组分成数据块。
在本实施例中,初始字符串中字符串块中的字符数量是多少,数据块中的字符数量就是多少,且数据块的排列顺序与字符串块的排列顺序相同。
作为举例,如果分块后的初始字符串为S=[ba][nan][ana][na$],第五数组为Y[11]={5,4,9,3,8,3,7,2,6,1,0};
则分块后的第五数组为:Y[11]={[5,4][9,3,8][3,7,2][6,1,0]},[5,4]、[9,3,8]、[3,7,2]、[6,1,0]为四个数据块。
S10337,将各个所述数据块重新排序,得到所述目标字符串。
在本实施例中,得到数据块后,可以将数据块重新排列,得到排列后的数组记为目标字符串。
在一种可能的实现方式中,步骤S10337的实现过程可以包括:
基于第七数组将各个所述数据块重新排序,得到所述目标字符串,其中,第七数组是将所述第五数组中的数据块的下标重新排序后得到的。
在本实施例中,第七数组可以是基于第五数组生成的,第七数组中的数组元素是由第五数组中的数据块的下标组成的,数据块的下标随机排列得到第七数组。
在本实施例中,有了第七数组,基于第七数组中数据块的下标的排列顺序,将数据块重新排列,得到目标字符串。
作为举例,如果分块后的第五数组为:Y[11]={[5,4][9,3,8][3,7,2][6,1,0]},则数据块[5,4]的下标为0,数据块[9,3,8]的下标为1,数据块[3,7,2]的下标为2,数据块[6,1,0]的下标为3,因此,第七数组可以是P[4]={1,0,3,2},当然第七数组还可以是数据块的下标其他排列顺序的组合,在此不做限制;
将Y[11]={[5,4][9,3,8][3,7,2][6,1,0]}重新排列,得到目标字符串为X[11]={9,3,8,5,4,6,1,0,3,7,2}。
在一种可能的实现方式中,步骤S104的实现过程可以包括:
S1041,基于所述目标字符串中各个所述数据块中字符的个数,确定由各个所述数据块中字符的个数组成的第八数组。
在本实施例中,第八数组中的数组元素表征的是数据块中字符的个数,第八数组中的数组元素的排列顺序与数据块在目标字符串中的排列顺序相同。
作为举例,目标字符串为X[11]={9,3,8,5,4,6,1,0,3,7,2},数据块分别为[9,3,8][5,4][6,1,0][3,7,2],则第八数组为W[4]={3,2,3,3}。
S1042,基于所述第八数组,确定第九数组。
在一种可能的实现方式中,步骤S1042的实现过程可以包括:
将0作为所述第九数组中的第一个数组元素,将所述第八数组中的第一个数组元素作为第九数组中的第二个数组元素;
计算所述第八数组中的第一个数组元素至第d个数组元素的和,其中,1<d≤m,m为分块数量;
将所述第八数组中的第一个数组元素至第d个数组元素的和作为所述第九数组中的第d+1个数组元素。
作为举例,如果第八数组为W[4]={3,2,3,3},第九数组中第三个元素为3+2=5,第四个元素为3+2+3=8,第五个元素为3+2+3+3=11,则第九数组为H[5]={0,3,5,8,11}。
S1043,基于所述第九数组和所述第一后缀数组,得到所述第二后缀数组。
在一种可能的实现方式中,步骤S1043的实现过程可以包括:
基于公式SA
S[e]=E[P[f]]-W[f]+1+SA
X[e]-H[f],得到所述第二后缀数组,其中,f基于公式H[f]≤SA
X[e]<H[f+1]确定,SA
S[e]为第二后缀数组中下标e对应的数组元素,E[P[f]]为第一数组中下标P[f]对应的数组元素,P[f]为第七数组中下标f对应的数组元素,W[f]为第八数组中下标f对应的数组元素,SA
X[e]为第一后缀数组中下标e对应的数组元素,H[f]为第九数组中下标f对应的数组元素,H[f+1]为第九数组中下标f+1对应的数组元素。
作为举例,如果SA
X[11]={7,6,10,8,1,4,3,5,9,2,0},第九数组为H[5]={0,3,5,8,11},第八数组为W[4]={3,2,3,3},第七数组为P[4]={1,0,3,2},第一数组E[4]={1,4,7,10},则:
e=0,SA
X[e]=7,f=2,SA
S[0]=E[P[2]]-W[2]+1+SA
X[0]-H[2]=10-3+1+7-5=10;
e=1,SA
X[e]=6,f=2,SA
S[1]=E[P[2]]-W[2]+1+SA
X[1]-H[2]=10-3+1+6-5=9;
e=2,SA
X[e]=10,f=3,SA
S[2]=E[P[3]]-W[3]+1+SA
X[2]-H[3]=7-3+1+10-8=7;
依次计算,
e=10,SA
X[e]=0,f=0,SA
S[10]=E[P[0]]-W[0]+1+SA
X[10]-H[0]=4-3+1+0-0=2;
因此,第二后缀数组为SA
S[11]={10,9,7,5,3,1,0,8,6,4,2}。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的安全的后缀索引外包计算方法,图6示出了本申请实施例提供的安全的后缀索引外包计算装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图6,该装置200可以包括:数据获取模块210、数据扩充模块220、字符串生成模块230和后缀数组生成模块240。
其中,数据获取模块210,用于获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数;
数据扩充模块220,用于基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组;
字符串生成模块230,用于基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器;
后缀数组生成模块240,用于获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
在一种可能的实现方式中,数据扩充模块220具体可以包括:
数据扩充单元,用于基于所述扩充因子,扩充所述初始字符串中的每个初始字符,得到每个初始字符的扩充字符串,并将所述扩充字符串组成所述扩充数组。
在一种可能的实现方式中,数据扩充单元具体可以包括:
选取所述初始字符串中的第i个初始字符,其中,i≥1;
若i+k-1≤n,则将所述初始字符串中的第i个初始字符至第i+k-1个初始字符作为所述第i个初始字符的扩充字符串,其中,k为扩充因子,n为所述初始字符串中初始字符的总数,n>1;
若i+k-1>n,则将所述初始字符串中的第i个初始字符至第n个初始字符作为所述第i个初始字符的扩充字符串。
在一种可能的实现方式中,字符串生成模块230具体可以包括:
第一分块单元,用于将所述初始字符串分成预设分块数量个字符串块;
第二分块单元,用于基于所述字符串块中的字符,将所述扩充数组分成数组块;
字符串生成单元,用于基于所述字符串块和所述数组块,确定所述初始字符串的目标字符串。
在一种可能的实现方式中,第二分块单元具体可以用于:
将所述字符串块中的各个字符对应的扩充字符串组成一个数组块,得到所述扩充数据的各个数组块。
在一种可能的实现方式中,字符串生成单元具体可以包括:
第一数组生成子单元,用于基于各个所述字符串块中最后一个字符在所述初始字符串中的第一下标,得到由第一下标组成的第一数组;
第二数组生成子单元,用于基于各个所述字符串块的块末后缀在所述初始字符串的第一后缀中的排名,得到由排名编号组成的第二数组;
第三数组生成子单元,用于基于所述数组块、所述扩充数组、所述第一数组和所述第二数组,得到第三数组;
第四数组生成子单元,用于基于所述扩充数组,确定第四数组;
第五数组生成子单元,用于基于所述第三数组和所述第四数组,确定第五数组;
数据块生成子单元,用于基于各个所述字符串块中的字符数量,将所述第五数组分成数据块;
目标字符串生成子单元,用于将各个所述数据块重新排序,得到所述目标字符串。
在一种可能的实现方式中,第二数组生成子单元具体可以用于:
获取所述初始字符串中的第j个字符串块的块末后缀,其中,所述第j个字符串块的块末后缀由第j个字符串块中的最后一个字符至所述初始字符串的最后一个初始字符组成,1≤j≤m,m为分块数量;
获取所述初始字符串的各个第一后缀,将各个所述第一后缀按照字典顺序排序,其中,所述初始字符串最后一个初始字符为一个第一后缀,所述初始字符串中第g个初始字符至最后一个初始字符组成一个第一后缀,1≤g<n,n为所述初始字符串中初始字符的总数;
对排序后的第一后缀进行编号,得到各个第一后缀的第一编号;
将每个字符串块的块末后缀对应的编号作为所述第二数组,其中,所述块末后缀对应的编号为与所述块末后缀相同的第一后缀的第一编号。
在一种可能的实现方式中,第三数组生成子单元,具体可以用于:
基于公式V[A[a]]=E[a],将所述第一数组中的数组元素放入所述第三数组中对应的第一位置,其中,a为所述第一数组中数组元素的下标,0≤a<m,m为分块数量,E[a]为第一数组中下标a对应的数组元素,A[a]为第二数组中的下标a对应的数组元素;V[A[a]]为第三数组中下标A[a]对应的数组元素;
将目标扩充字符串按照字典顺序进行排序,将排序后的各个目标扩充字符串在扩充数组中对应的下标作为第六数组,其中,所述目标扩充字符串指所述扩充数组中不是块末字符串的字符串,所述块末字符串指数组块中的最后一个字符串;
基于公式V[B
b]=M[b],将所述第六数组中的数组元素放入所述第三数组中对应的第二位置,其中,b≥1,M[b]为所述第六数组中的第b个位置上的数组元素,V[B
b]为第三数组中第二位置上的数组元素,B
b为第b个第二位置,第二位置为所述第三数组中除第一位置以外的位置。
在一种可能的实现方式中,第四数组生成子单元具体可以用于:
按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到排序后的扩充字符串组成的目标数组;
确定各个所述字符串块中的块末字符串在所述目标数组中的位置,所述块末字符串指数组块中的最后一个字符串;
对所述目标数组中的扩充字符串进行编号,得到所述第四数组。
在一种可能的实现方式中,第四数组生成子单元具体还可以用于:
按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到扩充字符串序列;
在所述扩充字符串序列中存在相同的扩充字符串,且相同的扩充字符串中至少一个是块末字符串时,基于所述初始字符串的后缀和所述块末字符串对应的初始字符所在字符串块的块末后缀,对所述相同的扩充字符串进行排序,得到所述目标数组。
在一种可能的实现方式中,第四数组生成子单元具体还可以用于:
依次对所述目标数组中的扩充字符串进行编号,其中,相同且相邻的非块末字符串具有相同的编号,相同且不相邻的非块末字符串具有不同的编号,块末字符串的编号不等于其他扩充字符串的编号。
在一种可能的实现方式中,第五数组生成子单元具体可以用于:
基于公式Y[V[c]]=R[c]确定第五数组,其中,R[c]为第四数组中下标c对应的数组元素,V[c]为第三数组中下标c对应的数组元素,Y[V[c]]为第五数组中下标V[c]对应的字符,0≤c<n,n为所述初始字符串中初始字符的总数。
在一种可能的实现方式中,目标字符串生成子单元具体可以用于:
基于第七数组将各个所述数据块重新排序,得到所述目标字符串,其中,第七数组是将所述第五数组中的数据块的下标重新排序后得到的。
在一种可能的实现方式中,所述第一后缀数组的生成方法包括:
基于归纳排序方法生成所述目标字符串的第一后缀数组。
在一种可能的实现方式中,后缀数组生成模块240具体可以包括:
第八数组生成单元,用于基于所述目标字符串中各个所述数据块中字符的个数,确定由各个所述数据块中字符的个数组成的第八数组;
第九数组生成单元,用于基于所述第八数组,确定第九数组;
第二后缀数组生成单元,用于基于所述第九数组和所述第一后缀数组,得到所述第二后缀数组。
在一种可能的实现方式中,第九数组生成单元具体可以用于:
将0作为所述第九数组中的第一个数组元素,将所述第八数组中的第一个数组元素作为第九数组中的第二个数组元素;
计算所述第八数组中的第一个数组元素至第d个数组元素的和,其中,1<d≤m,m为分块数量;
将所述第八数组中的第一个数组元素至第d个数组元素的和作为所述第九数组中的第d+1个数组元素。
在一种可能的实现方式中,第二后缀数组生成单元具体可以用于:
基于公式SA
S[e]=E[P[f]]-W[f]+1+SA
X[e]-H[f],得到所述第二后缀数组,其中,f基于公式H[f]≤SA
X[e]<H[f+1]确定,SA
S[e]为第二后缀数组中下标e对应的数组元素,E[P[f]]为第一数组中下标P[f]对应的数组元素,P[f]为第七数组中下标f对应的数组元素,W[f]为第八数组中下标f对应的数组元素,SA
X[e]为第一后缀数组中下标e对应的数组元素,H[f]为第九数组中下标f对应的数组元素,H[f+1]为第九数组中下标f+1对应的数组元素。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请实施例还提供了一种终端设备,参见图7,该终端设400可以包括:至少一个处理器410、存储器420以及存储在所述存储器420中并可在所述至少一个处理器410上运行的计算机程序,所述处理器410执行所述计算机程序时实现上述任意各个方法实施例中的步骤,例如图2所示实施例中的步骤S101至步骤S104。或者,处理器410执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如图6所示模块210至240的功能。
示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器420中,并由处理器410执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序段,该程序段用于描述计算机程序在终端设备400中的执行过程。
本领域技术人员可以理解,图7仅仅是终端设备的示例,并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如输入输出设备、网络接入设备、总线等。
处理器410可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific
Integrated Circuit,ASIC)、现成可编程门阵列
(Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器420可以是终端设备的内部存储单元,也可以是终端设备的外部存储设备,例如插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。所述存储器420用于存储所述计算机程序以及终端设备所需的其他程序和数据。所述存储器420还可以用于暂时地存储已经输出或者将要输出的数据。
总线可以是工业标准体系结构(Industry Standard
Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard
Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。
本申请实施例提供的安全的后缀索引外包计算方法可以应用于计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital
assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。
以所述终端设备为计算机为例。图8示出的是与本申请实施例提供的计算机的部分结构的框图。参考图8,计算机包括:通信电路510、存储器520、输入单元530、显示单元540、音频电路550、无线保真(wireless fidelity,WiFi)模块560、处理器570以及电源580等部件。
下面结合图8对计算机的各个构成部件进行具体的介绍:
通信电路510可用于收发信息或通话过程中,信号的接收和发送,特别地,将图像采集设备发送的图像样本接收后,给处理器570处理;另外,将图像采集指令发送给图像采集设备。通常,通信电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,通信电路510还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile
communication,GSM)、通用分组无线服务(General Packet Radio
Service,GPRS)、码分多址(Code Division Multiple
Access,CDMA)、宽带码分多址(Wideband Code Division
Multiple Access, WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器520可用于存储软件程序以及模块,处理器570通过运行存储在存储器520的软件程序以及模块,从而执行计算机的各种功能应用以及数据处理。存储器520可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器520可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元530可用于接收输入的数字或字符信息,以及产生与计算机的用户设置以及功能控制有关的键信号输入。具体地,输入单元530可包括触控面板531以及其他输入设备532。触控面板531,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板531上或在触控面板531附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板531可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器570,并能接收处理器570发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板531。除了触控面板531,输入单元530还可以包括其他输入设备532。具体地,其他输入设备532可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元540可用于显示由用户输入的信息或提供给用户的信息以及计算机的各种菜单。显示单元540可包括显示面板541,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting
Diode, OLED)等形式来配置显示面板541。进一步的,触控面板531可覆盖显示面板541,当触控面板531检测到在其上或附近的触摸操作后,传送给处理器570以确定触摸事件的类型,随后处理器570根据触摸事件的类型在显示面板541上提供相应的视觉输出。虽然在图8中,触控面板531与显示面板541是作为两个独立的部件来实现计算机的输入和输入功能,但是在某些实施例中,可以将触控面板531与显示面板541集成而实现计算机的输入和输出功能。
音频电路550可提供用户与计算机之间的音频接口。音频电路550可将接收到的音频数据转换后的电信号,传输到扬声器由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路550接收后转换为音频数据,再将音频数据输出处理器570处理后,经通信电路510以发送给比如另一计算机,或者将音频数据输出至存储器520以便进一步处理。
WiFi属于短距离无线传输技术,计算机通过WiFi模块560可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块560,但是可以理解的是,其并不属于计算机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器570是计算机的控制中心,利用各种接口和线路连接整个计算机的各个部分,通过运行或执行存储在存储器520内的软件程序和/或模块,以及调用存储在存储器520内的数据,执行计算机的各种功能和处理数据,从而对计算机进行整体监控。可选的,处理器570可包括一个或多个处理单元;优选的,处理器570可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器570中。
计算机还包括给各个部件供电的电源580(比如电池),优选的,电源580可以通过电源管理系统与处理器570逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时可实现上述安全的后缀索引外包计算方法各个实施例中的步骤。
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时可实现上述安全的后缀索引外包计算方法各个实施例中的步骤。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/网络设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/网络设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种安全的后缀索引外包计算方法,其特征在于,包括:获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数;基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组;基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器;获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
- 如权利要求1所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组,包括:基于所述扩充因子,扩充所述初始字符串中的每个初始字符,得到每个初始字符的扩充字符串,并将所述扩充字符串组成所述扩充数组。
- 如权利要求2所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述扩充因子,扩充所述初始字符串中的每个初始字符,得到每个初始字符的扩充字符串,包括:选取所述初始字符串中的第i个初始字符,其中,i≥1;若i+k-1≤n,则将所述初始字符串中的第i个初始字符至第i+k-1个初始字符作为所述第i个初始字符的扩充字符串,其中,k为扩充因子,n为所述初始字符串中初始字符的总数,n>1;若i+k-1>n,则将所述初始字符串中的第i个初始字符至第n个初始字符作为所述第i个初始字符的扩充字符串。
- 如权利要求1所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述扩充数组,确定所述初始字符串的目标字符串,包括:将所述初始字符串分成预设分块数量个字符串块;基于所述字符串块中的字符,将所述扩充数组分成数组块;基于所述字符串块和所述数组块,确定所述初始字符串的目标字符串。
- 如权利要求4所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述字符串块中的字符,将所述扩充数组分成数组块,包括:将所述字符串块中的各个字符对应的扩充字符串组成一个数组块,得到所述扩充数据的各个数组块。
- 如权利要求4所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述字符串块和所述数组块,确定所述初始字符串的目标字符串,包括:基于各个所述字符串块中最后一个字符在所述初始字符串中的第一下标,得到由第一下标组成的第一数组;基于各个所述字符串块的块末后缀在所述初始字符串的第一后缀中的排名,得到由排名编号组成的第二数组;基于所述数组块、所述扩充数组、所述第一数组和所述第二数组,得到第三数组;基于所述扩充数组,确定第四数组;基于所述第三数组和所述第四数组,确定第五数组;基于各个所述字符串块中的字符数量,将所述第五数组分成数据块;将各个所述数据块重新排序,得到所述目标字符串。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述基于各个所述字符串块的块末后缀在所述初始字符串的第一后缀中的排名,得到由排名编号组成的第二数组,包括:获取所述初始字符串中的第j个字符串块的块末后缀,其中,所述第j个字符串块的块末后缀由第j个字符串块中的最后一个字符至所述初始字符串的最后一个初始字符组成,1≤j≤m,m为分块数量;获取所述初始字符串的各个第一后缀,将各个所述第一后缀按照字典顺序排序,其中,所述初始字符串最后一个初始字符为一个第一后缀,所述初始字符串中第g个初始字符至最后一个初始字符组成一个第一后缀,1≤g<n,n为所述初始字符串中初始字符的总数;对排序后的第一后缀进行编号,得到各个第一后缀的第一编号;将每个字符串块的块末后缀对应的编号作为所述第二数组,其中,所述块末后缀对应的编号为与所述块末后缀相同的第一后缀的第一编号。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述数组块、所述扩充数组、所述第一数组和所述第二数组,得到第三数组,包括:基于公式V[A[a]]=E[a],将所述第一数组中的数组元素放入所述第三数组中对应的第一位置,其中,a为所述第一数组中数组元素的下标,0≤a<m,m为分块数量,E[a]为第一数组中下标a对应的数组元素,A[a]为第二数组中的下标a对应的数组元素;V[A[a]]为第三数组中下标A[a]对应的数组元素;将目标扩充字符串按照字典顺序进行排序,将排序后的各个目标扩充字符串在扩充数组中对应的下标作为第六数组,其中,所述目标扩充字符串指所述扩充数组中不是块末字符串的字符串,所述块末字符串指数组块中的最后一个字符串;基于公式V[B b]=M[b],将所述第六数组中的数组元素放入所述第三数组中对应的第二位置,其中,b≥1,M[b]为所述第六数组中的第b个位置上的数组元素,V[B b]为第三数组中第二位置上的数组元素,B b为第b个第二位置,第二位置为所述第三数组中除第一位置以外的位置。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述扩充数组,确定第四数组,包括:按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到排序后的扩充字符串组成的目标数组;确定各个所述字符串块中的块末字符串在所述目标数组中的位置,所述块末字符串指数组块中的最后一个字符串;对所述目标数组中的扩充字符串进行编号,得到所述第四数组。
- 如权利要求9所述的安全的后缀索引外包计算方法,其特征在于,所述按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到排序后的扩充字符串组成的目标数组,包括:按照字典顺序对所述扩充数组中的扩充字符串进行排序,得到扩充字符串序列;在所述扩充字符串序列中存在相同的扩充字符串,且相同的扩充字符串中至少一个是块末字符串时,基于所述初始字符串的后缀和所述块末字符串对应的初始字符所在字符串块的块末后缀,对所述相同的扩充字符串进行排序,得到所述目标数组。
- 如权利要求9所述的安全的后缀索引外包计算方法,其特征在于,所述对所述目标数组中的扩充字符串进行编号,得到所述第四数组,包括:依次对所述目标数组中的扩充字符串进行编号,其中,相同且相邻的非块末字符串具有相同的编号,相同且不相邻的非块末字符串具有不同的编号,块末字符串的编号不等于其他扩充字符串的编号。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述第三数组和所述第四数组,确定第五数组,包括:基于公式Y[V[c]]=R[c]确定第五数组,其中,R[c]为第四数组中下标c对应的数组元素,V[c]为第三数组中下标c对应的数组元素,Y[V[c]]为第五数组中下标V[c]对应的字符,0≤c<n,n为所述初始字符串中初始字符的总数。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述将各个所述数据块重新排序,得到所述目标字符串,包括:基于第七数组将各个所述数据块重新排序,得到所述目标字符串,其中,第七数组是将所述第五数组中的数据块的下标重新排序后得到的。
- 如权利要求1所述的安全的后缀索引外包计算方法,其特征在于,所述第一后缀数组的生成方法包括:基于归纳排序方法生成所述目标字符串的第一后缀数组。
- 如权利要求6所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述第一后缀数组生成所述初始字符串的第二后缀数组,包括:基于所述目标字符串中各个所述数据块中字符的个数,确定由各个所述数据块中字符的个数组成的第八数组;基于所述第八数组,确定第九数组;基于所述第九数组和所述第一后缀数组,得到所述第二后缀数组。
- 如权利要求15所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述第八数组,确定第九数组,包括:将0作为所述第九数组中的第一个数组元素,将所述第八数组中的第一个数组元素作为第九数组中的第二个数组元素;计算所述第八数组中的第一个数组元素至第d个数组元素的和,其中,1<d≤m,m为分块数量;将所述第八数组中的第一个数组元素至第d个数组元素的和作为所述第九数组中的第d+1个数组元素。
- 如权利要求15所述的安全的后缀索引外包计算方法,其特征在于,所述基于所述第九数组和所述第一后缀数组,得到所述第二后缀数组,包括:基于公式SA S[e]=E[P[f]]-W[f]+1+SA X[e]-H[f],得到所述第二后缀数组,其中,f基于公式H[f]≤SA X[e]<H[f+1]确定,SA S[e]为第二后缀数组中下标e对应的数组元素,E[P[f]]为第一数组中下标P[f]对应的数组元素,P[f]为第七数组中下标f对应的数组元素,W[f]为第八数组中下标f对应的数组元素,SA X[e]为第一后缀数组中下标e对应的数组元素,H[f]为第九数组中下标f对应的数组元素,H[f+1]为第九数组中下标f+1对应的数组元素。
- 一种安全的后缀索引外包计算装置,其特征在于,包括:数据获取模块,用于获取待构造后缀数组的初始字符串和扩充因子,其中,所述扩充因子用于表征所述初始字符串中初始字符的扩充位数,扩充因子为大于1的自然数;数据扩充模块,用于基于所述扩充因子扩充所述初始字符串,得到所述初始字符串的扩充数组;字符串生成模块,用于基于所述扩充数组,确定所述初始字符串的目标字符串,并将所述目标字符串上传至云服务器;后缀数组生成模块,用于获取所述云服务器生成的所述目标字符串的第一后缀数组,并基于所述第一后缀数组生成所述初始字符串的第二后缀数组。
- 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至17任一项所述的安全的后缀索引外包计算方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至17任一项所述的安全的后缀索引外包计算方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2020/103065 WO2022016327A1 (zh) | 2020-07-20 | 2020-07-20 | 一种安全的后缀索引外包计算方法及装置 |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2020/103065 WO2022016327A1 (zh) | 2020-07-20 | 2020-07-20 | 一种安全的后缀索引外包计算方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022016327A1 true WO2022016327A1 (zh) | 2022-01-27 |
Family
ID=79729617
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/103065 Ceased WO2022016327A1 (zh) | 2020-07-20 | 2020-07-20 | 一种安全的后缀索引外包计算方法及装置 |
Country Status (1)
| Country | Link |
|---|---|
| WO (1) | WO2022016327A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810228A (zh) * | 2012-11-01 | 2014-05-21 | 辉达公司 | 用于经采样的后缀数组的并行重建的系统、方法和产品 |
| US20140350917A1 (en) * | 2013-05-24 | 2014-11-27 | Xerox Corporation | Identifying repeat subsequences by left and right contexts |
| CN109284273A (zh) * | 2018-09-27 | 2019-01-29 | 中山大学 | 一种采用后缀数组索引的海量小文件查询方法及系统 |
| CN109299152A (zh) * | 2018-08-27 | 2019-02-01 | 中山大学 | 一种实时数据流的后缀数组索引方法及装置 |
-
2020
- 2020-07-20 WO PCT/CN2020/103065 patent/WO2022016327A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103810228A (zh) * | 2012-11-01 | 2014-05-21 | 辉达公司 | 用于经采样的后缀数组的并行重建的系统、方法和产品 |
| US20140350917A1 (en) * | 2013-05-24 | 2014-11-27 | Xerox Corporation | Identifying repeat subsequences by left and right contexts |
| CN109299152A (zh) * | 2018-08-27 | 2019-02-01 | 中山大学 | 一种实时数据流的后缀数组索引方法及装置 |
| CN109284273A (zh) * | 2018-09-27 | 2019-01-29 | 中山大学 | 一种采用后缀数组索引的海量小文件查询方法及系统 |
Non-Patent Citations (1)
| Title |
|---|
| GE NONG ; SEN ZHANG ; WAI HONG CHAN: "Linear Suffix Array Construction by Almost Pure Induced-Sorting", DATA COMPRESSION CONFERENCE, 2009. DCC '09., IEEE, PISCATAWAY, NJ, USA, 16 March 2009 (2009-03-16), Piscataway, NJ, USA , pages 193 - 202, XP031461101, ISBN: 978-1-4244-3753-5 * |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104008064B (zh) | 用于多级存储器压缩的方法和系统 | |
| CN113553300B (zh) | 文件的处理方法、装置、可读介质和电子设备 | |
| CN107704202A (zh) | 一种数据快速读写的方法和装置 | |
| CN111310890A (zh) | 深度学习模型的优化方法、装置及终端设备 | |
| EP3404538A1 (en) | Data processing method, and data processing apparatus | |
| CN107329916B (zh) | 一种usb设备控制方法、装置及计算设备 | |
| CN109359237A (zh) | 一种用于搜索寄宿程序的方法与设备 | |
| CN114661527A (zh) | 数据备份方法、装置、电子设备及存储介质 | |
| CN103365941A (zh) | 信息处理方法和系统 | |
| CN111914987A (zh) | 基于神经网络的数据处理方法及装置、设备和可读介质 | |
| CN109104481B (zh) | 文件完整性检测方法、文件完整性检测装置及终端设备 | |
| CN109284624A (zh) | 一种基于区块链存储的数据安全隔离方法及装置 | |
| CN108140039B (zh) | 流式传输来自并行批次的数据库访问的记录 | |
| CN113094384B (zh) | Sql文件配置方法、装置及终端设备 | |
| CN113194127B (zh) | 一种数据存储方法、数据传输方法及计算设备 | |
| WO2022016327A1 (zh) | 一种安全的后缀索引外包计算方法及装置 | |
| CN111858525B (zh) | 日志追踪方法、生成方法、追踪装置、生成装置及系统 | |
| CN112015459A (zh) | 一种镜像文件的升级方法、装置、终端及可读存储介质 | |
| CN118627094A (zh) | 一种数据处理方法及相关装置 | |
| CN118568098A (zh) | 一种动态分片索引方法及相关装置 | |
| CN113159267B (zh) | 一种图像数据处理方法、装置及终端设备 | |
| CN111556097B (zh) | 一种数据传输方法、采集站、采集终端及数据采集系统 | |
| CN117729136A (zh) | 日志请求的处理方法、装置、设备及存储介质 | |
| CN109558387B (zh) | 身份证号的处理方法、装置、存储介质及终端 | |
| CN105653534B (zh) | 一种数据处理方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20945815 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 19/05/2023) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20945815 Country of ref document: EP Kind code of ref document: A1 |