Fuzzy matching method and device based on gap constraint

Through the fuzzy matching method based on gap constraints, the network tree structure is constructed and the matching result is determined using dichotomy method, which solves the problem of low traversal efficiency in network tree traversal in matching without overlapping patterns, and achieves faster target sequence acquisition.

CN116501777BActive Publication Date: 2025-07-29TIANJIN UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310491098.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-05
Publication Date
2025-07-29
Estimated Expiration
2043-05-05

AI Technical Summary

Technical Problem

The existing overlap-free pattern matching method has room for efficiency improvement in the network tree traversal strategy, and it is difficult to quickly obtain target sequences that meet user needs.

Method used

A fuzzy matching method based on gap constraints is adopted to construct a network tree structure by inputting target patterns and sequences, and the matching results are determined using dichotomy, including generation and search of upward and downward layer-by-layer matching channels.

Benefits of technology

Improves the response speed of non-overlapping pattern matching, allowing users to obtain target sequences that meet their needs faster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116501777B_ABST
    Figure CN116501777B_ABST
Patent Text Reader

Abstract

The present application provides a fuzzy matching method and apparatus based on gap constraints, which relates to the technical field of fuzzy matching. The method includes: inputting a target pattern, a target sequence, and gap constraints, where the target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence; determining a net tree structure of the target sequence based on the target pattern and the gap constraints; using the dichotomy method to determine the matching result between the target sequence and the target pattern; through the present application, the response speed of non-overlapping pattern matching can be improved, enabling the user to obtain a target sequence that better meets their own needs faster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of fuzzy matching, and in particular, to a fuzzy matching method and device based on gap constraints. Background Art

[0002] Pattern matching always plays an important role in the retrieval process and can discover valuable target sequences from a large amount of data. There is an interrelated relationship between pattern matching and frequent pattern mining because pattern matching can not only be used to calculate the support or the number of times a pattern appears, but also various constraint conditions can be added. In recent years, research based on pattern matching has covered heterogeneous sequence data including sequence pattern mining, time series analysis and prediction, text mining, biological sequence data analysis, network intrusion detection, etc., and also shows accuracy and efficiency in practical applications.

[0003] Early gap-constrained pattern matching mainly used a single wildcard as a constraint condition to obtain the target sequence. However, a single wildcard limits the flexibility of the pattern and is not conducive to the diversity of the final result. Later, variable gap constraints were applied to the setting of the pattern string, enabling users to flexibly define the pattern string and thus obtain target sequences that better meet their own needs.

[0004] In recent years, with the proposal of the concepts of Non-overlapping and Nettree, new ideas have been provided for pattern matching. Non-overlapping can reduce data redundancy, while Nettree can save the time and space complexity of algorithm operation. The non-overlapping biological sequence pattern matching with variable gap constraints not only allows users to flexibly define the expected occurrence patterns they are interested in, perform iterative mining and refine the corresponding matches, but also enables users to obtain target sequences faster and more accurately. Currently, various methods for non-overlapping pattern matching have been designed, but there is still room for improvement in the method strategy for Nettree traversal. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a fuzzy matching method and device based on gap constraints to improve the response speed of non-overlapping pattern matching, so that users can obtain target sequences that better meet their own needs faster.

[0006] In a first aspect, the present application provides a fuzzy matching method based on gap constraints, specifically including the following steps:

[0007] Input a target pattern, a target sequence, and gap constraints, where the target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence;

[0008] Determine the network tree structure of the target sequence based on the target pattern and the gap constraint;

[0009] Use the dichotomy method to determine the matching result between the target sequence and the target pattern;

[0010] Among them, the step of using the dichotomy method to determine the matching result between the target sequence and the target pattern includes:

[0011] Select a first target layer, and the first target layer is located in the network tree structure;

[0012] Match layer by layer upward from the first target layer to the top layer of the network tree structure and generate an upward matching channel,

[0013] Match layer by layer downward from the first target layer to the bottom layer of the network tree structure and generate a downward matching channel;

[0014] Determine the matching result between the target sequence and the target pattern according to the upward matching channel and the downward matching channel.

[0015] A possible way is that the number of layers of the network structure is multiple, and each layer of the network structure corresponds to a target pattern object, and the position of the target pattern object corresponding to the current network layer corresponding to the node of the network structure layer in the target sequence;

