Matching method and device

By converting pattern strings and text strings into sequence levels for matching, and selecting matching algorithms based on character length ratios, the problem of low search efficiency of existing algorithms is solved, and matching efficiency and response speed are improved.

CN112580747BActive Publication Date: 2024-08-23ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011601582.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-08-23
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

The existing KMP and BM algorithms are difficult to provide efficient matching processing with stable performance in some business scenarios, resulting in low search efficiency.

Method used

By converting pattern strings and text strings into sequence levels for matching, the matching algorithm is selected using ratio judgment. If the ratio is greater than the threshold, preliminary matching at the sequence level is used, otherwise the BM or KMP algorithm is selected.

Benefits of technology

The matching efficiency between pattern strings and text strings is improved. Especially when the pattern string character length is short, the response speed is significantly improved through preliminary matching at the sequence level, and the processing efficiency of front-end business is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112580747B
    Figure CN112580747B
Patent Text Reader

Abstract

The present application provides a matching method and device, wherein the matching method comprises: obtaining a search request containing a pattern string, and determining at least one text string corresponding to the pattern string; reading a text sequence corresponding to the at least one text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string; screening a candidate text sequence matching the pattern sequence in the text sequence, and determining a candidate text string corresponding to the candidate text sequence; comparing the pattern string with the candidate text string, and using the comparison result as a response to the search request.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a matching method. The present application also relates to a matching device, a computing device, and a computer-readable storage medium. Background Art

[0002] With the development of computer technology, users have higher and higher requirements for search efficiency in any scenario, and due to different business scenarios, different pattern matching algorithms are needed to support the operation of front-end business. The commonly used algorithms in the prior art are KMP (Knuth-Morria-Pratt) algorithm and BM (Boyer-Moore) algorithm. The KMP algorithm can ensure that the pattern string does not backtrack after the character matching fails because the jump distance is always positive, thereby ensuring higher performance. However, due to the small jump distance, the average performance of the algorithm is lower than that of the BM algorithm. The BM algorithm has a larger jump distance and higher algorithm averageness. Although the KMP algorithm and the BM algorithm have better performance in some business scenarios, it is difficult for the two to provide efficient matching processing under stable performance. Therefore, an effective solution is urgently needed to improve matching efficiency. Summary of the invention

[0003] In view of this, the embodiment of the present application provides a matching method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a matching device, a computing device, and a computer-readable storage medium.

[0004] According to a first aspect of an embodiment of the present application, a matching method is provided, including:

[0005] Obtaining a search request containing a pattern string, and determining at least one text string corresponding to the pattern string;

[0006] Reading a text sequence corresponding to the at least one text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string;

[0007] Screening a candidate text sequence matching the pattern sequence in the text sequence, and determining a candidate text string corresponding to the candidate text sequence;

[0008] The pattern string is compared with the candidate text string, and the comparison result is used as a response to the search request.

[0009] Optionally, before the step of obtaining a search request containing a pattern string is performed, the step further includes:

[0010] Receive search instructions uploaded by the client;

[0011] A search keyword is determined according to the search instruction, and a search request containing the pattern string is created based on the search keyword.

[0012] Optionally, comparing the pattern string with the candidate text string and using the comparison result as a response to the search request includes:

[0013] Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm;

[0014] If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

[0015] Optionally, after the step of comparing the pattern string with the candidate text string and taking the comparison result as a response to the search request, the method further includes:

[0016] Determining a limiting request according to the search instruction;

[0017] Determining a target text string corresponding to the restriction request from among the candidate text strings, and determining target information based on the target text string;

[0018] The target information is sent to the client as a response to the search instruction.

[0019] Optionally, determining at least one text string corresponding to the pattern string includes:

[0020] Parsing the search request to obtain a pattern identifier corresponding to the pattern string;

[0021] A text string matching the pattern identifier is screened from a preset text string set as the at least one text string corresponding to the pattern string.

[0022] Optionally, before the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string are performed, the method further includes:

[0023] Determining a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string;

[0024] Determining whether a ratio of the second character length to the first character length is greater than a preset threshold;

[0025] If so, execute the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string.

[0026] Optionally, the reading of the text sequence corresponding to the at least one text string, and converting the pattern string to obtain the pattern sequence corresponding to the pattern string, includes:

[0027] Determine a first conversion module according to the text sequence of the at least one text string;

[0028] The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

[0029] Optionally, screening the text sequence for a candidate text sequence matching the pattern sequence includes:

[0030] Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element;

[0031] A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as the candidate sequence.

[0032] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0033] Determining a second conversion module corresponding to the first conversion module;

[0034] The candidate text sequence is input into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

[0035] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0036] Determine a conversion relationship according to the pattern string and the pattern sequence;

[0037] The candidate text sequence is converted into the candidate text string based on the conversion relationship.

[0038] According to a second aspect of an embodiment of the present application, a matching device is provided, including:

[0039] An acquisition module is configured to acquire a search request containing a pattern string and determine at least one text string corresponding to the pattern string;

[0040] A conversion module is configured to read a text sequence corresponding to the at least one text string, and convert the pattern string to obtain a pattern sequence corresponding to the pattern string;

[0041] a matching module configured to screen a candidate text sequence matching the pattern sequence in the text sequence, and determine a candidate text string corresponding to the candidate text sequence;

[0042] The response module is configured to compare the pattern string with the candidate text string and use the comparison result as a response to the search request.

[0043] According to a third aspect of an embodiment of the present application, a computing device is provided, including:

[0044] Memory and processor;

