Data slicing method, device and system

Through the variable-length slicing method, the slice length is determined by using preset arrays and values, which solves the problem of low deduplication rate in the fixed-length slicing method when adding or deleting data streams, and achieves more efficient storage space utilization.

CN115470186BActive Publication Date: 2025-09-05CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210910741.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-29
Publication Date
2025-09-05
Estimated Expiration
2042-07-29

AI Technical Summary

Technical Problem

The existing fixed-length slicing method has a low deduplication rate when adding or deleting data streams, resulting in wasted storage space and increased costs.

Method used

The variable-length slicing method is adopted to slice the target data stream by obtaining the target character at the starting position of the slice of the target data stream, searching for the corresponding value from the preset array, determining the slice length according to the value, and slicing the target data stream.

Benefits of technology

It improves the data deduplication rate, reduces the impact of added and deleted characters on data slices, and optimizes storage space utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115470186B_ABST
    Figure CN115470186B_ABST
Patent Text Reader

Abstract

The present invention discloses a data slicing method, device, and system. The data slicing method includes obtaining a target data stream to be sliced; obtaining a target character at a slice start position from the target data stream, and searching for a numerical value corresponding to the target character from a preset array, wherein at least some characters in the preset array have different numerical values; and determining a slice length based on the numerical value corresponding to the target character, and slicing the target data stream starting from the slice start position according to the slice length. This method can improve the deduplication rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of performance testing, and in particular to a data slicing method, device and system. Background Art

[0002] With the maturity and widespread application of data backup technology, the amount of backup data has experienced explosive growth in recent years. Research shows that backup data in large enterprises is growing at a rate of 40% to 60% annually, with many companies doubling or even more their backup data size annually. This backup data often contains many identical data blocks, significantly increasing enterprise costs and wasting storage space.

[0003] Currently, data deduplication can be used to reduce storage capacity by removing duplicate data. Deduplication involves slicing (or dicing) data streams or files, performing hash calculations on each data block, and then identifying and deleting identical data blocks. This deduplication can compress duplicate data in storage systems, reducing storage capacity. This technology is currently widely used in backup systems.

[0004] Currently, some technologies use fixed-length slicing to slice data streams. Fixed-length slicing defines a fixed slice length (for example, 2 bytes per data block). The data stream is then divided into data blocks of equal length for storage based on the defined slice length. This slicing method does not provide a high deduplication rate for data streams in addition and deletion scenarios. For example, if data stream A only has one character added to the beginning of data stream B, slicing these two data streams using fixed-length slicing will result in significantly different data blocks, resulting in a low deduplication rate. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a data slicing method, a data slicing device, a data slicing system, and a computer-readable storage medium, which can improve the data deduplication rate.

[0006] In one aspect, the present invention provides a data slicing method, comprising:

[0007] Get the target data stream to be sliced;

[0008] Obtaining a target character at a starting position of a slice from the target data stream, and searching for a value corresponding to the target character from a preset array, wherein at least some characters in the preset array have different values; and

[0009] The slice length is determined according to the numerical value corresponding to the target character, and the target data stream is sliced ​​according to the slice length starting from the slice start position.

[0010] In some embodiments, searching a preset array for a numerical value corresponding to the target character includes:

[0011] searching for a character number of the target character from a preset character table, wherein the preset character table includes a correspondence between characters and character numbers, and different characters have different character numbers;

[0012] The character number of the target character is used as an index to search the preset array for a value corresponding to the target character.

[0013] In some embodiments, determining the slice length according to the numerical value corresponding to the target character includes:

[0014] Calculate the numerical value corresponding to the target character to obtain the corresponding intermediate value;

[0015] If the obtained intermediate value is less than the slice length threshold, the following operations are performed sequentially for the characters after the slice start position until the slice end position is determined, and the length between the slice end position and the slice start position is used as the slice length:

[0016] Searching for a numerical value corresponding to the character from the preset array;

[0017] Calculate the found values ​​to get the corresponding intermediate values;

[0018] If the obtained intermediate value is greater than or equal to the slice length threshold, the position of the character is determined as the end position of the slice.

[0019] In some embodiments, for any value found from the preset array, the corresponding intermediate value is determined based on the following method:

[0020] Performing an XOR operation on the value and the value of the preset variable to obtain a first intermediate value;