[0016] The network structure layers are arranged according to the positions of the target pattern objects corresponding to the network structure in the target pattern;

[0017] The step of determining the network tree structure of the target sequence based on the target pattern and the gap constraint includes:

[0018] If the target pattern object corresponding to the node in the layer above the current network layer has a target pattern object corresponding to the current network layer that satisfies the preset gap, then the target pattern object corresponding to the current network layer that satisfies the preset gap is the node of the network tree structure at the target network position.

[0019] A possible way is that the step of matching layer by layer upward from the first target layer to the top layer of the network tree structure and generating an upward matching channel includes:

[0020] Perform an upward search on the first target node, and the first target node exists in the first target layer, specifically including:

[0021] If the second target node and the first target node satisfy a preset gap, a search channel between the first target node and the second target node is constructed. The position of the target pattern object corresponding to the second target node in the target sequence is before the position of the target pattern object corresponding to the first target node in the target sequence, and the second target node is located in the layer above the first target layer;

[0022] Perform an upward search operation on the second target layer, where the second target layer is above the first target layer. Specifically, it includes:

[0023] If the third target node and the fourth target node satisfy a preset gap, a search channel between the third target node and the fourth target node is constructed. The position of the target pattern object corresponding to the fourth target node in the target sequence is before the position of the target pattern object corresponding to the third target node in the target sequence, and the fourth target node is located in the layer above the second target layer, and the third is located in the second target layer.

[0024] A possible way is that the step of starting from the first target layer and matching layer by layer downward to the bottom layer of the network tree structure and generating a downward matching channel includes:

[0025] Perform a downward search on the first target node, where the first target node exists in the first target layer. Specifically, it includes:

[0026] If the fifth target node and the first target node satisfy a preset gap, a search channel between the first target node and the fifth target node is constructed. The position of the target pattern object corresponding to the fifth target node in the target sequence is after the position of the target pattern object corresponding to the first target node in the target sequence, and the fifth target node is located in the layer below the first target layer;

[0027] Perform a downward search operation on the third target layer, where the third target layer is below the first target layer. Specifically, it includes:

[0028] If the sixth target node and the seventh target node satisfy a preset gap, a search channel between the sixth target node and the seventh target node is constructed. The position of the target pattern object corresponding to the seventh target node in the target sequence is before the position of the target pattern object corresponding to the sixth target node in the target sequence, and the seventh target node is located in the layer below the third target layer, and the sixth is located in the seventh target layer.

[0029] A possible way is that the step of determining the matching result between the target sequence and the target pattern based on the upward matching channel and the downward matching channel includes:

[0030] If there is a search channel from the first target node to the top layer of the network tree structure and there is a search channel from the first target node to the bottom layer of the network tree structure, then generate the matching result between the target sequence and the target pattern.

[0031] A possible way is to determine whether the first target node and the second target node meet the preset gap according to the position of the target pattern object corresponding to the second target node in the target sequence.

[0032] Determine whether the third target node and the first target node meet the preset gap according to the position of the target pattern object corresponding to the third target node in the target sequence.

[0033] Determine whether the third target node and the fourth target node meet the preset gap in turn according to the position of the target pattern object corresponding to the fourth target node in the target sequence.

[0034] Determine whether the seventh target node and the sixth target node meet the preset gap in turn according to the position of the target pattern object corresponding to the seventh target node in the target sequence.

[0035] A possible way is that the first target layer is the layer with the fewest nodes in the network tree structure.

[0036] In a second aspect, the present application provides a fuzzy matching device based on gap constraints, including:

[0037] An acquisition module: used to input a target pattern and a target sequence, the target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence.

[0038] A determination module: used to determine the network tree structure of the target sequence based on the target pattern and gap constraints.

[0039] A matching module: used to determine the matching result between the target sequence and the target pattern by using the dichotomy method.

[0040] Among them, the matching module includes:

[0041] A selection unit: used to select a first target layer, and the first target layer is located in the network tree structure.

[0042] A first generation unit: used to start from the first target layer and match layer by layer upward to the top layer of the network tree structure, and generate an upward matching channel.

[0043] A second generation unit: used to start from the first target layer and match layer by layer downward to the bottom layer of the network tree structure, and generate a downward matching channel.