[0045] The memory is used to store computer-executable instructions, and the processor implements the steps of the matching method when executing the computer-executable instructions.

[0046] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the matching method are implemented.

[0047] The matching method provided in the present application, after obtaining a search request containing a pattern string, determines at least one text string corresponding to the pattern string, and then converts the text string and the pattern string simultaneously to obtain text sequences corresponding to each text string, and a pattern sequence corresponding to the pattern string, and then screens the candidate text sequences that match the pattern sequence in the text sequence, and determines the candidate text strings corresponding to the candidate text sequences, and then compares the pattern string with the text string to determine the response to the search request, so that in the scenario where the pattern string and the text string do not match a large number of times, the character matching efficiency can be improved by converting to the sequence level, so as to quickly respond to the search request and improve the processing efficiency of the front-end business. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 is a flow chart of a matching method provided by an embodiment of the present application;

[0049] Figure 2 is a processing flow chart of a matching method applied to a game scenario provided by an embodiment of the present application;

[0050] Figure 3 is a structural schematic diagram of a matching device provided in one embodiment of the present application;

[0051] Figure 4 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0052] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.

[0053] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.

[0054] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.

[0055] First, the terms involved in one or more embodiments of the present invention are explained.

[0056] BM algorithm: (Boyer-Moore, string search algorithm), this algorithm only preprocesses the search target string (keyword), not the string being searched; for each failed matching attempt, the algorithm can use this information to eliminate as many unmatched positions as possible.

[0057] KMP algorithm: (Knuth-Morria-Pratt, string matching algorithm), using the information after the match failed, minimizes the number of matches between the pattern string and the main string to achieve the purpose of fast matching. The specific implementation is through a next() function, which itself contains the local matching information of the pattern string.

[0058] In the present application, a matching method is provided. The present application also relates to a matching device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0059] Figure 1 A flowchart of a matching method provided according to an embodiment of the present application is shown, which specifically includes the following steps:

[0060] Step S102: obtaining a search request containing a pattern string, and determining at least one text string corresponding to the pattern string.

[0061] Specifically, the search request specifically refers to a request created based on a search instruction submitted by a user, and the request is used to trigger the matching processing of a pattern string and a text string. Accordingly, the search instruction specifically refers to an instruction submitted by a user when searching for corresponding information on a client, and the pattern string specifically refers to a character string determined based on the user's search instruction, and the text string specifically refers to a character string corresponding to information already existing on the server; that is, the pattern string is matched in the text string to determine whether corresponding information can be fed back in response to the user's search instruction.

[0062] For example, in a certain game, users can purchase props in the mall. After inputting the search content through the mall's search box, a search instruction will be submitted to the game server. At this time, in order to be able to feedback content that meets the user's search requirements to the user, the server will determine the pattern string based on the search instruction, and then match the pattern string in the text strings stored on the server. Then, all text strings containing the pattern string are selected, and the products corresponding to each text string are determined. These products can be fed back to the client to be displayed to the user in response to the user's search instruction.

[0063] In this process, since the server contains many text strings and the lengths of pattern strings vary, if the BM algorithm or KMP algorithm is used to match the string, not only the matching efficiency cannot be guaranteed, but it will also cause the problem of slow response to the client. The matching algorithm provided in this application combines the matching processing process at the sequence level to improve the matching efficiency of the string, ensure a quick response to the client, and improve the user experience.

[0064] Based on this, before obtaining the search request containing the pattern string, the search instruction uploaded by the client is received, and then the search request is created according to the search instruction. In this embodiment, the specific implementation method is as follows:

[0065] Receive search instructions uploaded by the client;

[0066] A search keyword is determined according to the search instruction, and a search request containing the pattern string is created based on the search keyword.

[0067] Specifically, the search instruction specifically refers to the instruction submitted by the user through the client, which is used to trigger the search for information that meets the user's query needs. Accordingly, the client specifically refers to the terminal device held by the user, which can be a computer, mobile phone or tablet computer, etc.; accordingly, the search keyword specifically refers to the keyword that matches the user's search intention to ensure that information that meets the user's search needs can be searched.

[0068] It should be noted that the matching algorithm provided in this embodiment can be applied to search scenarios in games, such as searching for character information in games, searching for product information in game malls, searching for attribute information of characters in games, etc.; or applied to network security detection scenarios, such as detecting whether access requests are safe, detecting whether data extraction requests are safe, etc.; the matching algorithm provided in this embodiment can be applied to matching scenarios of any pattern strings and text strings. This embodiment takes the search scenario in the game as an example for explanation. The processing procedures of other scenarios can refer to the corresponding description content of this embodiment, and no further details will be given here.

[0069] Based on this, after receiving the search instruction uploaded by the client, the search request can be parsed to obtain the search keyword, and then a search request containing the pattern string is created based on the search keyword to trigger the matching process of the pattern string and the text string.

[0070] Further, after obtaining the search request containing the pattern string, the matching processing operation of the pattern string and the text string will be triggered. Since the server stores a large number of text strings, and different text strings correspond to different information, the pattern identifier of the pattern string can be analyzed to determine the text string that is similar to or the same as the pattern string type for subsequent matching processing. In this embodiment, the specific implementation method is as follows:

[0071] Parsing the search request to obtain a pattern identifier corresponding to the pattern string;

[0072] A text string matching the pattern identifier is screened from a preset text string set as the at least one text string corresponding to the pattern string.