[0021] Subtracting a preset value from the first intermediate value to obtain a second intermediate value;

[0022] An XOR operation is performed on the first intermediate value and the second intermediate value to obtain a corresponding intermediate value.

[0023] In some embodiments, after each calculation to obtain the first intermediate value, the method further includes:

[0024] The value of the preset variable is updated to the first intermediate value, so that when the value of the preset variable is XORed with the value found from the preset array next time, the updated value of the preset variable is XORed with the value found from the preset array.

[0025] In some embodiments, after obtaining the target data stream to be sliced, the method further includes:

[0026] Record the position of the last character in the target data stream as the character end position;

[0027] For any character in the target data stream, when the intermediate value corresponding to the character is less than the slice length threshold, determine whether the position of the character is the end position of the character. If so, take the length between the end position of the character and the starting position of the slice as the slice length.

[0028] In some embodiments, after performing calculations on the numerical values ​​corresponding to the target characters to obtain corresponding intermediate values, the method further includes:

[0029] If the obtained intermediate value is greater than or equal to the slice length threshold, the target character is used as the data block to be cut, and the target data stream is sliced.

[0030] Another aspect of the present invention provides a data slicing device, comprising:

[0031] A data acquisition module is used to obtain the target data stream to be sliced;

[0032] a search module, configured to obtain a target character at a starting position of a slice from the target data stream, and search a preset array for a value corresponding to the target character, wherein at least some characters in the preset array have different values; and

[0033] The slicing module is used to determine a slice length according to a numerical value corresponding to the target character, and slice the target data stream according to the slice length starting from the slice starting position.

[0034] Another aspect of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0035] On the other hand, the present invention further provides a data slicing system, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.

[0036] In some embodiments of the present application, the target data stream is sliced ​​by obtaining a target character at the starting position of a slice from the target data stream, searching a preset array for the value corresponding to the target character, and then determining the slice length based on the value corresponding to the target character. In this way, the target data stream can be sliced ​​with variable lengths, thereby reducing the impact of added or deleted characters on the data slices in scenarios such as data addition and deletion, effectively improving the deduplication rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:

[0038] Figure 1 Schematic diagram showing data slicing in some technologies;

[0039] Figure 2 A schematic diagram of a data slicing method according to an embodiment of the present invention is shown;

[0040] Figure 3 A schematic diagram of a target data stream provided by an embodiment of the present application is shown;

[0041] Figure 4 A schematic diagram showing a data slice provided by an embodiment of the present application is shown;

[0042] Figure 5 A flowchart of data slicing provided by one embodiment of the present application is shown;

[0043] Figure 6 A flowchart of data slicing provided by another embodiment of the present application is shown;

[0044] Figure 7 A flowchart of data slicing provided by another embodiment of the present application is shown;

[0045] Figure 8 A schematic diagram of a module of a data slicing device provided by an embodiment of the present application is shown;

[0046] Figure 9 A schematic diagram of a data slicing system provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0047] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts shall fall within the scope of protection of the present invention.

[0048] See Figure 1 , which is a schematic diagram of data slicing in some technologies. Figure 1 In the example, data stream B has new characters in the gray box compared to data stream A. When slicing data stream B and data stream A using fixed-length slicing (three characters per data block), the newly added characters in data stream B result in fewer identical data blocks in the data blocks created. The storage system needs to allocate storage space separately for data streams A and B. Although data stream B and data stream A share many identical characters, the deduplication rate is low, and compressed storage space is not utilized.

[0049] To this end, this application provides a data slicing method that can improve the deduplication rate. The data slicing method provided in this application can be applied to electronic devices. Electronic devices include but are not limited to tablet computers, desktop computers, laptop computers, and servers. Figure 2 , is a flow chart of a data slicing method provided in one embodiment of the present application. The data slicing method includes steps S21 to S23.

[0050] Step S21: Obtain the target data stream to be sliced.

[0051] In some embodiments, the target data stream includes content to be stored in a storage system, such as a file data stream or a video image data stream.

[0052] Step S22: obtaining a target character at the starting position of the slice from the target data stream, and searching for a numerical value corresponding to the target character from a preset array, wherein the numerical values ​​corresponding to at least some characters in the preset array are different.