[0044] Determination unit: used to determine the matching result between the target sequence and the target pattern according to the upward matching channel and the downward matching channel.

[0045] The embodiments of the present invention bring the following beneficial effects: The present application provides a fuzzy matching method and device based on gap constraints. The method includes: inputting a target pattern, a target sequence, and gap constraints, where the target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence; determining the network tree structure of the target sequence based on the target pattern and gap constraints; using the dichotomy method to determine the matching result between the target sequence and the target pattern; through the present application, the response speed of non-overlapping pattern matching can be improved, enabling users to obtain a target sequence that better meets their own needs faster.

[0046] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification, claims, and drawings.

[0047] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. Description of the Drawings

[0048] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0049] Figure 1 It is a flowchart of a fuzzy matching method based on gap constraints provided by an embodiment of the present invention;

[0050] Figure 2 (a) to 2(d) are schematic diagrams of the fuzzy matching method provided by an embodiment of the present invention;

[0051] Figure 3 It is a schematic diagram of a fuzzy matching device based on gap constraints provided by an embodiment of the present invention. Detailed Embodiments

[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0053] Currently, with the proposal of the Non-overlapping and Nettree concepts, new ideas are provided for pattern matching. Non-overlapping can reduce data redundancy, while Nettree can save the time and space complexity of algorithm operation. The non-overlapping biological sequence pattern matching with variable gap constraints not only allows users to flexibly define the expected occurrence patterns they are interested in, perform iterative mining and refine the corresponding matches, but also enables users to obtain the target sequence faster and more accurately. Currently, various methods for non-overlapping pattern matching have been designed, but there is still room for improvement and enhancement in the method strategy for Nettree traversal. Based on this, an ambiguity matching method and device based on gap constraints provided by the embodiments of the present invention can improve the response speed of non-overlapping pattern matching, enabling users to obtain the target sequence that better meets their own needs faster.

[0054] To facilitate the understanding of this embodiment, a detailed introduction will be first given to an ambiguity matching method based on gap constraints disclosed in the embodiments of the present invention.

[0055] Figure 1 The flowchart of an ambiguity matching method based on gap constraints provided by the embodiments of the present invention is as follows, which specifically includes the following steps:

[0056] S101: Input a target pattern and a target sequence. The target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence;

[0057] It should be noted that the target sequence is the sequence to be searched, and the target pattern is the expected sequence. Exemplarily, the target sequence can be S = aggtatagagaaa, and the target pattern is: P = a[0,2]g[0,1]a[0,1]a, a, g, a, a representing the target pattern objects

[0058] Among them, [0,2], [0,1], and [0,1] represent gap constraints. The gap constraint represents the maximum interval between each target object. Exemplarily, [0,2] represents that there are at most two characters between a and g in S = aggtatagagaaa;

[0059] S102: Determine the nettree structure of the target sequence based on the target pattern and the gap constraint;

[0060] S103: Determine the matching result between the target sequence and the target pattern using the binary method;

[0061] Specifically, in this step, the following steps are included: Select the first target layer, and the first target layer is located in the network tree structure; Starting from the first target layer, match layer by layer upward in the network tree structure until the top layer of the network tree structure, and generate an upward matching channel. Starting from the first target layer, match layer by layer downward in the network tree structure until the bottom layer of the network tree structure, and generate a downward matching channel;

[0062] Determine the matching result between the target sequence and the target pattern based on the upward matching channel and the downward matching channel.

[0063] By adopting the binary algorithm in this application, the response speed of non-overlapping pattern matching is improved, enabling users to obtain the target sequence that better meets their own needs faster;

[0064] The following provides a brief introduction to the network tree structure in this application:

[0065] In this application, the number of layers of the network structure is multiple, and each layer of the network structure corresponds to a target pattern object. The position of the target pattern object corresponding to the node of the network structure layer in the target sequence, and the network structure layers are arranged according to the position of the target pattern object corresponding to the network structure in the target pattern;

[0066] Exemplarily, in combination with Figure 2 (a) to Figure 2 (d), when the target pattern is: P = a[0, 2]g[0, 1]a[0, 1], the network tree structure has 4 layers, that is, 4level in the figure. The first layer corresponds to the position where a appears in the target object in the target sequence S = aggtatagagaaa, and the second layer represents the position where the target pattern object g that meets the gap constraint appears in S = aggtatagagaaa;