[0073] Specifically, the pattern identifier specifically refers to an identifier representing the type of the pattern string. Through the pattern identifier, a text string with a high degree of match with the pattern string can be quickly determined for subsequent matching processing; based on this, after obtaining a search request containing the pattern string, the search request is parsed to obtain the pattern identifier corresponding to the pattern string, and then the text string matching the pattern identifier is screened from a preset text string set as at least one text string corresponding to the pattern string.

[0074] For example, in a certain online game, the player enters "reply" in the game mall. At this time, in order to quickly feedback the game props corresponding to the "reply" to the user, a search instruction corresponding to the "reply" will be sent to the server. After receiving the search instruction, the server creates a search request containing the pattern string "reply", and the matching processing operation of the pattern string and the text string is triggered. Since the game mall sells weapons, potions, materials, equipment and other game props to players, and different types of game props have corresponding text strings, in order to quickly feedback the game props that meet the search information "reply" to the player, the pattern identifier MS_ID1 of the pattern string will be used to determine the text string that matches the identifier in the server. At this time, it is determined that the text string of the type "potion" matches the pattern string "reply", and the text strings corresponding to the "potion" are used as text strings for subsequent processing.

[0075] In summary, preliminary screening of text strings that meet the search request through pattern identification can not only improve the matching efficiency of character strings, but also ensure that the text strings used for subsequent processing have close or similar characteristics to the pattern strings, thereby further promoting the front-end business processing efficiency.

[0076] Step S104: read a text sequence corresponding to the at least one text string, and convert the pattern string to obtain a pattern sequence corresponding to the pattern string.

[0077] Specifically, on the basis of the above-mentioned determination of at least one text string and pattern string, further, at this time, in order to be able to improve the matching efficiency of the pattern string and the text string, a preliminary screening method from the sequence dimension will be adopted to speed up the matching efficiency, wherein the pattern sequence specifically refers to the sequence obtained after binary conversion of the pattern string, and the text sequence specifically refers to the sequence obtained after binary conversion of the text string, that is, before matching the pattern string and the text string, the pattern string and will be processed into bits, and preliminary matching processing will be performed from the smallest unit to improve the matching efficiency of the character dimension.

[0078] In specific implementation, since the text string is a character string stored on the server, after the server determines the text string, it will process the text string into bits, and establish a correspondence between the text string and the bits before storing it. When it is necessary to match the text string and the pattern string, the bits corresponding to the text string can be directly determined from the stored correspondence, and then the bits corresponding to the text string are read for subsequent matching processing, so as to quickly complete the matching processing operation.

[0079] For example, a game provides an auction house mechanism for players, where players can sell tradable game props. When the player puts game prop A on the auction house, game prop A is now a purchasable game prop for other players. If other players need to purchase game prop A, they can search for game prop A through the name of game prop A in the auction house search box to purchase it. In this process, in order to improve the search efficiency of other players searching for game prop A, when the player sells game prop A, the text string corresponding to game prop A can be directly converted into binary to obtain the binary sequence corresponding to game prop A. At this time, the binary sequence of game prop A is stored. When a server receives a search request, it can directly read the binary sequence of game prop A for preliminary matching processing at the sequence level, thereby improving the response efficiency of responding to the search request.

[0080] By converting and storing the text sequence corresponding to the text string when determining the text string, the text sequence can be read directly according to the needs in the subsequent matching process without the need for further conversion, thereby improving the matching processing efficiency of the text string and the pattern string.

[0081] Furthermore, whether it is the BM algorithm or the KMP algorithm, or the brute force search algorithm, when the character length of the pattern string is short, it may take a long time to complete the matching process; if the pattern string is long, the above algorithms have high processing efficiency. Therefore, in order to improve the matching efficiency of the pattern string and the text string when the character length of the pattern string is short, the present application adopts a preliminary matching from the bit position. In this process, in order to ensure the maximum matching efficiency, the final matching method can be selected according to the length of the pattern string. In this embodiment, the determination of which algorithm to use in which situation is achieved by the following method:

[0082] Determining a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string;

[0083] Determining whether a ratio of the second character length to the first character length is greater than a preset threshold;

[0084] If yes, execute step S104; if no, select BM algorithm or KMP algorithm for subsequent matching processing.

[0085] Specifically, the first character length specifically refers to the character length of the pattern string, and the second character length specifically refers to the character lengths corresponding to each text string in at least one text string. Accordingly, the preset threshold specifically refers to the threshold for judging the ratio of the second character length to the first character length; the preset threshold is preferably 4, and can also be set to 6, 8 or 10 according to the actual application scenario. The specific set value can be set according to the actual application scenario, and this embodiment does not make any limitation here.

[0086] It should be noted that since the number of text strings may be greater than or equal to 1, before performing the matching process, it is necessary to calculate the ratio of the character length of the pattern string to the character length of each text string, and then use the preliminary matching method at the sequence level to match the pattern strings and text strings whose ratios are greater than the preset threshold; the pattern strings and text strings whose ratios are less than or equal to the preset threshold are directly matched to improve the efficiency of the matching process.

[0087] Based on this, after determining the pattern string and the text string, the first character length corresponding to the pattern string and the second character length corresponding to at least one text string are determined by analyzing the pattern string and the text string, and then the ratio of the second character length to the first character length is calculated. If the ratio is greater than the preset threshold, it means that the character length of the pattern string is shorter than the character length of the text string, and it can be converted into a binary sequence for preliminary matching processing, that is, executing step S104; if the ratio is less than or equal to the preset threshold, it means that the character length of the pattern string is longer than the character length of the text string. At this time, if it is converted into a binary sequence for matching, it may affect the matching efficiency. In this case, the BM algorithm or the KMP algorithm can be selected to directly perform matching processing to ensure the matching processing efficiency of the pattern string and the text string.