[0053] In some embodiments, the slicing start position refers to the starting position when slicing the target data stream. For a target data stream that has not yet started slicing, the slicing start position may be the position of the first character of the target data stream. For a target data stream that has already started slicing, the slicing start position may be the position of the first character in the target data stream that has not yet been sliced ​​after the last slicing. For ease of understanding, please refer to Figure 3 , which is a schematic diagram of a target data flow provided for an embodiment of the present application. Figure 3 In the example, the first character on the left is the starting position of the target data stream, and the last character on the right is the ending position of the target data stream. Before slicing the target data stream, the starting position of slicing can be the position of the first character on the left. After slicing the target data stream, for example, the last slice was cut from the dotted line, then the starting position of the next slice can be the position of the first character after the dotted line (i.e., character o).

[0054] In some embodiments, the preset array can be a random array generated in a random manner. Considering that in a computer, a character is represented by 8 bits (8 bits). 8 bits can represent 256 different characters, therefore, the preset array can include 256 numerical values. Each numerical value corresponds to one of the above 256 characters. That is, for each character in the target data stream, a corresponding numerical value can be found in the preset array. For example, character A corresponds to the numerical value 20 in the preset array, and character B corresponds to the numerical value 15 in the preset array.

[0055] In some embodiments, after randomly generating a preset array, the preset array can be saved. For characters in different target data streams, the corresponding values ​​of the characters can be searched in the same preset array. That is, only one preset array can be generated, eliminating the need to generate separate preset arrays for different target data streams.

[0056] In some embodiments, when searching for a numerical value corresponding to a target character from a preset array, the character number of the target character can be searched from a preset character table, wherein the preset character table includes a correspondence between characters and character numbers, and different characters have different character numbers. The character number of the target character can then be used as an index to search for a numerical value corresponding to the target character from the preset array.

[0057] The preset character table may be an ASCII code table. The character number may be the ASCII code of the character in the ASCII code table. Of course, it is understood that as long as there is a correspondence between characters and character numbers in the character table, it does not necessarily have to be an ASCII code table. For example, the character table may be pre-created by a technician. In the character table, the technician may assign a character number different from the ASCII code to each character.

[0058] In some embodiments, after finding the character number of the target character in the character table, the character number can be used as the position information of the numerical value to search for the numerical value corresponding to the target character in the preset array. For example, assuming the character number is 20, the 20th numerical value in the preset array is used as the numerical value corresponding to the target character.

[0059] Step S23: determining the slice length according to the numerical value corresponding to the target character, and slicing the target data stream starting from the slice start position according to the slice length.

[0060] In some embodiments, the numerical value corresponding to the target character can be directly used as the slice length, that is, starting from the starting position of the slice, the target data stream is sliced ​​according to the length defined by the numerical value corresponding to the target character. Specifically, the numerical value corresponding to the target character can be used as the number of characters to be sliced. Figure 3 For example, suppose Figure 3 The target character in is the first character i on the left, and the value corresponding to the target character is 5. Then, starting from the target character i, a data block consisting of 5 characters (i.e., itwea) can be cut out from the target data stream. Of course, the value corresponding to the target character can also be used as the number of bits to be sliced. For example, still assuming Figure 3 The target character in is the first character i on the left, and the value corresponding to the target character is 56. Then, starting from the target character i, a data block including 7 characters (i.e., itweasc) can be cut out from the target data stream.

[0061] In some embodiments, since the values ​​corresponding to at least some characters in the preset array are different, and under normal circumstances, the characters in the target data stream are not completely the same, the lengths of the cut data blocks should also be different. That is, when slicing the target data stream, a variable length slicing method is used. Since it is a variable length slicing, it is possible to solve Figure 1 See also Figure 4 , providing a schematic diagram of data slicing for an embodiment of the present application. Figure 4 The data stream B in the example is similar to the data stream A. The characters in the gray box are the characters newly added to the data stream B relative to the data stream A. Since the present application is a variable length slice, it is possible to cut the newly added characters in the data stream B into a data block for the data stream A and the data stream B. For example, assuming that the corresponding values ​​of the characters i, a, and o in the preset array are all 3, the corresponding value of the character e in the preset array is 1, and the corresponding value of the character 0 in the preset array is 2, then according to the method of the present application, the data stream A and the data stream B can be cut into Figure 4 The data block shown in . Figure 4 As can be seen, data stream A and data stream B both include the data blocks itw, asc, old, ayi, and. Therefore, when storing data, only one of these blocks can be saved. This achieves the goal of compressing storage space and improving the deduplication rate.