[0067] Here, the steps for determining the network tree structure of the target sequence based on the target pattern and the gap constraint include:

[0068] If the target pattern object corresponding to the node of the upper layer of the current network layer has a target pattern object corresponding to the current network layer that meets the preset gap, then the target network position of the target pattern object corresponding to the current network layer that meets the preset gap is the node of the network tree structure.

[0069] That is to say, in combination with Figure 2 (a) and Figure 2(d), 1, 5, 7, 9, 11, 12, 13 in the first layer represent that the positions of the target pattern object a in the target sequence are 1, 5, 7, 9, 11, 12, 13;

[0070] Determine whether there is a qualified g within the gap constraint of the first character of the target sequence. In the target sequence, the second character and the third character are both g, and both meet the gap constraint. The above operations are performed on each node, and thus the nodes of the second layer are generated;

[0071] The following is an elaboration on the method of constructing an upward matching channel and a downward matching channel:

[0072] In this application, the step of starting from the first target layer and matching layer by layer upward to the top layer of the network tree structure and generating an upward matching channel includes:

[0073] Perform an upward search on the first target node, where the first target node exists in the first target layer, specifically including:

[0074] If the second target node and the first target node meet the preset gap, construct a search channel between the first target node and the second target node. The position of the target pattern object corresponding to the second target node in the target sequence is before the position of the target pattern object corresponding to the first target node in the target sequence, and the second target node is located in the layer above the first target layer;

[0075] Perform an upward search operation on the second target layer, where the second target layer is located above the first target layer, specifically including:

[0076] If the third target node and the fourth target node meet the preset gap, construct a search channel between the third target node and the fourth target node. The position of the target pattern object corresponding to the fourth target node in the target sequence is before the position of the target pattern object corresponding to the third target node in the target sequence, and the fourth target node is located in the layer above the second target layer. There is a search channel between the third target node and any node in the layer below the second target layer, and the third is located in the second target layer.

[0077] The step of starting from the first target layer and matching layer by layer downward to the bottom layer of the network tree structure and generating a downward matching channel includes:

[0078] Perform a downward search on the first target node, where the first target node exists in the first target layer, specifically including:

[0079] If the fifth target node and the first target node meet the preset gap, a search channel between the first target node and the fifth target node is constructed. The position of the target pattern object corresponding to the fifth target node in the target sequence is after the position of the target pattern object corresponding to the first target node in the target sequence, and the fifth target node is located in the layer below the first target layer;

[0080] Perform a downward search operation on the third target layer, where the third target layer is located below the first target layer. Specifically, it includes:

[0081] If the sixth target node and the seventh target node meet the preset gap, a search channel between the sixth target node and the seventh target node is constructed. The position of the target pattern object corresponding to the seventh target node in the target sequence is before the position of the target pattern object corresponding to the sixth target node in the target sequence, and the seventh target node is located in the layer below the third target layer. There is a search channel between the sixth target node and any node in the layer above the third target layer, and the sixth is located in the seventh target layer.

[0082] Based on the foregoing, the first target layer is the starting layer. The second target layer corresponds to the layer above the starting layer in the network tree structure, and the third target layer corresponds to the layer below the starting layer;

[0083] Of course, the first target layer is pre-selected. That is to say, in Figure 2 (a) to Figure 2 (d), it can be any layer from the first layer to the fourth layer;

[0084] It is understandable that in Figure 2 (a) to Figure 2 (d), the numbers represent the positions of the target pattern objects corresponding to the network tree structure layers that meet the preset conditions in the target sequence. Exemplarily, it is determined whether the g corresponding to 3 in the second layer and the a corresponding to 1 in the first layer meet the gap constraint. Here, the gap constraint is met and a search channel is constructed. Then, it is determined whether the g corresponding to 8 in the second layer and the a corresponding to 5 in the first layer meet the gap constraint. Here, the gap constraint is met and the search continues forward, that is, it is determined whether the g corresponding to 8 in the second layer and the a corresponding to 1 in the first layer meet the gap constraint. Here, the gap constraint is not met. The above operations are performed on each node of the first target layer;