[0088] Furthermore, when it is determined that the ratio is greater than the preset threshold, it means that the character length of the pattern string is short, and it needs to be converted into a binary sequence for preliminary matching. In this embodiment, the specific implementation method of converting into a binary sequence is as follows:

[0089] Determine a first conversion module according to the text sequence of the at least one text string;

[0090] The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

[0091] Specifically, the first conversion module specifically refers to a module that can convert a pattern string or a text string into a binary sequence. It should be noted that the pattern string and the text string need to be converted using the same conversion module to ensure that the same characters in the pattern string or in the text string can be converted into the same binary sequence to ensure that subsequent matching processing operations can be performed.

[0092] Using the above example, when determining the pattern string "reply" and the text string "medicine", the text string is determined to include {low-level health recovery medicine, intermediate health recovery medicine, advanced health recovery medicine, special health recovery medicine, low-level mana recovery medicine, intermediate mana recovery medicine, advanced mana recovery medicine, special mana recovery medicine, resurrection medicine, invisibility medicine, enhancement medicine}. At this time, the character length of the determined pattern string is M=2, and the first 8 characters in the text string are The character length of the first character string is N1=9, and the character length of the last three character strings is N2=4. At this time, calculate whether the ratio of M / N is greater than 4. If it is less than or equal to, you can choose the BM algorithm or KMP algorithm to directly match at the character level; if it is greater, it can be converted to bits for preliminary matching; according to the judgment result, it is determined that M / N1=4.5>4, M / N2=2<4, and the bit position processed by the "reply" of the pattern string is (10101101101111 0101100100001101), and read the text string {low-level health recovery potion, intermediate health recovery potion, advanced health recovery potion, special-level health recovery potion, low-level mana recovery potion, intermediate mana recovery potion, advanced mana recovery potion, special-level mana recovery potion}, the corresponding bits are (10011110100111011111101010011111101101000010 010001000010000001001000111001111101011011011011110101001000011011000001101101111101001001000010……) for subsequent preliminary matching processing at the sequence level; and the text string {resurrection potion, invisibility potion, enhancement potion} can be directly matched using the BM algorithm or the KMP algorithm.

[0093] In summary, before performing the matching process of the pattern string and the text string, in order to ensure the maximum matching efficiency, screening can be performed by calculating the ratio of the character length of the pattern string and the character length of the text string, so as to select a better matching process for different pattern strings with different character lengths to improve the matching process efficiency.

[0094] Step S106, screening candidate text sequences matching the pattern sequence in the text sequence, and determining candidate text strings corresponding to the candidate text sequences.

[0095] Specifically, on the basis of the text sequence and pattern sequence obtained as described above, a preliminary match will be further performed at the sequence level. At this time, bits will be used for preliminary screening, that is, candidate text sequences that match the pattern sequence will be screened in the text sequence. Since there is more than one text sequence, the processing efficiency can be accelerated through bits during the screening process; wherein, the candidate text sequence specifically refers to a text sequence corresponding to a text string that matches the pattern sequence of the pattern string at the bit level, that is, a text sequence of a text string hit by the pattern sequence of the pattern string.

[0096] Based on this, in the process of preliminary matching at the sequence level, if there is no bit in the text sequence of the text string that is the same as the pattern sequence of the pattern string, the text string can be skipped directly. If the bit hits, it means that the text sequence of the text string contains the bit of the pattern sequence of the pattern string, then the text string can be used as the candidate text string for further matching processing.

[0097] In the process of performing preliminary matching between the pattern sequence and the text sequence, it is actually to query whether there is a pattern sequence of the pattern string in the text sequence in a bitwise manner. In this embodiment, the specific implementation method is as follows:

[0098] Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element;

[0099] A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as the candidate sequence.

[0100] Specifically, the sequence element specifically refers to the smallest element in the pattern sequence, that is, 0 or 1 in the pattern sequence, and the arrangement order of each sequence element specifically refers to the arrangement order of 0 and 1 representing the pattern string; based on this, after determining the sequence elements and the arrangement order of the sequence elements in the pattern sequence, a preliminary screening can be performed in the text sequence according to the sequence elements and the arrangement order of the sequence elements, and the text sequence that has sequence elements and is sorted according to the arrangement order of the sequence elements is used as the candidate sequence for subsequent processing operations.

[0101] In specific implementation, during the screening process, bit shifting can be used for fast matching. For example, if the bit length of the text string is 256 bits and the bit length of the pattern string is 64 bits, four bit shifts can be used to quickly determine whether the pattern string exists in the text string, thereby ensuring processing efficiency at the sequence level.

[0102] Further, after determining the candidate text sequence, in order to further ensure the matching accuracy between the pattern string and the text string, the candidate text sequence can be converted into a candidate text string, and then character-level matching can be performed. Before that, in order to ensure that the converted candidate text string is the text string before the conversion of the candidate text sequence, the second conversion module can be selected for processing. In this embodiment, the specific implementation method is as follows:

[0103] Determine the second conversion module corresponding to the first conversion module;

[0104] Input the candidate text sequence into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

[0105] Specifically, the second conversion module specifically refers to a conversion module with the same attributes as the first conversion module and in the reverse direction. That is, if the first conversion module can convert a string into a binary sequence, then the second conversion module can convert a binary sequence into a string, and the expression forms before and after the conversion are the same. For example, after the Chinese character "我" is processed by the first conversion module, the binary sequence 110001000010001 is obtained. Then, by processing the binary sequence 110001000010001 through the second conversion module, the Chinese character "我" can be obtained. That is to say, the first conversion module and the second conversion module have an inverse conversion relationship.