[0062] Further, considering that in some scenarios, the lengths of different target data streams may differ greatly, such as some target data streams include more characters, and some target data streams include less characters. If the numerical value corresponding to the target character is larger, it is more suitable when slicing a target data stream with a longer length, but for a target data stream with a shorter length, there may be a problem of not being able to slice it. For example, assuming that the target data stream includes 5 characters, but the numerical value corresponding to the target character is 10 (representing 10 characters). In this case, the target data stream with a shorter length may not be sliced. On the contrary, if the numerical value corresponding to the target character is smaller, in this case, although the target data stream with a shorter length can be sliced, for a target data stream with a longer length, there may be a problem of too many or too small data blocks of cutting. In view of the above description, in some embodiments of the present application, the slice length can be determined based on the following method.

[0063] Specifically, the numerical value corresponding to the target character can be calculated to obtain the corresponding intermediate value. If the intermediate value is less than the slice length threshold, the following operations are performed on the characters after the slice start position until the slice end position is determined, and the length between the slice end position and the slice start position is used as the slice length:

[0064] Find the value corresponding to the character from the preset array;

[0065] Calculate the found values ​​to get the corresponding intermediate values;

[0066] If the obtained middle value is greater than or equal to the slice length threshold, the position of the character is determined as the end position of the slice.

[0067] In some embodiments, for any value found from a preset array, the corresponding intermediate value may be determined based on the following method:

[0068] Performing an XOR operation on the value and the value of the preset variable to obtain a first intermediate value;

[0069] Subtracting a preset value from the first intermediate value to obtain a second intermediate value;

[0070] Perform an XOR operation on the first intermediate value and the second intermediate value to obtain a corresponding intermediate value.

[0071] In some embodiments, after each calculation to obtain the first intermediate value, the value of the preset variable can also be updated to the first intermediate value, so that when the value of the preset variable is XORed with the value found from the preset array next time, the XOR operation is performed based on the value of the updated preset variable and the value found from the preset array.

[0072] In some embodiments, after obtaining the target data stream to be sliced, the position of the last character in the target data stream may be recorded as the character end position. For any character in the target data stream, if the median value corresponding to the character is less than the slice length threshold, a determination is made as to whether the character position is the character end position. If so, the length between the character end position and the slice start position is used as the slice length.

[0073] In some embodiments, after calculating the numerical value corresponding to the target character and obtaining the corresponding intermediate value, if the intermediate value is greater than or equal to the slice length threshold, the target character can be used as the data block to be cut and the target data stream can be sliced.

[0074] For easier understanding, please refer to Figure 5 , which is a flowchart of data slicing provided for one embodiment of the present application. Figure 5 , the first character on the left is the target character i. Assume that the preset variable is x, and the initial value of the preset variable x is one of the values ​​in the preset array, or the initial value of the preset variable x is a randomly generated or specified value, the slice length threshold is slen, the position of the last character in the target data stream is max, the value corresponding to character i is i', the value corresponding to character t is t', the value corresponding to character w is w', the value corresponding to character e is e', the position of character i is id, the position of character t is td, the position of character w is wd, and the position of character e is ed.

[0075] First, the numerical value corresponding to the character i is calculated.

[0076] 1) The value corresponding to i can be XORed with the value of the preset variable x to obtain the first intermediate value corresponding to character i. In this embodiment, the value of the preset variable x is divided by 2, and the value obtained after the division is XORed with the value corresponding to i to obtain the first intermediate value, and the value of the preset variable x is updated to the first intermediate value. This process corresponds to Figure 5 In step 1, x=x>>1)^i'.

[0077] 2) The first intermediate value corresponding to character i can be subtracted from the preset value to obtain the second intermediate value. In this embodiment, the first intermediate value corresponding to character i is subtracted from 1 to obtain the second intermediate value corresponding to character i. Then, the first intermediate value and the second intermediate value are XORed to obtain the intermediate value corresponding to character i, and it is determined that the intermediate value is less than the slice length threshold slen. This process corresponds to Figure 5 x^(x-1) in step 1 <slen。