[0085] Correspondingly, the following method is used for downward retrieval: Determine whether the g corresponding to 2 in the second layer and the a corresponding to 5 in the third layer satisfy the gap constraint. Here, the gap constraint is not satisfied, so no search channel is constructed. Then, determine whether the g corresponding to 3 in the second layer and the a corresponding to 5 in the third layer satisfy the gap constraint. Here, the gap constraint is satisfied, and continue to retrieve backward, that is, determine whether the g corresponding to 8 in the second layer and the a corresponding to 11 in the third layer satisfy the gap constraint. Here, the gap constraint is satisfied, and here, the gap constraint is not satisfied. And so on, perform the above operations on each node in the first target layer;

[0086] Perform the above operations on each third target layer;

[0087] Here, by way of example, in combination with Figure 2 (b), it can be seen that there is no search channel for nodes 11, 12, 13, and 2 in the next layer. Here, when finally determining the search result, the above redundant nodes can be removed;

[0088] Exemplarily, determine whether the a corresponding to 5 in the third layer and the g corresponding to 3 in the second layer satisfy the gap constraint. Here, the gap constraint is satisfied, so a search channel is constructed. Then, determine whether the a corresponding to 5 in the third layer and the g corresponding to 2 in the second layer satisfy the gap constraint. Here, the gap constraint is satisfied, and continue to retrieve forward. Then, determine whether the a corresponding to 9 in the third layer and the g corresponding to 8 in the second layer satisfy the gap constraint. Here, the gap constraint is satisfied, and here, the gap constraint is satisfied. And so on, perform the above operations on each node in the first target layer;

[0089] At this time, the second layer is the second target layer. The following operations are taken for each node in the second target layer:

[0090] Determine whether the g corresponding to 2 in the second layer and the a corresponding to 1 in the first layer satisfy the gap constraint. Here, the gap constraint is satisfied, so a search channel is constructed. Then, determine whether the g corresponding to 3 in the second layer and the a corresponding to 1 in the third layer satisfy the gap constraint. Here, the gap constraint is satisfied, and here, the gap constraint is satisfied, and continue to retrieve backward, that is, determine whether the g corresponding to 8 in the second layer and the a corresponding to 7 in the first layer satisfy the gap constraint. Here, the gap constraint is satisfied, and here, the gap constraint is satisfied. And so on;

[0091] Correspondingly, the following method is used for downward retrieval: Determine whether the a corresponding to 5 in the third layer and the g corresponding to 7 in the fourth layer satisfy the gap constraint. Here, the gap constraint is satisfied, so a search channel is constructed. Then, determine whether the a corresponding to 5 in the third layer and the a corresponding to 11 in the fourth layer satisfy the gap constraint. Here, the gap constraint is satisfied, and continue to retrieve backward, that is, determine whether the a corresponding to 3 in the third layer and the a corresponding to 12 in the fourth layer satisfy the gap constraint. Here, the gap constraint is satisfied, and here, the gap constraint is not satisfied;

[0092] That is to say, in this process, the third target node and the fourth target node perform a traversal search;

[0093] In the process of downward matching, the sixth target node and the seventh target node perform a traversal search;

[0094] Combined with the foregoing, if the first target node has a search channel to reach the top layer of the network tree structure, and the first target node has a search channel to reach the bottom layer of the network tree structure, then the matching result of the target sequence and the target pattern is generated;

[0095] Furthermore, assuming that the second layer is selected as the starting layer, combined with Figure 2 (a), it can be seen that 2357 is a search path;

[0096] In this application, it also includes counting the matching result of the target sequence and the target pattern. Further, in this step, in order to improve the operation speed, redundant nodes can be removed first. Here, the redundant nodes include: nodes that do not have a search path to the next layer of the network tree structure. Exemplarily, nodes 11, 12, 13 in the first layer; node 2 in the second layer;

[0097] It also includes nodes that have already appeared. Combined with Figure 2 (c), assuming that 9, 10, 12, 13 have been counted exemplarily, then 9, 10, 12, 13 are counted as redundant nodes, indicating that this search method has been counted;

[0098] Preferably, according to the position of the target pattern object corresponding to the second target node in the target sequence, it is determined for the first time that the first target node and the second target node satisfy a preset gap;

[0099] According to the position of the target pattern object corresponding to the third target node in the target sequence, it is sequentially determined that the third target node and the first target node satisfy a preset gap;