[0106] In addition, in order to avoid errors in the conversion relationship between the binary sequence and the string, as well as between the string and the binary sequence, the candidate text sequence can also be reversely converted according to the conversion relationship from the pattern string to the pattern sequence. In this embodiment, the specific implementation method is as follows:

[0107] Determine the conversion relationship according to the pattern string and the pattern sequence;

[0108] Based on the conversion relationship, convert the candidate text sequence into the candidate text string.

[0109] Specifically, the conversion relationship specifically refers to the conversion relationship from the pattern string to the pattern sequence. When using this conversion relationship, the candidate text sequence can be reversely processed in an inverse manner to obtain the candidate text string corresponding to the candidate text sequence.

[0110] Continuing with the above example, after obtaining the pattern string "reply" and the bits of each text string, a preliminary screening will be performed at the bit level, that is, the bits of the pattern string "reply" (101011011011110101100100001101) will be matched with the bits of each text string. If the bits of the text string contain the bits of the pattern string, the text string will be determined as a candidate text string. If the bits of the pattern string do not exist, it will be skipped directly. Through screening, the candidate text strings are determined to include {low-level health recovery potion, intermediate health recovery potion, advanced health recovery potion, special-level health recovery potion, low-level mana recovery potion, intermediate mana recovery potion, advanced mana recovery potion, special-level mana recovery potion}. After determining the subsequent text strings, the character-level matching processing operation will be performed.

[0111] In summary, by performing preliminary screening at the sequence level, not only can the matching efficiency of text strings and pattern strings be improved, but also the matching accuracy can be guaranteed, and then the candidate text strings can be preliminarily screened out for subsequent matching processing operations at the character level.

[0112] Step S108: compare the pattern string with the candidate text string, and use the comparison result as a response to the search request.

[0113] Specifically, on the basis of the above-mentioned determination of the candidate text strings, it is further determined at this time that the candidate text strings are all text strings that are initially hit by the pattern string, that is, the candidate text strings may contain the pattern string. At this time, further matching will be performed at the character level, that is, the pattern string and the candidate text string are compared. If the candidate text string contains the pattern string, the candidate text string containing the pattern string can be used as the target text string and respond to the search request, that is, to support the result of front-end processing; if the candidate text strings do not contain the pattern string, the information that the text string containing the pattern string is not found can be used as a response to the search request.

[0114] Furthermore, in the character-level comparison process, the pattern string and the candidate text string may be compared according to a preset pattern matching algorithm. In this embodiment, the specific implementation is as follows:

[0115] Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm;

[0116] If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

[0117] Specifically, the preset pattern matching algorithm can be a BM algorithm or a KMP algorithm, wherein the BM algorithm refers to a method of aligning the text string with the head of the pattern string, searching from the tail, and then directly comparing from the tail, that is, through the bad character rule and the good suffix rule, wherein the bad character rule refers to comparing the last character of the pattern string with the character corresponding to the last character of the pattern string in the text string. If the two characters do not match, the character in the text string is determined to be a bad character. At this time, it can be determined that the pattern string cannot be found at the current position, and the pattern string is directly moved to the back of the bad character and compared again. If there is still inconsistency, but the character in the current position of the text string can be found in the pattern string, the same characters in the pattern string and the text string can be aligned. This process is the bad character rule; and the good suffix rule means that when it is determined that the n characters of the suffix of the pattern string and the n characters of the text string are aligned and matched, the aligned characters are determined as good suffixes, and then the characters before the good suffix characters are matched with the characters at the corresponding positions of the text string. If they do not match, the character is determined to be a bad character. At this time, the number of bits moved back is the position of the good suffix minus the last occurrence position in the search term, thereby improving the matching efficiency.

[0118] When the KMP algorithm matches the pattern string and the text string, it ensures that if the match fails, the text string does not backtrack, that is, the displacement mark i on the text string remains unchanged, and the pattern string moves backward by a certain position, and so on until the match is completed or the match is successful, thereby determining that the match is completed.

[0119] Furthermore, after determining the response to the search request, the target information can be further determined for the search instruction according to the response information and fed back to the client. In this embodiment, the specific implementation method is as follows:

[0120] Determining a limiting request according to the search instruction;

[0121] Determining a target text string corresponding to the restriction request from among the candidate text strings, and determining target information based on the target text string;

[0122] The target information is sent to the client as a response to the search instruction.

[0123] Specifically, the restriction request specifically refers to the restriction conditions for screening the target text string from the candidate text strings, and the target information specifically refers to the information fed back to the client in response to the search instruction for display to the user.

[0124] Based on this, when it is determined that the response to the search request is a candidate text string, it means that the candidate text string contains the pattern string. At this time, the candidate text string can be screened according to the limited request determined by the search instruction to obtain the target text string, and the target information is determined based on the target text string. Finally, the target information is sent to the client as a response to the search instruction.

[0125] Using the above example, when the candidate text string is determined to be {low-level health recovery potion, intermediate-level health recovery potion, advanced health recovery potion, special-level health recovery potion, low-level mana recovery potion, intermediate mana recovery potion, advanced mana recovery potion, special-level mana recovery potion}, the BM algorithm or KMP algorithm is used to match the pattern string and the candidate text string, and it is determined that the candidate text string contains the pattern string. Then, the candidate text string can be used as a response to the search request, and then the pattern string can be matched to the player's request. The search instruction submitted is parsed to determine that the player needs to select a health recovery item, then {low-level health recovery potion, intermediate-level health recovery potion, advanced health recovery potion, special-level health recovery potion} is determined as the target text string in the candidate text string, and then the information corresponding to the four items of low-level health recovery potion, intermediate-level health recovery potion, advanced health recovery potion and special-level health recovery potion is sent to the client, and the client displays the product information of the four potions to the player for the player to purchase and use.