[0078] 3) Determine that the position of character i is not the position max of the last character of the target data stream. This process corresponds to Figure 5id in step 1!=max.

[0079] Furthermore, the numerical value corresponding to the character t is operated.

[0080] 1) The value corresponding to t can be XORed with the updated value of the preset variable x to obtain the first intermediate value corresponding to the character t. This process corresponds to Figure 5 In step 2, x=x>>1)^t'.

[0081] 2) The first intermediate value corresponding to character i can be subtracted from the preset value to obtain the second intermediate value. Then the first intermediate value and the second intermediate value are XORed to obtain the intermediate value corresponding to character t, and the intermediate value is determined to be less than the slice length threshold slen. This process corresponds to Figure 5 x^(x-1) in step 2 <slen。

[0082] 3) Determine that the position of character t is not the position max of the last character of the target data stream. This process corresponds to Figure 5 td in step 2!=max.

[0083] Furthermore, the numerical value corresponding to the character w is operated.

[0084] 1) The value corresponding to w can be XORed with the updated value of the preset variable x to obtain the first intermediate value corresponding to the character w. This process corresponds to Figure 5 In step 3, x=x>>1)^w'.

[0085] 2) The first intermediate value corresponding to the character w can be subtracted from the preset value to obtain the second intermediate value. Then the first intermediate value and the second intermediate value are XORed to obtain the intermediate value corresponding to the character w, and the intermediate value is determined to be less than the slice length threshold slen. This process corresponds to Figure 5 x^(x-1) in step 3 <slen。

[0086] 3) Determine that the position of character w is not the position max of the last character of the target data stream. This process corresponds to Figure 5 wd!=max in step 3.

[0087] Furthermore, the numerical value corresponding to the character e is operated.

[0088] 1) The value corresponding to e can be XORed with the updated value of the preset variable x to obtain the first intermediate value corresponding to the character e. This process corresponds to Figure 5 In step 4, x=x>>1)^e'.

[0089] 2) The first intermediate value corresponding to the character e can be subtracted from the preset value to obtain the second intermediate value. Then the first intermediate value and the second intermediate value are XORed to obtain the intermediate value corresponding to the character e, and the intermediate value is determined to be greater than the slice length threshold slen. This process corresponds to Figure 5 In step 4, x^(x-1)>slen.

[0090] 3) Determine that the position of character e is not the position max of the last character of the target data stream. This process corresponds to Figure 5 In step 4, ed!=max.

[0091] After the numerical value of the character e is calculated, since the intermediate value obtained is greater than the slice length threshold slen, the position of the character e determines the end position of the slice, and then the length between the character e and the character i (including the character e and the character i) is used as the slice length to slice the target data stream. Here, since the slice length should be 4 (indicating 4 characters). In this way, itwe can be used as a data block to slice the target data stream. Then the position of the character a after the character e can be used as the starting position of the slice, and the character a can be used as the target character, and the above steps can be performed to continue slicing the target data stream.

[0092] Continue reading Figure 6 , a flowchart of data slicing provided as another embodiment of the present application. Figure 6 In the example, after calculating the numerical value corresponding to the target character i, the intermediate value obtained is greater than the slice length threshold slen. At this time, the target character i is treated as a data block and the target data stream is sliced.

[0093] Continue reading Figure 7 , a flowchart of data slicing provided as another embodiment of the present application. Figure 7 In the example, assume that the value corresponding to character d is d' and the position of character d is dd. Figure 7 It can be seen that, assuming that the target data stream is sliced ​​starting from character c, according to Figure 5 After a similar process reaches the position of character d, the numerical value corresponding to character d is calculated, and the intermediate value obtained is less than the segment length threshold slen. However, the position of character d is the position max of the last character of the target data stream. In this case, the position of character d can be regarded as the end position of the character, and the character cold can be used as a data block to cut the target data stream.

[0094] In some embodiments of the present application, the target data stream is sliced ​​by obtaining a target character at the starting position of a slice from the target data stream, searching a preset array for the value corresponding to the target character, and then determining the slice length based on the value corresponding to the target character. In this way, the target data stream can be sliced ​​with variable lengths, thereby reducing the impact of added or deleted characters on the data slices in scenarios such as data addition and deletion, effectively improving the deduplication rate.