[0100] According to the position of the target pattern object corresponding to the fourth target node in the target sequence, it is sequentially determined that the third target node and the fourth target node satisfy a preset gap;

[0101] According to the position of the target pattern object corresponding to the seventh target node in the target sequence, it is sequentially determined that the seventh target node and the sixth target node satisfy a preset gap;

[0102] Exemplarily, assuming that the second layer is used as the first target layer, then the first target nodes include: 2, 3, 7, 8; assuming that an upward search is performed on node 8, the corresponding second target nodes include: 1, 5, 7. Here, first, it is determined whether 7 meets the gap constraint, then it is determined whether 5 satisfies the gap constraint, and finally it is determined whether 1 meets the gap constraint, and so on;

[0103] Assume a downward search is performed on node 8. The corresponding third target nodes in the third layer include: 9, 11, 12. Here, first determine whether 9 meets the gap constraint, then determine whether 11 meets the gap constraint, and finally determine whether 12 meets the gap constraint, and so on;

[0104] Assume that the fourth target node is node 8 in the second layer. The corresponding fifth target nodes in the first layer include 1, 5, 7. Then, preferentially determine whether 7 can build a search channel, then determine whether 5 can build a search channel, and finally determine whether 1 can build a search channel, and so on;

[0105] Assume that the sixth target node is node 8 in the second layer. The corresponding seventh target nodes in the third layer include 9, 11, 12. Then, preferentially determine whether 9 can build a search channel, then determine whether 11 can build a search channel, and finally determine whether 12 can build a search channel, and so on;

[0106] Thus, a search channel is constructed in a non-overlapping manner, saving computing time;

[0107] Preferably, the first target layer is the layer with the fewest nodes in the network tree structure. Exemplarily, taking the second layer or the third layer as the target layer can further save the search time, reduce the nodes in the starting layer, and reduce the search time performance and the time for determining the search path;

[0108] As Figure 3 shown, the present invention provides a fuzzy matching device based on gap constraints, including:

[0109] An acquisition module: used to input a target pattern and a target sequence. The target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence;

[0110] A determination module: used to determine the network tree structure of the target sequence based on the target pattern and gap constraints;

[0111] A matching module: used to determine the matching result between the target sequence and the target pattern by using the dichotomy method;

[0112] Among them, the matching module includes:

[0113] A selection unit: used to select a first target layer, and the first target layer is located in the network tree structure;

[0114] A first generation unit: used to start from the first target layer and perform matching layer by layer upward to the top layer of the network tree structure, and generate an upward matching channel,

[0115] The second generation unit: It is used to perform matching layer by layer downward from the starting point of the first target layer to the bottom layer of the network tree structure, and generate a downward matching channel;

[0116] The determination unit: It is used to determine the matching result between the target sequence and the target pattern according to the upward matching channel and the downward matching channel.

[0117] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the part of the module, program segment, or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, as well as the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0119] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be construed as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0120] Finally, it should be noted that the above-described embodiments are only specific embodiments of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions described in the foregoing embodiments or can easily think of changes, or make equivalent replacements for some of the technical features; and these modifications, changes or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A fuzzy matching method based on gap constraints, characterized in that Specifically, it includes the following steps: Input a target pattern, a target sequence, and a gap constraint, where the target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence; Determine the network tree structure of the target sequence based on the target pattern and the gap constraint; Use the dichotomy method to determine the matching result between the target sequence and the target pattern; Among them, the step of using the dichotomy method to determine the matching result between the target sequence and the target pattern includes: Select a first target layer, and the first target layer is located in the network tree structure; Start from the first target layer and match layer by layer upward to the top layer of the network tree structure, and generate an upward matching channel; Start from the first target layer and match layer by layer downward to the bottom layer of the network tree structure, and generate a downward matching channel; Determine the matching result between the target sequence and the target pattern according to the upward matching channel and the downward matching channel.

2. The method according to claim 1, wherein The number of layers of the network structure is multiple, and each layer of the network structure corresponds to a target pattern object. The position of the target pattern object corresponding to the node of the current network layer in the network structure layer in the target sequence; The network structure layers are arranged according to the positions of the target pattern objects corresponding to the network structure in the target pattern; The step of determining the network tree structure of the target sequence based on the target pattern and the gap constraint includes: If there is a target pattern object corresponding to the current network layer that satisfies the preset gap among the target pattern objects corresponding to the nodes of the upper layer of the current network layer, then the target pattern object corresponding to the current network layer that satisfies the preset gap is the node of the network tree structure at the target network position.