[0126] The matching method provided in the present application, after obtaining a search request containing a pattern string, determines at least one text string corresponding to the pattern string, and then converts the text string and the pattern string simultaneously to obtain text sequences corresponding to each text string, and a pattern sequence corresponding to the pattern string, and then screens the candidate text sequences that match the pattern sequence in the text sequence, and determines the candidate text strings corresponding to the candidate text sequences, and then compares the pattern string with the text string to determine the response to the search request, so that in the scenario where the pattern string and the text string do not match a large number of times, the character matching efficiency can be improved by converting to the sequence level, so as to quickly respond to the search request and improve the processing efficiency of the front-end business.

[0127] The following combination Figure 2 , taking the application of the matching method provided in this application in a game scenario as an example, the matching method is further described. Figure 2 A processing flow chart of a matching method applied to a game scene provided by an embodiment of the present application is shown, which specifically includes the following steps:

[0128] Step S202: receiving a search instruction uploaded by the client, and creating a search request including a pattern string according to the search instruction.

[0129] Step S204 , selecting a text string corresponding to the pattern string, and determining a first character length of the pattern string and a second character length corresponding to the text string.

[0130] Step S206, determining whether the ratio of the second character length to the first character length is greater than a preset threshold, if so, executing step S208, if not, executing step S212.

[0131] Step S208, reading the text sequence corresponding to the text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string.

[0132] Step S210 , screening candidate text sequences matching the pattern sequence in the text sequence, and determining candidate text strings corresponding to the candidate text sequences.

[0133] Step S212: compare the pattern string and the candidate text string according to a preset pattern matching algorithm, and determine a response to the search request according to the comparison result.

[0134] Step S214: when the comparison result shows that the candidate text string contains the pattern string, the target text string is screened from the candidate text strings according to the search instruction.

[0135] Step S216, determining target information according to the target text string, and sending the target information to the client as a response to the search instruction.

[0136] The matching method provided in the present application, after obtaining a search request containing a pattern string, determines at least one text string corresponding to the pattern string, and then converts the text string and the pattern string simultaneously to obtain text sequences corresponding to each text string, and a pattern sequence corresponding to the pattern string, and then screens the candidate text sequences that match the pattern sequence in the text sequence, and determines the candidate text strings corresponding to the candidate text sequences, and then compares the pattern string with the text string to determine the response to the search request, so that in the scenario where the pattern string and the text string do not match a large number of times, the character matching efficiency can be improved by converting to the sequence level, so as to quickly respond to the search request and improve the processing efficiency of the front-end business.

[0137] Corresponding to the above method embodiment, the present application also provides a matching device embodiment, Figure 3 FIG. 1 is a schematic diagram showing the structure of a matching device provided by an embodiment of the present application. Figure 3 As shown, the device comprises:

[0138] The acquisition module 302 is configured to acquire a search request including a pattern string and determine at least one text string corresponding to the pattern string;

[0139] The conversion module 304 is configured to read a text sequence corresponding to the at least one text string, and convert the pattern string to obtain a pattern sequence corresponding to the pattern string;

[0140] A matching module 306 is configured to screen a candidate text sequence matching the pattern sequence in the text sequence, and determine a candidate text string corresponding to the candidate text sequence;

[0141] The response module 308 is configured to compare the pattern string with the candidate text string and use the comparison result as a response to the search request.

[0142] In an optional embodiment, the matching device further includes:

[0143] The receiving module is configured to receive a search instruction uploaded by a client; determine a search keyword according to the search instruction, and create a search request containing the pattern string based on the search keyword.

[0144] In an optional embodiment, the response module 308 is further configured to:

[0145] Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm;

[0146] If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

[0147] In an optional embodiment, the matching device further includes:

[0148] The sending module is configured to determine a restriction request according to the search instruction; determine a target text string corresponding to the restriction request in the candidate text string, and determine target information based on the target text string; and send the target information to the client as a response to the search instruction.

[0149] In an optional embodiment, the acquisition module 302 is further configured to:

[0150] Parsing the search request to obtain a pattern identifier corresponding to the pattern string;

[0151] A text string matching the pattern identifier is screened from a preset text string set as the at least one text string corresponding to the pattern string.

[0152] In an optional embodiment, the matching device further includes:

[0153] a length determination module configured to determine a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string; and determine whether a ratio of the second character length to the first character length is greater than a preset threshold;

[0154] If yes, the conversion module 304 is executed.

[0155] In an optional embodiment, the conversion module 304 is further configured to:

[0156] Determine a first conversion module according to the text sequence of the at least one text string;

[0157] The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

[0158] In an optional embodiment, the matching module 306 is further configured to:

[0159] Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element;

[0160] A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as the candidate sequence.

[0161] In an optional embodiment, the matching module 306 is further configured to:

[0162] Determining a second conversion module corresponding to the first conversion module;

[0163] The candidate text sequence is input into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

[0164] In an optional embodiment, the matching module 306 is further configured to:

[0165] Determine a conversion relationship according to the pattern string and the pattern sequence;

[0166] The candidate text sequence is converted into the candidate text string based on the conversion relationship.

