Character string filter device and operating method thereof
By designing a high-speed string filter device for parallel operation, the problem of low string filtering efficiency in the prior art is solved, efficient parallel filtering is realized, energy consumption is reduced and performance is improved.
Patent Information
- Application Number
- CN202411167490.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-08-25
- Filing Date
- 2024-08-23
- Publication Date
- 2025-02-25
AI Technical Summary
The prior art is less efficient when performing string filtering operations, especially when processing large amounts of data, resulting in performance bottlenecks and increased energy consumption.
A high-speed string filter device is designed to operate in parallel, including an input buffer group, a string comparator group, a synchronizer and a result processor. The device improves filtering efficiency by comparing multiple substring group data segments with query data in parallel.
High-speed parallel string filtering is implemented, reducing the energy consumption generated by data transmission and improving system performance.
Smart Images

Figure CN119513370A_ABST
Abstract
Description
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Korean Patent Application No. 10-2023-0111997, filed on August 25, 2023, the disclosure of which is incorporated herein by reference in its entirety. Technical Field
[0003] Embodiments of the present disclosure generally relate to an electronic device, and more particularly, to a string filter device and an operating method thereof. Background Art
[0004] A storage device is a device that stores data under the control of a host such as a computer or a smart phone. The storage device may include a memory device for storing data and a memory controller for controlling the memory device. The memory device is classified into a volatile memory device and a non-volatile memory device.
[0005] The dedicated computing unit on the storage device side replaces the CPU on the host side to perform the calculations on the host side's central processing unit (CPU), thereby reducing the burden on the host side's CPU. The storage device side only transmits the filtering result value to the CPU on the host side, thereby reducing the energy consumption generated by data transmission between the two sides and improving performance.
[0006] The filtering operation is the operation of extracting only the data with the required conditions from the database. The string filter can extract the data that is consistent with or contains the query data. Summary of the invention
[0007] Embodiments of the present disclosure provide a high-speed string filter device and an operating method thereof through parallel operation.
[0008] According to an embodiment of the present disclosure, a string filter device is provided, comprising: an input buffer group configured to store a plurality of string group data segments, each of the plurality of string group data segments having a first size and comprising a plurality of string data segments having a variable size; and a string comparator group configured to extract a plurality of different substring group data segments having a second size from the plurality of string group data segments, and compare each of the plurality of substring group data segments with a query data segment in parallel using a plurality of string comparators.
[0009] According to another embodiment of the present disclosure, a string filter device is provided, comprising: a data buffer group configured to receive and store a plurality of string group data segments having a fixed size to be synchronized with a reference cycle, each of the plurality of string group data segments comprising a plurality of string data segments having a variable size; an offset buffer group configured to receive and store a plurality of offset data segments indicating a starting position of each of the plurality of string data segments to be synchronized with the reference cycle; a validity buffer group configured to receive and store a plurality of validity data segments indicating the validity of each of the plurality of offset data segments to be synchronized with the reference cycle; and a synchronizer configured to adjust data processing synchronization between the data segment buffer group and the offset buffer group based on a comparison result of the number of string data segments remaining when a target data segment is extracted from the data segment buffer group within a first cycle of the reference cycle and the number of offset data segments remaining when the target data segment is extracted from the offset buffer group.
[0010] According to another embodiment of the present disclosure, a method for operating a string filter device is provided, the method comprising: receiving a plurality of string group data segments to be synchronized with a reference cycle, each of the plurality of string group data segments having a first size and including a plurality of string data segments having a variable size; extracting a plurality of substring group data segments having a second size from the string group data corresponding to a plurality of cycles of the reference cycle; comparing each of the plurality of substring group data segments with query data in parallel and outputting each comparison result; and extracting target data corresponding to the query data in the comparison result based on offset data indicating a starting position of each string data and validity data indicating validity of the offset data.
[0011] These and other features and advantages of the present invention will become apparent from the detailed description of the embodiments of the present disclosure and the following drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Various embodiments of the present disclosure will now be described more fully below with reference to the accompanying drawings; however, the various embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure thorough and complete and to fully convey the scope of the embodiments to those skilled in the art.
[0013] In the accompanying drawings, dimensions may be exaggerated for clarity of illustration. It should be understood that when an element is referred to as being "between" two elements, it may be the only element between the two elements, or one or more intermediate elements may also be present. The same reference numerals always refer to the same elements.
[0014] Figure 1is a diagram illustrating a character string filter device according to an embodiment of the present disclosure.
[0015] Figure 2 is a diagram illustrating string group data including a plurality of string data segments and a plurality of substring group data segments according to an embodiment of the present disclosure and illustrating a parallel comparison operation of the plurality of substring group data segments with query data.
[0016] Figure 3 is a diagram illustrating a structure of an input buffer group according to an embodiment of the present disclosure.
[0017] Figure 4A is a diagram illustrating offset data, modified offset data, validity data, and string data size according to an embodiment of the present disclosure.
[0018] Figure 4B is a diagram illustrating offset data, modified offset data, validity data, and string data size according to an embodiment of the present disclosure.
[0019] Figure 4C is a diagram illustrating modified offset data, range validity data, and modified validity data according to an embodiment of the present disclosure.
[0020] Figure 5 is a diagram illustrating data processing synchronization control of a data buffer and an offset buffer according to the number of character string data segments remaining after processing and the number of offset data remaining after processing in the same cycle according to an embodiment of the present disclosure.
[0021] Figure 6 It is shown Figure 2 A diagram of the operation of a string comparator included in a string comparator group is shown.
[0022] Figure 7 It is shown Figure 1 A diagram of the operation of the result processor is shown.
[0023] Figure 8 is a flowchart illustrating the operation of a string filter device according to an embodiment of the present disclosure.
[0024] Fig. 9 is a flowchart illustrating the operation of a string filter device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] For the purpose of describing the embodiments according to the concept of the present disclosure, the specific structural or functional description disclosed herein is merely illustrative. The embodiments according to the concept of the present disclosure can be implemented in various forms and should not be interpreted as being limited to the embodiments set forth herein.
[0026] Figure 1 is a diagram illustrating a character string filter device 50 according to an embodiment of the present disclosure.
[0027] Reference Figure 1 , the string filter device 50 may include an input buffer group 100 , a string comparator group 200 , a synchronizer 300 , and a result processor 400 .
[0028] The input buffer group 100 may include a data buffer group 110 , an offset buffer group 120 , and a validity buffer group 130 .
[0029] The data buffer group 110 may receive and store string group data including a plurality of string data segments having variable sizes. The string group data may have a first size determined based on a bandwidth of a channel receiving the string group data.
[0030] The offset buffer group 120 may receive and store offset data indicating a start position of character string data.
[0031] The validity buffer group 130 may receive and store validity data indicating the validity of the offset data.
[0032] The string comparator group 200 may extract a plurality of different substring group data segments having a second size from the string group data of at least two cycles stored in the data buffer group 110. The second size may be determined based on a maximum size of query data that the string comparator group 200 may process.
[0033] Specifically, the string comparator group 200 may extract a plurality of substring group data segments from a portion of the string group data of a first cycle and a second cycle among at least two cycles, such that each character is shifted sequentially.
[0034] The string comparator group 200 can compare each of the plurality of substring group data segments with the query data in parallel and output a comparison result. The query data can be data that meets the filtering condition.
[0035] The string comparator group 200 may include a plurality of string comparators (not shown). The plurality of string comparators may receive a plurality of substring group data segments input in parallel, and output a comparison result of the input substring group data segments and the query data. The comparison result may indicate whether the query data is included in the substring group data segment. The synchronizer 300 may adjust the synchronization (sync) between the data buffer group 110 and the offset buffer group 120 through a synchronization control signal based on a comparison result of the number of string data segments remaining after processing in the data buffer group 110 and the number of offset data segments remaining after processing in the offset buffer group 120 in the same cycle. The reason why the synchronizer 300 adjusts the synchronization between the data buffer group 110 and the offset buffer group 120 is that the number of data segments input in the same cycle may be different from each other because the string data input to the data buffer group 110 has a variable size, while the offset data input to the offset buffer group 120 has a fixed size.
[0036] The synchronizer 300 can update at least one of the data buffer group 110 and the offset buffer group 120 based on the comparison result of the number of string data segments remaining after processing in the same cycle and the number of offset data segments remaining after processing, thereby adjusting the data processing synchronization between the two groups. The updated at least one buffer group can process the input data of the next cycle.
[0037] The synchronizer 300 may generate modified offset data based on the offset data and the first size of the string group data. The synchronizer 300 may generate modified validity data based on the validity data and range validity data indicating a range of offset data to be processed in the current cycle.
[0038] The result processor 400 may extract target data matching the query data based on the comparison result received from the string comparator group 200 and the modified offset data and the modified validity data received from the synchronizer 300 .
[0039] The result processor 400 can extract the target data that is consistent with the query data or includes the query data according to the operation mode based on the comparison result of the string data size and the query data size. The operation mode can include a complete mode and a start mode. The complete mode can be a mode for filtering data that is consistent with the query data, and the start mode can be a mode for filtering data starting from the query data.
[0040] Figure 2 is a diagram illustrating string group data including a plurality of string data segments and a plurality of substring group data segments according to an embodiment of the present disclosure and illustrating a parallel comparison operation of the plurality of substring group data segments with query data.
[0041] Reference Figure 2 , the data buffer may receive and store string group data having a first size in each cycle. The first size may be determined based on the bandwidth of a channel receiving the string group data. Figure 2 The first size is 16 bytes, but can be set to another value.
[0042] The size of the string group data is fixed to the first size, but the string group data of each cycle may include multiple string data segments having variable sizes. Therefore, the number of string data segments included in the string group data of each cycle and the size of each string data segment may vary.
[0043] For example, the string group data of the first cycle is "dogelephanthuman", and may include three string data segments "dog", "elephant" and "human". The sizes of the three string data segments may be 3 bytes, 8 bytes and 5 bytes. The size of each string data segment may also be calculated as the difference of the corresponding offset data. The string group data of the third cycle is "ogcatdogcatlionh", and may include four string data of "cat", "dog", "cat" and "lion". The sizes of the four string data segments may be 3 bytes, 3 bytes, 3 bytes and 4 bytes.
[0044] The offset buffer may receive and store a plurality of offset data segments for each cycle. The first offset data may indicate 1 because "d" is the starting position of the first string data "dog". The second offset data may indicate 4 because "e" is the starting position of the second string data "elephant". The third offset data may indicate 12 because "h" is the starting position of the third string data "human".
[0045] Multiple offset data segments may correspond to the first size. This is because the bandwidth of the channel through which the offset buffer and the data buffer receive data is the same. One offset data may have a predetermined size. Figure 2 In the embodiment, the size of the offset data can be fixed to 4 bytes. Therefore, since the size of the data input in one cycle is 16 bytes, four offset data segments can be input to the offset buffer per cycle.
[0046] Since the string data has a variable size, the number of string data segments input in each cycle may be different. On the other hand, since the offset data has a fixed size, the number of offset data segments input in each cycle can be the same.
[0047] Therefore, the offset data is data indicating the starting position of the string data and has a one-to-one correspondence. However, the number of string data segments input per cycle and the number of offset data segments input per cycle are different from each other, and the problem of incorrect data processing synchronization between the data buffer and the offset buffer may occur. In order to solve this problem, the time to update the data buffer and the offset buffer is used, which will be Figure 5 Described later in.
[0048] The string comparator group may include a plurality of string comparators. The number of string comparators included in the string comparator group may be determined based on the size of the string group data input in one cycle. For example, when 16 bytes of string group data are input in one cycle, the size of the string data is at least 1 byte and at most 16 bytes. Therefore, in order to handle the situation where 16 string data segments are input in one cycle and each string data segment has 1 byte, the string comparator group includes 16 string comparators.
[0049] A plurality of substring group data segments may be extracted from the string group data of the first cycle and a portion of the string group data of the second cycle. The substring group data may have a second size, and the second size may be a maximum query size that the string comparator may process. Figure 2 , it is described that the second size is 8 bytes.
[0050] The reason why the string group data of the second cycle is also included in the range of extracting multiple substring group data segments is that when the query size processed by the string comparator is 2 bytes or larger, the range of the substring group data processed by the string comparator group exceeds the range of the string group data of the current cycle.
[0051] exist Figure 2 , 16 substring group data segments can be extracted from the string group data of the first cycle (16 bytes) and the string group data of the second cycle (7 bytes). The first substring group data segment can be "dogeleph". The second substring group data segment can be "ogelepha". The third substring group data segment can be "gelephan". In this way, the sixteenth substring group data segment can be "ncatlion". As described above, the first to sixteenth substring group data segments can be extracted in a direction where each character is shifted to the right in sequence. According to another embodiment, the first to sixteenth substring group data segments can be extracted in a direction where each character is shifted to the left in sequence.
[0052] The sixteen string comparators included in the string comparator group may compare the substring group data input thereto with the query data "dog" in sequence starting from the first character. When the query data is compared with the substring group data, the first character "dog" of the first substring group data segment is consistent with the query data "dog". Therefore, only the first string comparator may output a specific logic value (e.g., 1) as a comparison result, and the second to sixteenth string comparators may output specific logic values (e.g., 0) as comparison results.
[0053] Figure 3 is a diagram showing a structure of an input buffer group 100 according to an embodiment of the present disclosure.
[0054] Reference Figure 1 and Figure 3 , the input buffer group 100 may include a data buffer group 110 , an offset buffer group 120 , and a validity buffer group 130 .
[0055] The data buffer group 110 may include a first data buffer 111 and a second data buffer 112. The offset buffer group 120 may include a first offset buffer 121 and a second offset buffer 122. The validity buffer group 130 may include a first validity buffer 131 and a second validity buffer 132.
[0056] As above Figure 2 As described above, when the query size processed by the string comparator is 2 bytes or larger, the range of the substring group data processed by the string comparator group exceeds the range of the string group data of the current cycle, so it is necessary to use a part of the string group data of the next cycle for target data extraction.
[0057] Therefore, the character string group data of the first cycle and a part of the character string group data of the second cycle stored in the first data buffer 111 can be stored in the second data buffer 112 to be used for target data extraction of the same cycle.
[0058] exist Figure 2 In the embodiment, the maximum query size supported by the string comparator (hardware architecture) is 8 bytes, and the second data buffer 112 can process the string group data segment of the current cycle (i.e., 16 bytes) and a part of the string group data segment of the next cycle (i.e., 7 bytes) as one string group data and store the one string group data.
[0059] The offset data is data indicating the starting position of the string data and has a one-to-one correspondence. Therefore, the offset data can also be processed in the same way. Therefore, a part of the multiple offset data segments of the first cycle and the multiple offset data segments of the second cycle stored in the first offset buffer 121 can be stored in the second offset buffer 122 for target data extraction of the same cycle.
[0060] The second offset buffer 122 can process multiple offset data segments of the current cycle (i.e., 4 offset data segments (16 bytes)) and one or more offset data segments of the next cycle (i.e., one offset data segment (4 bytes)) as one offset data group and store the one offset data group. The size of the offset data segment can be fixed to 4 bytes.
[0061] The validity data is data indicating the validity of the offset data segment and has a one-to-one correspondence. However, although the size of one offset data segment is fixed to 4 bytes, the size of the validity data may be 1 bit, which indicates validity / invalidity.
[0062] Therefore, although the validity data and offset data input in one cycle are exactly the same, the size of the validity data is smaller than the size of the offset data segment, so the validity data input in one cycle and the offset data input in several cycles can have a corresponding relationship.
[0063] For example, when four offset data segments are input in one cycle, 4 bits of validity data are required. Figure 2 As shown, 4 bytes of validity data are input in one cycle, so the validity data is 4×8=32 bits of validity data. Therefore, 4 bytes can be used as the validity data input in the first cycle until 32 offset data segments corresponding to a total of 8 cycles are input.
[0064] The second validity buffer 132 may divide the 4-byte validity data received from the first validity buffer 131 into 4-bit units so as to match the offset data segments of the same cycle one by one, thereby storing the divided validity data.
[0065] Figure 4A is a diagram illustrating offset data, modified offset data, validity data, and string data size according to an embodiment of the present disclosure.
[0066] Reference Figure 4A , each offset data segment is data indicating the starting position of the character string data.
[0067] exist Figure 4AIn the example, the four offset data segments input in the current cycle may be "1, 4, 12, and 17", and the one offset data input segment in the next cycle may be "20".
[0068] The modified offset data segment may have a value obtained by performing a modulus or modulo (MOD) operation on the offset data segment using the number of characters input in one cycle, for example, 16 mod x (=1, 4, 12, 17, and 20). Therefore, even if the value of the offset data segment increases as the cycle increases, each modified offset data segment may indicate a position within the range of the number of characters input in one cycle. The modified offset data segment may be "1, 4, 12, 1, and 4".
[0069] The validity data may be data indicating the validity of the offset data. When the current offset data is greater than the previous offset data, this indicates that the starting position of the string data is modified. Since this indicates that the string data exists, the validity data may indicate "1". The validity data may be "1, 1, 1, and 1".
[0070] The string data size may be a value obtained by subtracting the current offset data (i.e., the offset data segment of the current cycle) from the next offset data (i.e., the offset data segment of the next cycle). That is, the string data size may be calculated using the difference between the starting position values of the string data. The string data size may be "3, 8, 5, and 3". When the offset data is Figure 2 When the offset data is shown, the character string data size corresponds to the size of "dog", "elephant", "human", "cat", etc. as described above.
[0071] Figure 4B is a diagram illustrating offset data, modified offset data, validity data, and string data size according to an embodiment of the present disclosure.
[0072] Reference Figure 4B ,and Figure 4A The offset data entered in is different. Figure 4B The offset data is described as "1, 3, 3, 13, and 20". The modified offset data may be "1, 3, 3, 13, and 4". The validity data may be "1, 0, 1, and 1". The string data size may be "2, 0, 10, and 7".
[0073] and Figure 4A By contrast, when the current offset data is equal to the previous offset data, this indicates that the starting position of the string data has not been modified. Since this indicates that the string data does not exist, the validity data may indicate "0". In addition, for the same reason, since the string data does not exist, the string data may also indicate "0".
[0074] Figure 4C is a diagram illustrating modified offset data, range validity data, and modified validity data according to an embodiment of the present disclosure.
[0075] Reference Figure 4C , the modified offset data may be data obtained by performing a MOD operation on the offset data indicating the starting point of the character string data using the number of characters input within one cycle.
[0076] The range validity data may include offset validity data and start validity data. The offset validity data may indicate the position of an end pointer of offset data used to extract target data in the current cycle among multiple offset data segments. The start validity data may indicate the position of a start pointer of an offset data segment used to extract target data in the current cycle among multiple offset data segments.
[0077] In the offset validity data, all bits are reset to "1" every cycle, and when comparing the Nth value and the (N+1)th value of the modified validity data, all lower bits at the point where the inequality sign changes are set to "0".
[0078] In the start validity data, all lower bits including the start pointer are set to "1", and the other bits are set to "0".
[0079] The modified validity data may be generated by performing an AND operation on the validity data and the range validity data. Figure 4C , the modified validity data will be described. It can be seen that only the offset data range used for target data extraction in the current cycle among the validity data is indicated as "1".
[0080] Figure 5 is a diagram illustrating data processing synchronization control of a data buffer and an offset buffer according to the amount of character string data remaining after processing and the amount of offset data remaining after processing in the same cycle according to an embodiment of the present disclosure.
[0081] Reference Figure 5 , the synchronizer can adjust the synchronization between the data buffer and the offset buffer. Since the string data has a variable size and the offset data has a fixed size, the number of string data segments input to the data buffer and the number of offset data segments input to the offset buffer in the same cycle may be different from each other.
[0082] In the case of case 1, in the same cycle, the string data may be in a state where all string data segments in the data buffer have been processed. In the same cycle, the offset data may be in a state where three offset data segments in the offset buffer have been processed and one offset data segment remains. That is, the number of string data segments remaining after processing in the data buffer may be 0, and the number of offset data segments remaining after processing in the offset buffer may be 1. Therefore, since the number of remaining string data segments is less than the number of remaining offset data segments, the synchronizer can update the data buffer. In the updated data buffer, the string data of the next cycle can be used for target data extraction.
[0083] In case 2, in the same cycle, the string data may be in a state where some string data segments in the data buffer have been processed and one or more string data segments remain. In the same cycle, the offset data may be in a state where all offset data segments in the offset buffer have been processed. Therefore, since the number of remaining string data segments is greater than the number of remaining offset data segments, the synchronizer can update the offset buffer. In the updated offset buffer, the offset data segments of the next cycle can be used for target data extraction.
[0084] In case 3, in the same cycle, the string data may be in a state where all the string data segments in the data buffer have been processed. In the same cycle, the offset data may be in a state where all the offset data segments in the offset buffer have been processed. Therefore, since the number of remaining string data segments is equal to the number of remaining offset data segments, the synchronizer can update the data buffer and the offset buffer. In the updated data buffer, the string data of the next cycle can be used for target data extraction. In the updated offset buffer, the offset data of the next cycle can be used for target data extraction.
[0085] Figure 6 It is shown Figure 2 A diagram illustrating the operation of string comparators included in a string comparator group is shown.
[0086] Reference Figure 2 4 , the first substring group data “dogeleph” and the query data “dog” may be input to the first string comparator.
[0087] The first string comparator may include eight character comparators corresponding to the maximum query data size. Therefore, for the first substring group data, "d, o, g, e, l, e, p and h" may be separated character by character to be input to the first to eighth character comparators. For the query data, "d, o and g" may be separated character by character to be input to the first to third character comparators. The outputs of the first to eighth character comparators may be input to an 8:1 logic circuit, and the logic circuit may output the result as a case statement according to the query data size.
[0088] Therefore, since the size of the query data "dog" is 3, only the AND operation can be performed on the inputs received from the first to third character comparators to output the result. Therefore, since the first three characters "dog" of the first substring group data are consistent with the query data "dog", the first string comparator can output a comparison result of "1".
[0089] Figure 7 It is shown Figure 1 A diagram illustrating the operation of the result processor is shown.
[0090] Reference Figure 7 , the result processor may include result logic corresponding to the number of offset data input in one cycle.
[0091] like Figure 2 As shown, when the number of offset data input in one cycle is 4, the result processor may include four result logics and may receive a 16-bit comparison result from the string comparator group.
[0092] The 16-bit comparison result can be inputted to the first to fourth result logics in common, and the four modified offset data can be inputted to the first to fourth result logics one by one in sequence. Therefore, only the bit value corresponding to the offset among the 16 bits included in the comparison result is selected to be extracted as the first data. By performing an AND operation on the first data and the modified validity data, the first data can be extracted as the second data corresponding to the range to be used for target data extraction in the current cycle. Depending on the operation mode, the second data can be extracted as the target data consistent with the query data or included as the query data.
[0093] For example, when the operation mode is the complete mode, only target data consistent with the query data can be extracted, and according to whether the string data size is consistent with the query data size, an AND operation is performed on the data having 1 or 0 and the second data to extract them as the target data.
[0094] When the operation mode is the start mode, target data including the query data may be extracted and extracted as the target data by performing an AND operation on data having 1 or 0 and the second data according to whether the string data size is greater than or equal to the query data size. The string data size input to the EQ circuit may be the size of the string data corresponding to each modified offset data.
[0095] Figure 8 is a flowchart illustrating the operation of a string filter device according to an embodiment of the present disclosure.
[0096] Reference Figure 8 In operation S801, the string filter device may receive a plurality of string group data segments having a first size to be synchronized with a reference cycle, the plurality of string group data segments including a plurality of string data segments having a variable size. The first size may be determined based on a bandwidth of a channel. For example, an input buffer group of the string filter device may receive a string group data segment having a first size to be synchronized with a reference cycle.
[0097] In operation S803, the string filter device may extract a plurality of different substring group data segments having a second size from the string group data segments of at least two cycles. The plurality of substring group data segments may be extracted by shifting character by character. The second size may be a maximum query data size that the string filter device may process. For example, the input buffer group may output the plurality of substring group data segments extracted by shifting character by character to the string comparator group of the string filter device.
[0098] In operation S805, the string filter device may compare the plurality of substring group data segments with the query data in parallel and output a comparison result. For example, the string comparator group may output a result obtained by comparing each of the plurality of substring group data segments with the query data in parallel to a result processor of the string filter device.
[0099] In operation S807, the string filter device may extract the target data corresponding to the query data in the comparison result based on the offset data indicating the starting position of each string data and the validity data indicating the validity of the offset data. For example, the result processor may extract the target data from the comparison result received from the string comparator group based on the offset data and the validity data. Fig. 9 Describes the extraction of target data corresponding to query data.
[0100] Fig. 9 is a flowchart illustrating the operation of a string filter device according to an embodiment of the present disclosure.
[0101] Reference Fig. 9In operation S901, the string filter device may receive information about an operation mode of a filtering condition. The operation mode may include a complete mode and a start mode. The complete mode may be a mode for filtering data consistent with the query data, and the start mode may be a mode for filtering data starting from the query data.
[0102] In operation S903, the string filter device may determine whether the operation mode is the complete mode. When the operation mode is the complete mode as a result of the determination (S903, yes), the string filter device may perform operation S905. When the operation mode is the start mode (S903, no), the string filter device may perform operation S907. For example, referring to Figure 7 The result processor of the string filter device may compare the string data size and the query data size in different ways according to the operation mode. According to the comparison result received from the string comparator group, the result processor may output the final result value corresponding to each of the bit values of the comparison result as a valid value or an invalid value.
[0103] In operation S905, the string filter device may extract target data that is consistent with the query data. For example, when the operation mode is the complete mode, when the string data size is consistent with the query data size, the result processor may output the final result value as a valid value. When the string data size is inconsistent with the query data size, the result processor may output the final result value as an invalid value.
[0104] In operation S907, the string filter device may extract the target data including the query data. For example, when the operation mode is the start mode, when the string data size is greater than or equal to the query data size, the result processor may output the final result value as a valid value. When the string data size is less than the query data size, the result processor may output the final result value as an invalid value.
[0105] According to an embodiment of the present disclosure, a high-speed string filter device operating in parallel and an operating method thereof are provided.
[0106] Although the present disclosure has been shown and described with reference to specific embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present disclosure as defined by the appended claims and their equivalents. Therefore, the scope of the present disclosure should not be limited to the above-described embodiments, but should be determined not only by the appended claims but also by their equivalents.
[0107] In the above-described embodiments, all operations may be selectively performed or some operations may be omitted. In each embodiment, the operations are not necessarily performed in the order described and may be rearranged. The embodiments disclosed in this specification and the accompanying drawings are only examples for facilitating understanding of the present disclosure, and the present disclosure is not limited thereto. In other words, it should be understood by those skilled in the art that various modifications may be made based on the technical scope of the present disclosure.
[0108] Embodiments of the present disclosure have been described in the drawings and the specification. Although specific terms are used herein, those terms are only used to describe embodiments of the present disclosure. Therefore, the present disclosure is not limited to the above-described embodiments, and many changes can be made within the spirit and scope of the present disclosure. It should be understood by those skilled in the art that, in addition to the embodiments disclosed herein, various modifications can be made based on the technical scope of the present disclosure. In addition, the embodiments can be combined to form additional embodiments.
Claims
1. A string filter device, comprising: an input buffer group storing a plurality of string group data segments, each of the plurality of string group data segments having a first size and comprising a plurality of string data segments of variable size; as well as A string comparator group extracts a plurality of substring group data segments having a second size from the plurality of string group data segments, and compares each of the plurality of substring group data segments with the query data segment in parallel using a plurality of string comparators.
2. The string filter device according to claim 1, wherein: The input buffer group comprises: A data buffer group storing the plurality of string group data segments; an offset buffer group storing offset data indicating starting positions of the plurality of string data segments; and A validity buffer group stores validity data indicating the validity of the offset data.
3. The string filter device according to claim 2, wherein: The data buffer group includes: a first data buffer receiving a plurality of string group data segments to be synchronized with a reference cycle and storing the plurality of string group data segments; and The second data buffer receives the plurality of string group data segments from the first data buffer and stores the string group data segments of the first cycle and a portion of the string group data segments of the second cycle during the reference cycle.
4. The string filter device according to claim 2, wherein: The offset buffer group includes: a first offset buffer, receiving offset data to be synchronized with a reference cycle and storing the offset data; and A second offset buffer receives the offset data from the first offset buffer and stores the offset data segment of the first cycle and a portion of the offset data segment of the second cycle during the reference cycle.
5. The string filter device according to claim 2, wherein: The validity buffer group includes: a first validity buffer, receiving validity data to be synchronized with a reference cycle and storing the validity data; and A second validity buffer receives the validity data from the first validity buffer and stores the validity data divided to match the offset data one by one.
6. The string filter device according to claim 3, wherein: The string comparator group receives a plurality of substring group data segments extracted by character-by-character shift from the string group data segments of the first cycle and a portion of the string group data segments of the second cycle stored in the second data buffer.
7. The string filter device according to claim 6, wherein: The string comparator group includes the plurality of string comparators, which receive each of the plurality of substring group data segments in parallel and output a comparison result between each of the plurality of substring group data segments and the query data.
8. The string filter device according to claim 1, wherein: The first size is determined based on a bandwidth of a channel receiving the string group data segment.
9. The string filter device according to claim 1, wherein: The second size is determined based on a maximum query data size that can be processed by the string comparator group.
10. A string filter device, comprising: a data buffer group receiving and storing a plurality of string group data segments having a fixed size to be synchronized with a reference cycle, each of the plurality of string group data segments comprising a plurality of string data segments of variable size; an offset buffer group receiving and storing a plurality of offset data segments indicating a starting position of each of a plurality of character string data segments to be synchronized with the reference cycle; a validity buffer group receiving and storing a plurality of validity data segments indicating the validity of each of a plurality of offset data segments to be synchronized with the reference cycle; as well as A synchronizer adjusts data processing synchronization between the data segment buffer group and the offset buffer group based on a comparison result of the number of string data segments remaining when the target data is extracted from the data segment buffer group in the first cycle of the reference cycle and the number of offset data segments remaining when the target data is extracted from the offset buffer group.
11. The string filter device according to claim 10, further comprising: a string comparator group, receiving from the data buffer group a plurality of substring group data segments extracted from the plurality of string group data segments, comparing each of the plurality of substring group data segments with query data, and outputting each comparison result; as well as A result processor extracts target data matching the query data based on the comparison result and the plurality of offset data segments, In the first cycle, the offset data used to extract the target data from the multiple offset data segments output from the data buffer group and the offset buffer group and the character string data corresponding to the offset data segment used to extract the target data.
12. The string filter device according to claim 10, wherein: The synchronizer updates at least one of the data buffer group and the offset buffer group based on a comparison result of the number of remaining string data segments and the number of remaining offset data segments, In at least one updated buffer group, data of a second cycle is used when extracting the target data, and the second cycle is a cycle next to the first cycle.
13. The string filter device according to claim 12, wherein: When the number of the remaining string data segments is less than the number of the remaining offset data segments, the synchronizer updates the data buffer group.
14. The string filter device according to claim 12, wherein: When the number of the remaining string data segments is equal to the number of the remaining offset data segments, the synchronizer updates the data buffer group and the offset buffer group.
15. The string filter device according to claim 12, wherein: When the number of the remaining string data segments is greater than the number of the remaining offset data segments, the synchronizer updates the offset buffer group.
16. The string filter device according to claim 10, wherein: The fixed size is determined based on a bandwidth of a channel receiving string group data to be synchronized with the reference cycle.
17. The string filter device according to claim 16, wherein: The offset buffer group receives and stores a plurality of offset data segments also having a predetermined size to be synchronized with the reference cycle.
18. The string filter device according to claim 17, wherein: The offset buffer group determines the number of the received plurality of offset data segments to be synchronized with the reference cycle based on the fixed size of the string group data and the predetermined size of the plurality of offset data segments.
19. A method of operating a string filter device, comprising: receiving a plurality of string group data segments to be synchronized with a reference cycle, each of the plurality of string group data segments having a first size and comprising a plurality of string data segments of variable size; extracting a plurality of substring group data segments having a second size from the string group data corresponding to a plurality of periods of the reference period; comparing each of the plurality of substring group data segments with the query data in parallel and outputting each comparison result; as well as Target data corresponding to the query data in the comparison result is extracted based on the offset data indicating the start position of each character string data and the validity data indicating the validity of the offset data.
20. The method according to claim 19, wherein: Extracting the target data includes extracting the target data consistent with or including the query data according to an operation mode based on a size of each of the character string data and a size of the query data.