3. The method according to claim 2, wherein The step of starting from the first target layer and matching layer by layer upward to the top layer of the network tree structure and generating an upward matching channel includes: Perform an upward search on the first target node, and the first target node exists in the first target layer. Specifically, it includes: If the second target node and the first target node satisfy the preset gap, then construct a search channel between the first target node and the second target node. The position of the target pattern object corresponding to the second target node in the target sequence is before the position of the target pattern object corresponding to the first target node in the target sequence, and the second target node is located in the upper layer of the first target layer; Perform an upward search operation on the second target layer, and the second target layer is located above the first target layer. Specifically, it includes: If the third target node and the fourth target node satisfy the preset gap, then construct a search channel between the third target node and the fourth target node. The position of the target pattern object corresponding to the fourth target node in the target sequence is before the position of the target pattern object corresponding to the third target node in the target sequence, and the fourth target node is located in the upper layer of the second target layer, and the third is located in the second target layer.

4. The method according to claim 3, wherein The step of starting from the first target layer and matching layer by layer downward to the bottom layer of the network tree structure and generating a downward matching channel includes: Perform a downward search on the first target node, and the first target node exists in the first target layer. Specifically, it includes: If the fifth target node and the first target node satisfy a preset gap, a search channel between the first target node and the fifth target node is constructed. The position of the target pattern object corresponding to the fifth target node in the target sequence is after the position of the target pattern object corresponding to the first target node in the target sequence, and the fifth target node is located in the layer below the first target layer; Perform a downward search operation on the third target layer, where the third target layer is below the first target layer. Specifically, it includes: If the sixth target node and the seventh target node satisfy a preset gap, a search channel between the sixth target node and the seventh target node is constructed. The position of the target pattern object corresponding to the seventh target node in the target sequence is before the position of the target pattern object corresponding to the sixth target node in the target sequence, and the seventh target node is located in the layer below the third target layer, and the sixth is located in the seventh target layer.

5. The method according to claim 4, wherein The step of determining the matching result between the target sequence and the target pattern based on the upward matching channel and the downward matching channel includes: If there is a search channel from the first target node to the top layer of the network tree structure and there is a search channel from the first target node to the bottom layer of the network tree structure, generate the matching result between the target sequence and the target pattern.

6. The method according to claim 5, characterized in that, Determine whether the first target node and the second target node satisfy the preset gap according to the position of the target pattern object corresponding to the second target node in the target sequence; Determine whether the third target node and the first target node satisfy the preset gap according to the position of the target pattern object corresponding to the third target node in the target sequence; Determine whether the third target node and the fourth target node satisfy the preset gap in sequence according to the position of the target pattern object corresponding to the fourth target node in the target sequence; Determine whether the seventh target node and the sixth target node satisfy the preset gap in sequence according to the position of the target pattern object corresponding to the seventh target node in the target sequence.

7. The method according to any one of claims 1 to 6, characterized in that, The first target layer is the layer with the fewest nodes in the network tree structure.

8. A fuzzy matching device based on gap constraints, characterized in that, It includes: An acquisition module: used to input a target pattern and a target sequence. The target pattern is composed of objects, and each object in the target pattern appears at least once in the target sequence; A determination module: used to determine the network tree structure of the target sequence based on the target pattern and gap constraints; A matching module: used to determine the matching result between the target sequence and the target pattern by using the dichotomy method; Among them, the matching module includes: A selection unit: used to select the first target layer, and the first target layer is located in the network tree structure; A first generation unit: used to start from the first target layer and perform matching layer by layer upward to the top layer of the network tree structure and generate an upward matching channel; A second generation unit: used to start from the first target layer and perform matching layer by layer downward to the bottom layer of the network tree structure and generate a downward matching channel; A determination unit: used to determine the matching result between the target sequence and the target pattern based on the upward matching channel and the downward matching channel.

Citation Information

Patent Citations

  • Non-overlapping approximation pattern matching method with local-integral constraint

    CN110245167A

  • Method for constructing feature base library, feature retrieval method, and related device

    WO2023273082A1