[0167] The matching device provided by the present application, after obtaining a search request containing a pattern string, determines at least one text string corresponding to the pattern string, and then converts the text string and the pattern string simultaneously to obtain a text sequence corresponding to each text string, and a pattern sequence corresponding to the pattern string, and then screens the candidate text sequence matching the pattern sequence in the text sequence, and determines the candidate text string corresponding to the candidate text sequence, and then compares the pattern string with the text string to determine the response to the search request, so that in a scenario where a large number of pattern strings and text strings do not match, the character matching efficiency can be improved by converting to the sequence level, thereby quickly responding to the search request to improve the processing efficiency of the front-end business.

[0168] The above is a schematic scheme of a matching device of the present embodiment. It should be noted that the technical scheme of the matching device and the technical scheme of the matching method described above belong to the same concept. For details not described in detail in the technical scheme of the matching device, please refer to the description of the technical scheme of the matching method described above. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through a computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.

[0169] Figure 4 The block diagram of a computing device 400 according to an embodiment of the present application is shown. The components of the computing device 400 include but are not limited to a memory 410 and a processor 420. The processor 420 is connected to the memory 410 via a bus 430, and the database 450 is used to store data.

[0170] The computing device 400 also includes an access device 440 that enables the computing device 400 to communicate via one or more networks 460. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 440 may include one or more of any type of network interface (e.g., a network interface card (NIC)) wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.

[0171] In one embodiment of the present application, the above components of the computing device 400 and Figure 4Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 4 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.

[0172] Computing device 400 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 400 may also be a mobile or stationary server.

[0173] The processor 420 is used to execute the following computer executable instructions:

[0174] Obtaining a search request containing a pattern string, and determining at least one text string corresponding to the pattern string;

[0175] Reading a text sequence corresponding to the at least one text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string;

[0176] Screening a candidate text sequence matching the pattern sequence in the text sequence, and determining a candidate text string corresponding to the candidate text sequence;

[0177] The pattern string is compared with the candidate text string, and the comparison result is used as a response to the search request.

[0178] Optionally, before the step of obtaining a search request containing a pattern string is performed, the step further includes:

[0179] Receive search instructions uploaded by the client;

[0180] A search keyword is determined according to the search instruction, and a search request containing the pattern string is created based on the search keyword.

[0181] Optionally, comparing the pattern string with the candidate text string and using the comparison result as a response to the search request includes:

[0182] Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm;

[0183] If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

[0184] Optionally, after the step of comparing the pattern string with the candidate text string and taking the comparison result as a response to the search request, the method further includes:

[0185] Determining a limiting request according to the search instruction;

[0186] Determining a target text string corresponding to the restriction request from among the candidate text strings, and determining target information based on the target text string;

[0187] The target information is sent to the client as a response to the search instruction.

[0188] Optionally, determining at least one text string corresponding to the pattern string includes:

[0189] Parsing the search request to obtain a pattern identifier corresponding to the pattern string;

[0190] A text string matching the pattern identifier is screened from a preset text string set as the at least one text string corresponding to the pattern string.

[0191] Optionally, before the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string are performed, the method further includes:

[0192] Determining a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string;

[0193] Determining whether a ratio of the second character length to the first character length is greater than a preset threshold;

[0194] If so, execute the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string.

[0195] Optionally, the reading of the text sequence corresponding to the at least one text string, and converting the pattern string to obtain the pattern sequence corresponding to the pattern string, includes:

[0196] Determine a first conversion module according to the text sequence of the at least one text string;

[0197] The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

[0198] Optionally, screening the text sequence for a candidate text sequence matching the pattern sequence includes:

[0199] Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element;

[0200] A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as the candidate sequence.

[0201] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0202] Determining a second conversion module corresponding to the first conversion module;

[0203] The candidate text sequence is input into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

[0204] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0205] Determine a conversion relationship according to the pattern string and the pattern sequence;

[0206] The candidate text sequence is converted into the candidate text string based on the conversion relationship.

[0207] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the matching method described above are of the same concept, and the details of the technical scheme of the computing device not described in detail can be found in the description of the technical scheme of the matching method described above.

[0208] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used when executed by a processor to:

[0209] Obtaining a search request containing a pattern string, and determining at least one text string corresponding to the pattern string;

[0210] Reading a text sequence corresponding to the at least one text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string;

[0211] Screening a candidate text sequence matching the pattern sequence in the text sequence, and determining a candidate text string corresponding to the candidate text sequence;

[0212] The pattern string is compared with the candidate text string, and the comparison result is used as a response to the search request.

[0213] Optionally, before the step of obtaining a search request containing a pattern string is performed, the step further includes:

[0214] Receive search instructions uploaded by the client;

[0215] A search keyword is determined according to the search instruction, and a search request containing the pattern string is created based on the search keyword.

[0216] Optionally, comparing the pattern string with the candidate text string and using the comparison result as a response to the search request includes:

[0217] Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm;

[0218] If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

[0219] Optionally, after the step of comparing the pattern string with the candidate text string and taking the comparison result as a response to the search request, the method further includes:

[0220] Determining a limiting request according to the search instruction;

[0221] Determining a target text string corresponding to the restriction request from among the candidate text strings, and determining target information based on the target text string;

[0222] The target information is sent to the client as a response to the search instruction.

[0223] Optionally, determining at least one text string corresponding to the pattern string includes:

[0224] Parsing the search request to obtain a pattern identifier corresponding to the pattern string;

[0225] A text string matching the pattern identifier is screened from a preset text string set as the at least one text string corresponding to the pattern string.

[0226] Optionally, before the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string are performed, the method further includes:

[0227] Determining a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string;