[0095] See also Figure 8 , is a module diagram of a data slicing device provided in one embodiment of the present application. The data slicing device includes:

[0096] A data acquisition module is used to obtain the target data stream to be sliced;

[0097] a search module, configured to obtain a target character at a starting position of a slice from a target data stream, and search for a value corresponding to the target character from a preset array, wherein the values ​​corresponding to at least some characters in the preset array are different; and

[0098] The slicing module is used to determine the slice length according to the numerical value corresponding to the target character, and slice the target data stream according to the slice length starting from the slice starting position.

[0099] See also Figure 9 , is a schematic diagram of a data slicing system provided in one embodiment of the present application. The data slicing system includes a processor and a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the above-mentioned data slicing method is implemented.

[0100] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0101] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods described in the embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing, thereby implementing the methods described in the aforementioned method embodiments.

[0102] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0103] One embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, the above-mentioned data slicing method is implemented.

[0104] Although the embodiments of the present invention have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention. Such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A data slicing method, characterized in that: The method comprises: Get the target data stream to be sliced; Obtaining a target character at a starting position of a slice from the target data stream, and searching for a value corresponding to the target character from a preset array, wherein at least some characters in the preset array have different values; and The slice length is determined according to the numerical value corresponding to the target character, and the target data stream is sliced ​​according to the slice length starting from the slice start position.

2. The method according to claim 1, wherein The step of searching a preset array for a value corresponding to the target character includes: searching for a character number of the target character from a preset character table, wherein the preset character table includes a correspondence between characters and character numbers, and different characters have different character numbers; The character number of the target character is used as an index to search the preset array for a value corresponding to the target character.

3. The method according to claim 1, wherein The determining of the slice length according to the numerical value corresponding to the target character includes: Calculate the numerical value corresponding to the target character to obtain the corresponding intermediate value; If the obtained intermediate value is less than the slice length threshold, the following operations are performed in sequence for the characters after the slice start position until the slice end position is determined, and the length between the slice end position and the slice start position is used as the slice length: Searching for a numerical value corresponding to the character from the preset array; Calculate the found values ​​to get the corresponding intermediate values; If the obtained intermediate value is greater than or equal to the slice length threshold, the position of the character is determined as the end position of the slice.

4. The method according to claim 3, wherein For any value found in the preset array, the corresponding intermediate value is determined based on the following method: Performing an XOR operation on the value and the value of the preset variable to obtain a first intermediate value; Subtracting a preset value from the first intermediate value to obtain a second intermediate value; An XOR operation is performed on the first intermediate value and the second intermediate value to obtain a corresponding intermediate value.

5. The method according to claim 4, wherein After obtaining the first intermediate value through calculation each time, the method further includes: The value of the preset variable is updated to the first intermediate value, so that when the value of the preset variable is XORed with the value found from the preset array next time, the updated value of the preset variable is XORed with the value found from the preset array.

6. The method according to claim 3, wherein After obtaining the target data stream to be sliced, the method further includes: Record the position of the last character in the target data stream as the character end position; For any character in the target data stream, when the intermediate value corresponding to the character is less than the slice length threshold, determine whether the position of the character is the character end position. If so, take the length between the character end position and the slice start position as the slice length.

7. The method according to claim 3, wherein After performing calculations on the numerical values ​​corresponding to the target characters to obtain corresponding intermediate values, the method further includes: If the obtained intermediate value is greater than or equal to the slice length threshold, the target character is used as the data block to be cut, and the target data stream is sliced.

8. A data slicing device, characterized in that: The device comprises: A data acquisition module is used to obtain the target data stream to be sliced; a search module, configured to obtain a target character at a starting position of a slice from the target data stream, and search a value corresponding to the target character from a preset array, wherein the values ​​corresponding to at least some characters in the preset array are different; and The slicing module is used to determine a slice length according to a numerical value corresponding to the target character, and slice the target data stream according to the slice length starting from the slice starting position.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A data slicing system, characterized in that: The data slicing system includes a processor and a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for recognizing repeat data in computer storage

    CN101158954A

  • Partitioning method and device thereof

    CN111722787A