[0228] Determining whether a ratio of the second character length to the first character length is greater than a preset threshold;

[0229] If so, execute the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string.

[0230] Optionally, the reading of the text sequence corresponding to the at least one text string, and converting the pattern string to obtain the pattern sequence corresponding to the pattern string, includes:

[0231] Determine a first conversion module according to the text sequence of the at least one text string;

[0232] The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

[0233] Optionally, screening the text sequence for a candidate text sequence matching the pattern sequence includes:

[0234] Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element;

[0235] A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as the candidate sequence.

[0236] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0237] Determining a second conversion module corresponding to the first conversion module;

[0238] The candidate text sequence is input into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

[0239] Optionally, determining a candidate text string corresponding to the candidate text sequence includes:

[0240] Determine a conversion relationship according to the pattern string and the pattern sequence;

[0241] The candidate text sequence is converted into the candidate text string based on the conversion relationship.

[0242] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the matching method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be found in the description of the technical scheme of the matching method described above.

[0243] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0244] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0245] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0246] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0247] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.

Claims

1. A matching method, It is characterized in that include: Obtaining a search request containing a pattern string, parsing the search request, and obtaining a pattern identifier corresponding to the pattern string; Selecting a text string matching the pattern identifier from a preset text string set as at least one text string corresponding to the pattern string; Reading a text sequence corresponding to the at least one text string, and converting the pattern string to obtain a pattern sequence corresponding to the pattern string, wherein the pattern sequence refers to a sequence obtained by binary conversion of the pattern string, and the text sequence refers to a sequence obtained by binary conversion of the text string; Screening a candidate text sequence matching the pattern sequence in the text sequence, and determining a candidate text string corresponding to the candidate text sequence; The pattern string is compared with the candidate text string, and the comparison result is used as a response to the search request.

2. The matching method according to claim 1, It is characterized in that Before the step of obtaining a search request containing a pattern string is executed, the method further includes: Receive search instructions uploaded by the client; A search keyword is determined according to the search instruction, and a search request containing the pattern string is created based on the search keyword.

3. The matching method according to claim 2, It is characterized in that The step of comparing the pattern string with the candidate text string and using the comparison result as a response to the search request includes: Comparing the pattern string with the candidate text string according to a preset pattern matching algorithm; If the comparison result shows that the candidate text string contains the pattern string, the candidate text string is selected as a response to the search request.

4. The matching method according to claim 3, It is characterized in that After the step of comparing the pattern string with the candidate text string and taking the comparison result as a response to the search request is executed, the method further includes: Determining a limiting request according to the search instruction; Determining a target text string corresponding to the restriction request from among the candidate text strings, and determining target information based on the target text string; The target information is sent to the client as a response to the search instruction.

5. The matching method according to claim 1, It is characterized in that Before the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string are performed, the method further includes: Determining a first character length corresponding to the pattern string and a second character length corresponding to the at least one text string; Determining whether a ratio of the second character length to the first character length is greater than a preset threshold; If so, execute the steps of reading the text sequence corresponding to the at least one text string and converting the pattern string to obtain the pattern sequence corresponding to the pattern string.

6. The matching method according to claim 1 or 5, It is characterized in that The reading of the text sequence corresponding to the at least one text string, and converting the pattern string to obtain the pattern sequence corresponding to the pattern string, includes: Determining a first conversion module according to the at least one text string or the text sequence, wherein the first conversion module refers to a module capable of converting a pattern string or a text string into a binary sequence; The pattern string is input into the first conversion module for processing, and the pattern sequence corresponding to the pattern string output by the first conversion module is obtained.

7. The matching method according to claim 1, It is characterized in that The step of screening the candidate text sequence matching the pattern sequence in the text sequence includes: Determine a plurality of sequence elements included in the pattern sequence, and an arrangement order of each sequence element; A text sequence having the same sequence elements and the same arrangement order as the plurality of sequence elements is selected from the text sequence as a candidate sequence.

8. The matching method according to claim 6, It is characterized in that The determining of a candidate text string corresponding to the candidate text sequence includes: Determine a second conversion module corresponding to the first conversion module, wherein the second conversion module refers to a conversion module having the same attributes as the first conversion module and inversely related to the first conversion module; The candidate text sequence is input into the second conversion module for processing to obtain the candidate text string output by the second conversion module.

9. The matching method according to claim 1, It is characterized in that The determining of a candidate text string corresponding to the candidate text sequence includes: Determine a conversion relationship according to the pattern string and the pattern sequence; The candidate text sequence is converted into the candidate text string based on the conversion relationship.

10. A matching device, It is characterized in that include: An acquisition module is configured to acquire a search request containing a pattern string, parse the search request, and obtain a pattern identifier corresponding to the pattern string; Selecting a text string matching the pattern identifier from a preset text string set as at least one text string corresponding to the pattern string; a conversion module configured to read a text sequence corresponding to the at least one text string, and convert the pattern string to obtain a pattern sequence corresponding to the pattern string, wherein the pattern sequence refers to a sequence obtained by performing binary conversion on the pattern string, and the text sequence refers to a sequence obtained by performing binary conversion on the text string; a matching module configured to screen a candidate text sequence matching the pattern sequence in the text sequence, and determine a candidate text string corresponding to the candidate text sequence; The response module is configured to compare the pattern string with the candidate text string and use the comparison result as a response to the search request.

11. A computing device, It is characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the matching method according to any one of claims 1 to 9.

12. A computer-readable storage medium storing computer instructions, It is characterized in that When the instruction is executed by a processor, the steps of the matching method described in any one of claims 1 to 9 are implemented.