Searching method and device, electronic equipment, computer readable storage medium and computer program product
By employing a multi-level search method based on pinyin strings and semantic vector supplementation, the issues of rapid response and high accuracy in mixed Chinese and English query scenarios are resolved, resulting in efficient and accurate search result output.
Patent Information
- Application Number
- CN202511443328.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-09
- Publication Date
- 2026-01-02
AI Technical Summary
Existing technologies struggle to balance fast response, high fault tolerance, and high accuracy in mixed Chinese and English query scenarios, especially when searching for terms with symbols, and they also exhibit uneven resource consumption.
By constructing pinyin strings for multi-level searching and supplementing with semantic vectors, dynamic scheduling of pinyin and semantic levels is achieved. Low-resource-consumption levels are prioritized, while high-resource levels are activated as needed to obtain the target search results.
It improves search response speed, result accuracy, and fault tolerance, ensuring the accuracy and completeness of search results and adapting to diverse scenario needs.
Smart Images

Figure CN121256016A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a search method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] In fields such as development tools, technical documentation platforms, and enterprise knowledge bases, the complexity of users' daily search scenarios is constantly increasing. The demand for queries mixing Chinese and English content with technical symbols is becoming increasingly frequent. Such mixed queries containing special symbols have become the mainstream and high-frequency search format in these fields. Furthermore, users often make errors in pinyin input due to input habits and spelling memory biases. Simultaneously, users' demands for a superior search experience are continuously rising. They require search systems to return results quickly to avoid delays, ensure accurate matching of symbolic terms, and be compatible with various biases to ensure that even with input errors, they can still obtain the expected accurate results. Based on this, existing search methods in related technologies are increasingly unable to meet user needs in terms of scenario adaptability, input error tolerance, and result accuracy. Summary of the Invention
[0003] This application provides a search method, apparatus, computer-readable storage medium, and computer program product that can first construct strings based on pinyin for multi-level searching, and then supplement the search with semantic vectors when the results are insufficient, thereby improving search efficiency and search result coverage.
[0004] The technical solution of this application embodiment is implemented as follows: This application provides a search method, the method comprising: In response to receiving input information for data search, and determining that the input information includes at least one Chinese character, the pinyin string corresponding to each Chinese character is determined; Based on each of the pinyin strings, a first string corresponding to the input information is constructed, and at least two levels of search processing are performed on the first string to obtain a first result set. Different levels of search processing correspond to different search precisions. When the first number of first search results included in the first result set is less than the first threshold, semantic analysis processing is performed on the input information to obtain the first semantic vector corresponding to the input information, and search processing is performed based on the first semantic vector to obtain the second result set. The target search result is determined based on the first result set and the second result set, and then the target search result is output.
[0005] This application provides a search device, including: The determining module is configured to, in response to receiving input information for data search and determining that the input information includes at least one Chinese character, determine the pinyin string corresponding to each Chinese character; The search module is used to construct a first string corresponding to the input information based on each of the pinyin strings, and to perform at least two levels of search processing based on the first string to obtain a first result set. Different levels of search processing correspond to different search precision. The search module is further configured to perform semantic analysis processing on the input information when the first number of first search results included in the first result set is less than a first threshold, to obtain a first semantic vector corresponding to the input information, and to perform search processing based on the first semantic vector to obtain a second result set. The determining module is further configured to determine the target search result based on the first result set and the second result set, and output the target search result.
[0006] This application provides an electronic device, the electronic device comprising: Memory is used to store executable instructions or computer programs. The processor, when executing computer-executable instructions or computer programs stored in the memory, implements the search method provided in the embodiments of this application.
[0007] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the search method provided in this application when executed by a processor.
[0008] This application provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements the search method provided in this application.
[0009] The embodiments of this application have the following beneficial effects: In this embodiment, in response to receiving input information for data search and determining that the input information includes at least one Chinese character, a pinyin string corresponding to each Chinese character is determined; a first string corresponding to the input information is constructed based on each pinyin string, and at least two levels of search processing are performed based on the first string to obtain a first result set, with different levels of search processing corresponding to different search precisions. Thus, by converting Chinese characters into pinyin strings to construct the first string, it can adapt to the user's possible pinyin input habits. Simultaneously, by utilizing different levels of search precision (such as exact matching and fuzzy error tolerance), it ensures a fast response to accurate input while also being compatible with pinyin input deviations, improving adaptability to mixed query scenarios containing Chinese characters. Furthermore, prioritizing results obtained through pinyin-level search reduces resource-intensive semantic computation calls, ensuring search efficiency. Subsequently, when the first number of first search results included in the first result set is less than a first threshold, semantic analysis processing is performed on the input information to obtain a first semantic vector corresponding to the input information, and search processing is performed based on the first semantic vector to obtain a second result set. In this way, by supplementing the search with semantic vector search, more relevant results can be retrieved from a semantic association perspective when the search results at the two levels are insufficient. This avoids the omission of effective information due to the limitations of pinyin matching, further improving the search recall rate. Simultaneously, activating the semantic layer on demand balances resource consumption and search performance while ensuring the completeness of the results. Finally, the target search result is determined based on the first and second result sets and output. By integrating the results of different search methods, the efficiency and accuracy of pinyin-level search are retained, while supplementary information from semantic search is incorporated. This ensures that the output target result balances accuracy, completeness, and scenario adaptability, thereby improving search response speed, result precision, and fault tolerance. Attached Figure Description
[0010] Figure 1 This is a schematic diagram of the structure of the search system provided in the embodiments of this application; Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application; Figure 3A This is a flowchart illustrating the search method provided in an embodiment of this application; Figure 3B This is a schematic diagram of the process for constructing the first result set provided in an embodiment of this application; Figure 3C This is another schematic diagram of the process for constructing the first result set provided in the embodiments of this application; Figure 3D This is another schematic diagram of the process for constructing the first result set provided in the embodiments of this application; Figure 3EThis is a schematic diagram of the process for constructing the second result set provided in an embodiment of this application; Figure 3F This is a schematic diagram of the process for determining the target search result provided in an embodiment of this application; Figure 3G This is another flowchart illustrating the process of determining target search results provided in an embodiment of this application; Figure 4 This is a schematic diagram of the step-by-step completion process of search results provided in the embodiments of this application; Figure 5 This is a flowchart illustrating the precise Chinese search provided in the embodiments of this application; Figure 6 This is a flowchart illustrating the mixed Chinese and English search process provided in an embodiment of this application; Figure 7 This is a schematic diagram of the semantic completion search process provided in the embodiments of this application; Figure 8 This is a schematic diagram of the English search process provided in the embodiments of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0012] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0013] In the following description, the terms “first,” “second,” “third,” etc., are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first,” “second,” “third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0014] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0015] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0016] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0017] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0018] 1) Responding to: used to indicate the conditions or states on which the operation is performed depends. When the conditions or states on which it depends are met, one or more operations can be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0019] 2) Exact Search: Exact search refers to a search method that requires a "complete match" condition during the search process. Specifically, the user enters a query string that exactly matches the target content's pinyin stored in the index (e.g., "shen_du_xue_xi" and "shen_du_xue_xi"), or the user enters a query string that exactly matches a substring of the target content's pinyin stored in the index (e.g., "shen_du_xue_xi" and "shen_du_xue_xi_kuang_jia").
[0020] 3) Fuzzy Search: Fuzzy search is a search method with "error tolerance," allowing users to input pinyin that differs somewhat from the target content in the index, while still returning results that meet the similarity requirements. Its core function is to solve the problem of search failures caused by user pinyin input errors or accent differences, thereby improving the flexibility and success rate of the search.
[0021] 4) Dual-channel Pinyin Index: A hash mapping index system built to adapt to different input habits. Its core is to simultaneously convert Chinese display names into two types of index keys: "full Pinyin string" and "initial abbreviation string," corresponding to two search channels (full Pinyin channel and initial abbreviation channel). The full Pinyin string retains the original non-Chinese characters and symbols (e.g., "Data_loader node" is converted to "Data_loader_jie_dian"), while the initial abbreviation string extracts the first letter of the full Pinyin (e.g., "deep learning" is extracted as "sdxx"). Both types of index keys establish a hash mapping relationship with the target content. The full Pinyin channel supports Pinyin variant matching, while the initial abbreviation channel supports fast abbreviation search, jointly covering diverse scenarios such as "full Pinyin input" and "abbreviated input," achieving a balance between search efficiency and coverage.
[0022] 5) Three-level trigger-based search strategy: This is a dynamic decision-making mechanism that activates search levels according to priority. The core logic is to first obtain results through the low-resource-consumption search level, and then decide whether to activate the high-resource-consumption level based on the amount of result gap. It is divided into three levels: The first level is the "precise search layer", which prioritizes the use of the initial letter channel and the full pinyin channel for precise matching and quickly returns high-accuracy results; the second level is the "fuzzy search layer", which activates fuzzy matching if the number of precise search results is less than the expected number, and supplements the results after the pinyin error tolerance; the third level is the "semantic search layer", which activates semantic vector search to supplement semantically relevant results if there are still gaps in the results of the first two levels.
[0023] 6) Dynamic gap filling system: This is a mechanism for scheduling subsequent search resources based on the real-time result gap. The core is to first calculate "gap amount = expected number of results - current number of results obtained," and then dynamically determine whether to activate the next search level and the scale of resource allocation based on the gap amount. Its core function is to avoid wasting search resources, achieve "on-demand gap filling," and balance search efficiency with resource costs.
[0024] In the fields of development tools and technical documentation platforms, hybrid search solutions for related technologies can be mainly divided into three categories: The first type is the word segmentation + semantic search scheme. After receiving the original query, the system segments the Chinese fragment to obtain a set of word units, while retaining English terms and abbreviations. These are then merged into a list of search units. After stop word filtering, synonym expansion, and weight allocation, the search proceeds in two directions: one direction encodes the units into vectors and calculates document vector similarity to recall semantic candidates; the other direction uses the word unit index for high-speed and accurate recall. Finally, duplicates are removed and the results are merged, then reordered and output according to a comprehensive score. Mixed-language queries do not require branch processing. This scheme has two major drawbacks: first, queries with close Chinese-English connections (such as "convolutional neural network training") are prone to word segmentation boundary errors, failing to correlate semantics and leading to a decrease in recall; second, semantic vector search and word unit index maintenance consume high resources, resulting in response latency in high-concurrency scenarios, making it difficult to meet search speed requirements.
[0025] The second type is the Pinyin conversion scheme. The system converts the query Chinese characters to full Pinyin (English, numbers, and non-Chinese symbols remain unchanged), forming a "Pinyin-based query string." During this process, word boundaries are standardized and polyphonic characters are disambiguated. Based on a pre-built Pinyin index, precise matching is performed, returning only results that match the full Pinyin (or conform to standard rules). Matching results are sorted by matching degree; if other channels are available, they are merged and reordered, and the output is used to fill in the original text. If no results are found, a backup search is triggered, with the main path being "full Pinyin precise matching." The drawbacks of this scheme are limited fault tolerance and scenario coverage: it fails to match when users input incorrect Pinyin or only enter initial abbreviations, resulting in a poor user experience; it does not specially handle technical symbols (such as @ and _), and terms with symbols only retain the symbols without associated indexes, easily leading to "symbol interference matching" and reduced accuracy.
[0026] The third type is the symbol-ignoring fuzzy search scheme. In a specified text field, the system preprocesses the query and indexed text (unifying case, removing meaningless symbols, standardizing full-width / half-width characters, etc.); it enables "edit distance constraint" fuzzy matching, allowing a maximum of two character-level differences to still be considered a match; documents meeting the threshold are sorted by score based on difference degree, field weight, etc., and other channels are merged, deduplicated, and then presented in a global strategy. The drawbacks of this scheme are "over-fuzziness" and "improper symbol handling": it fails to distinguish between "pinyin differences" and "character differences," potentially leading to mismatches of semantically irrelevant English terms in Chinese pinyin queries, reducing accuracy; ignoring all technical symbols means that "different symbol forms of the same term" cannot be identified as the same target, lowering recall and accuracy.
[0027] This reveals three common problems with current related technologies: First, they lack specific logic for complex scenarios involving "Chinese and English + technical symbols," making it difficult to cover core search needs. Second, they struggle to balance efficiency and fault tolerance, failing to simultaneously meet the requirements of "fast response, high fault tolerance, and high accuracy." Third, they lack symbol processing mechanisms, failing to achieve accurate searches for "symbolic terms," which are frequently searched in development tools and technical documentation platforms, resulting in poor search performance for such information.
[0028] This application provides a search method, apparatus, device, computer-readable storage medium, and computer program product. It can first construct a string based on Pinyin for multi-level searching, and then supplement the search with semantic vectors when the results are insufficient, thereby improving search efficiency and search result coverage. The following describes exemplary applications of the electronic devices provided in this application. These electronic devices can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or as servers. The following will describe exemplary applications when the electronic device is implemented as a server.
[0029] See Figure 1 , Figure 1 This is a schematic diagram of the structure of the search system provided in the embodiments of this application. Figure 1 The system involves a database 100, a server 200, a network 300, and a terminal 400. Terminal 400 is connected to server 200 via network 300, which can be a wide area network (WAN), a local area network (LAN), or a combination of both. The first, second, and third candidate sets can be stored in database 100. Database 100 can be independent of server 200 or deployed on server 200. Figure 1 The database 100 is shown as an example, independent of the server 200.
[0030] like Figure 1As shown, terminal 400 is used to receive input information for data search from a user and send the input information to server 200 via network 300. Server 200, in response to receiving the input information from terminal 400 via network 300, first determines whether the input information contains at least one Chinese character; if so, it determines the pinyin string corresponding to each Chinese character; it constructs a first string corresponding to the input information based on all pinyin strings; then, it retrieves a first candidate set, a second candidate set, and a third candidate set from database 100, and performs at least two levels of search processing based on the first string in the first, second, and third candidate sets to obtain a first result set; next, it counts the first number of first search results in the first result set; if this number is less than a first threshold, it performs semantic analysis processing on the input information to generate a corresponding first semantic vector, performs search processing based on the first semantic vector, and obtains a second result set; finally, it merges the first result set and the second result set to determine the target search result and sends the target search result to terminal 400 via network 300. Terminal 400 receives the target search result returned by server 200 and displays it to the user through display interface 410.
[0031] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.
[0032] In some embodiments, when the electronic device is implemented as a terminal, the terminal 400 receives input information for data search from a user, first determines whether the input information contains at least one Chinese character, and if so, determines the pinyin string corresponding to each Chinese character; constructs a first string corresponding to the input information based on all pinyin strings; then, obtains a first candidate set, a second candidate set, and a third candidate set from the local storage space of the terminal 400, and performs at least two levels of search processing based on the first string in the first candidate set, the second candidate set, and the third candidate set to obtain a first result set; next, counts the first number of first search results in the first result set, and if the number is less than a first threshold, performs semantic analysis processing on the input information to generate a corresponding first semantic vector, performs search processing based on the first semantic vector to obtain a second result set; finally, merges the first result set and the second result set to determine the target search result, and then outputs the target search result.
[0033] Taking the server mentioned above as an example, which is the electronic device used for the search, see [link to example]. Figure 2 , Figure 2 This is a schematic diagram of the structure of the server 200 provided in the embodiments of this application. Figure 2 The server 200 shown includes at least one processor 210, memory 230, and at least one network interface 220. The various components of server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 240.
[0034] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0035] The memory 230 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 230 may optionally include one or more storage devices physically located away from the processor 210.
[0036] The memory 230 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 230 described in this application embodiment is intended to include any suitable type of memory.
[0037] In some embodiments, memory 230 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0038] Operating system 231 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks; The network communication module 232 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0039] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A search device 233 stored in memory 230 is shown. This device can be software in the form of programs and plug-ins, and includes the following software modules: a determination module 2331 and a search module 2332. These modules are logically related and can therefore be arbitrarily combined or further divided according to their implemented functions. The functions of each module will be described below.
[0040] In other embodiments, the apparatus provided in this application can be implemented in hardware. As an example, the apparatus provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the search method provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0041] The search method provided in this application will be described in conjunction with exemplary applications and implementations of the server provided in the embodiments of this application.
[0042] The search method provided in the embodiments of this application will be described below. As mentioned above, the electronic device implementing the search method of the embodiments of this application can be a terminal, a server, or a combination of both. Therefore, the executing entity of each step will not be described again below.
[0043] It should be noted that in the examples of the search method below, the "technical term search" in the development tool (such as querying "data loader node" to obtain the description of the corresponding function module) and the "document content search" on the technical document platform (such as querying "convolutional neural network training steps" to obtain relevant tutorial documents) are used as examples for illustration. In addition, those skilled in the art can apply the search method provided in the embodiments of the present application to the processing of more scenarios according to the understanding of the following text. For example, enterprise internal knowledge base search, such as querying "revision of employee attendance system" to obtain system documents containing Chinese fields, quickly locating the core Chinese content through pinyin level search, and semantic search to supplement relevant descriptions; educational resource platform search, such as querying "mathematical function image drawing" to obtain teaching courseware with Chinese annotations, using multi-precision pinyin search to match user input deviations, and semantic search to expand similar teaching cases; e-commerce product information search, such as querying "intelligent watch battery life parameters" to obtain product details with Chinese specifications, accurately matching Chinese keywords through pinyin search, and semantic search to supplement recommendations for products with similar functions.
[0044] See Figure 3A , Figure 3A is a schematic flowchart of the search method provided in the embodiments of the present application, which will be described in conjunction with Figure 3A the steps shown.
[0045] In step 101, in response to receiving input information for data search and determining that the input information includes at least one Chinese character, determine the pinyin string corresponding to each Chinese character.
[0046] Here, the "input information" refers to the text content submitted by the user when initiating data search, such as "data loading node", "image recognition tutorial", etc. The "Chinese character" refers to Chinese characters and characters used in Chinese, such as "数", "据", "加" all belong to Chinese characters; the "pinyin string" refers to the pure letter pinyin without tone marks corresponding to Chinese characters, such as "数" corresponds to "shu", "据" corresponds to "ju". This step is to first determine whether the input text contains at least one Chinese character or Chinese character in Chinese after receiving the user's search text. If it contains, match the corresponding pure letter pinyin text for each Chinese character. For example, when receiving the input information "deep learning", it is determined that "深", "度", "学", "习" are all Chinese characters, and then the pinyin strings corresponding to them are determined to be "shen", "du", "xue", "xi" respectively. In addition, the input information may also include the number of search results expected by the user, which is a positive integer, such as 5, 8, etc., indicating that the user expects to finally obtain these numbers of search results.
[0047] In step 102, a first string corresponding to the input information is constructed based on each pinyin string, and at least two levels of search processing are performed based on the first string to obtain a first result set. Different levels of search processing correspond to different search precisions.
[0048] Here, "first string" refers to the complete string formed by combining the pinyin strings corresponding to all Chinese characters in the input information in the original character order; it is a full pinyin string. Furthermore, when there are at least two Chinese characters, a separator such as an underscore "_" or a space will be used between adjacent Chinese characters. For example, the first string corresponding to the input "deep learning" is "shen_du_xue_xi". "At least two levels of search processing" refers to two or more types of retrieval operations with different search precision. "Search precision" refers to the degree of matching between the search results and the input information; higher precision means stricter matching requirements. At least two levels of search processing can include two or more of the following: full pinyin precise search, first pinyin precise search, Chinese fuzzy search, full pinyin fuzzy search, and first pinyin fuzzy search. Among them, full-spell precise search refers to the first string and the full-spell string of the candidate content meeting the precise search criteria, that is, the first string and the full-spell string of the candidate content are completely identical, such as "shen_du_xue_xi" and "shen_du_xue_xi", or the first string and the substring of the full-spell string of the candidate content are completely identical, such as "shen_du_xue_xi" and "shen_du_xue_xi_kuang_jia"; first-spell precise search refers to the first-spell string constructed based on the first string meeting the precise search criteria; first-spell fuzzy search refers to the first-spell string constructed based on the first string meeting the fuzzy search criteria. Among them, "meeting the fuzzy search criteria" means that although the two compared data do not meet the precise search criteria, their similarity is greater than a preset similarity threshold, or the number of different characters between them is less than a preset number, that is, there is a certain difference between them, but the difference is within the specified range (such as "shen_du_xue_yi" and "shen_du_xue_xi"). Chinese fuzzy search refers to the Chinese characters in the input information and the Chinese characters in the candidate content meeting the fuzzy search criteria. First-letter fuzzy search refers to a partial match between the first-letter string constructed based on the first string and the first-letter string of the candidate content, meeting the fuzzy search criteria. "First result set" refers to the set of all search results related to the input information after at least two levels of searching. This step involves first combining the pinyin strings of each Chinese character into a first string in the original input order, then performing at least two different matching strictness retrieval operations on this first string, and finally integrating all results that meet the criteria into the first result set.
[0049] In some embodiments, when the input information further includes non-Chinese characters, "constructing the first string corresponding to the input information based on each pinyin string" in step 102 can be implemented through the following process, including: Determine the non-Chinese characters from the input information, and determine the position information corresponding to each character in the input information; based on the position information, perform splicing processing on each pinyin string and non-Chinese character to obtain the first string.
[0050] Here, "non-Chinese characters" refer to other characters except Chinese characters, such as English characters (such as each character in "Data_loader"), numbers (such as "5"), technical symbols (@, _), etc. "Position information" refers to the sequential position of each character in the input information, usually identified by numbers. For example, in the input "Data_loader node", "D" is in the 1st position, "a" is in the 2nd position, and "节" is in the 12th position. "Splicing processing" refers to the operation of combining the pinyin string and non-Chinese characters into a complete string according to their original position order. This process is when the input information contains non-Chinese characters, first filter out these non-Chinese characters and record the sequential position of each character in the input information, and then combine the pinyin string corresponding to the Chinese characters and non-Chinese characters in sequence according to the original position order to form the first string. For example, for the input information "Data_loader node", where "Data_loader" is a non-Chinese character and "节" and "点" are Chinese characters; first determine that the position of the non-Chinese character "Data_loader" is from the 1st to the 11th position, and the positions of "节" and "点" are from the 12th to the 13th position, and "节" corresponds to the pinyin "jie" and "点" corresponds to the pinyin "dian"; then splice according to the position order and separate with an underscore to obtain the first string "Data_loaderjie_dian". Among them, during the splicing process, the non-Chinese characters and Chinese characters can also be separated by an underscore, such as "Data_loader_jie_dian".
[0051] In the embodiments of the present application, when the input information further includes non-Chinese characters, first extract the non-Chinese characters from the input information and record the position information corresponding to each character in the input information; then based on this position information, perform splicing processing on each pinyin string and non-Chinese character to finally obtain the first string. In this way, it can ensure that the position and semantics of non-Chinese characters are not lost, improve the accuracy of the first string in the mixed character input scenario, and thus improve the accuracy of subsequent searches.
[0052] In some embodiments, when symbol characters are included in non-Chinese characters, the step of "performing splicing processing on each pinyin string and non-Chinese characters based on the position information to obtain the first string" in the above embodiments can be implemented through the following process, including: Determine the symbol identifier corresponding to the symbol character from a preset symbol mapping table; update the symbol characters in the non-Chinese characters with the symbol identifiers to obtain the updated non-Chinese characters; perform splicing processing on each pinyin string and the updated non-Chinese characters based on the position information to obtain the first string.
[0053] Here, "symbol character" refers to technical symbols, punctuation marks, etc. in non-Chinese characters, such as @, +, #, etc. The "preset symbol mapping table" refers to a pre-configured comparison table that records symbol characters and their corresponding symbol identifiers. For example, in the mapping table, "@" corresponds to "AT_SYM", and "_" corresponds to "UNDERLINE_SYM". "Symbol identifier" refers to a dedicated marked text (such as a token mark) set for the symbol character for easy retrieval and identification. The "updated non-Chinese characters" refer to the character combination after replacing the symbol characters in the non-Chinese characters with the corresponding symbol identifiers. This process is when non-Chinese characters contain symbol characters. First, find the dedicated mark corresponding to each symbol character from the pre-configured symbol mapping table, then replace the original symbol characters with these marks, and finally splice the pinyin string and the replaced non-Chinese characters in the original position order to form the first string. For example, for the input information "model@v1 training", where "@" is a symbol character, and in the preset symbol mapping table, "@" corresponds to "AT_SYM". First, update the "@" in "model@v1" to "AT_SYM" to get "modelAT_SYMv1". The Chinese characters "训" and "练" correspond to the pinyin "xun" and "lian", and "modelAT_SYMv1" is located at positions 1-9, and "训" and "练" are located at positions 10-11. Splicing according to the positions gives the first string "modelAT_SYMv1xun_lian".
[0054] In the embodiments of the present application, when symbol characters are included in non-Chinese characters, it is also necessary to determine the symbol identifier corresponding to the symbol character from a preset symbol mapping table, then update the symbol characters in the non-Chinese characters with the symbol identifiers to obtain the updated non-Chinese characters; then perform splicing processing on each pinyin string and the updated non-Chinese characters based on the position information to obtain the first string. In this way, the standardized processing of symbol characters is achieved, avoiding symbol interference in search matching, and improving the retrieval adaptability of the first string in the scenario of input with symbols.
[0055] In some embodiments, refer to Figure 3BThe step 102, "performing at least two levels of search processing based on the first string to obtain the first result set," can be implemented through steps 1021 to 1024, including: In step 1021, based on the first string, a first-level search process is performed in the first candidate set to obtain a third result set. The first candidate set includes multiple candidate strings and a second string corresponding to each candidate string. The second string is constructed based on the pinyin strings corresponding to the Chinese characters included in the candidate strings.
[0056] Here, "first candidate set" refers to a pre-constructed set storing multiple candidate search contents (candidate strings) and their corresponding pinyin strings (second strings); "candidate string" refers to the text content stored in the first candidate set that may become search results, such as "deep learning course" or "data loading method"; "second string" refers to the string constructed by matching the pinyin of the Chinese characters in the candidate string, constructed in the same way as the first string, such as the second string corresponding to the candidate string "deep learning course" being "shen_du_xue_xi_ke_cheng"; "first-level search processing" refers to the first stage of retrieval operations, usually a full pinyin precise search. "Third result set" refers to the set of candidate strings filtered after the first-level search. This step uses the first string to perform the first-stage search in the first candidate set, finding content in the candidate strings whose second string matches the first string; this content constitutes the third result set. For example, if the first string is "shen_du_xue_xi", the second string corresponding to "deep learning" in the first candidate set is "shen_du_xue_xi", the second string corresponding to "deep learning framework" is "shen_du_xue_xi_kuang_jia", and the second string corresponding to "deep neural network" is "shen_du_shen_jing_wang_luo". After the first-level precise matching search, both "deep learning" (completely identical) and "deep learning framework" (identical substring) meet the conditions. Therefore, the third result set is {"deep learning", "deep learning framework"}.
[0057] In step 1022, the first letter of each pinyin string in the first string is extracted, and a third string corresponding to the input information is constructed based on each first letter.
[0058] Here, "the first letter of the pinyin string" refers to the first letter of the pinyin corresponding to each Chinese character in the first string, such as "s" for "shen" and "d" for "du". The "third string" refers to the string formed by combining the first letters of all the pinyin strings in the first string in their original order. This step involves extracting the first letter from each pinyin string in the first string and then combining these first letters in their original order to form the third string. For example, if the first string is "shen_du_xue_xi", where the first letters of "shen", "du", "xue", and "xi" are "s", "d", "x", and "x" respectively, the constructed third string would be "sdxx". The first letters in the third string can be separated by a separator, or no separator may be used.
[0059] In step 1023, based on the third string, a second-level search process is performed in the second candidate set to obtain a fourth result set. The second candidate set includes the fourth string corresponding to each candidate string. The fourth string is constructed based on the first letter of the pinyin string corresponding to the Chinese characters included in the candidate string.
[0060] Here, "second candidate set" refers to a pre-constructed set storing multiple candidate strings and their corresponding initial letter combinations (fourth strings); "fourth string" refers to a string formed by extracting the first letters of the pinyin after matching the Chinese characters in the candidate strings, and combining them in order, such as "sdxx" for the fourth string corresponding to the candidate string "deep learning"; "second-level search processing" refers to the second-stage retrieval operation, usually a precise matching retrieval based on the first letter; "fourth result set" refers to the set of candidate strings filtered after the second-level search. This step uses the third string to perform the second-stage retrieval (such as precise initial letter matching) in the second candidate set, finding the content in the candidate strings where the fourth string matches the third string, and these contents constitute the fourth result set. For example, if the third string is "sdxx", the fourth string corresponding to "deep learning" in the second candidate set is "sdxx", and the fourth string corresponding to "deep research" is "sdyj"; after the second-level precise initial letter matching search, the fourth string corresponding to "deep learning" meets the search criteria, so the fourth result set is {"deep learning"}.
[0061] It should be noted that both the first-level and second-level search processing are based on Pinyin search. When performing a Pinyin search, if the user's input contains English characters, and the corresponding first string also contains English characters from the input, the English characters will also be matched during the Pinyin search. For example, if the input is "CNN training", the first string is "CNNxun_lian", and the second string corresponding to "RNN training" in the first candidate set is "RNNxun_lian", then after the first-level precise matching search, "RNN training" and "CNN training" will not meet the criteria. Similarly, if the third string is "CNNxl", and the fourth string corresponding to "RNN training" in the second candidate set is "RNNxl", then after the second-level precise matching search, "RNN training" and "CNN training" still will not meet the criteria.
[0062] In some embodiments, the step 1023, "based on the third string, performing a second-level search process in the second candidate set to obtain a fourth result set," can be implemented through the following process, including: Based on the third string, perform a second-level search process in the second candidate set to obtain at least one candidate search result; for each candidate search result, search for a candidate search result in the third result set; when no candidate search result is found in the third result set, the candidate search is determined as the fourth search result; construct a fourth result set based on each fourth search result.
[0063] Here, "candidate search results" refers to the candidate strings that match the third string after the initial screening following the second-level search; "fourth search results" refers to the candidate strings that do not appear in the third result set; and "constructing the fourth result set" means integrating all fourth search results into one set. This process involves first performing a second-level search on the second candidate set using the third string to obtain preliminary candidate search results; then checking each candidate search result to see if it already exists in the third result set; if not, it is used as a fourth search result; finally, all fourth search results are integrated into a fourth result set. For example, if the third string is "sdxx", the second-level search yields candidate search results {"deep learning", "deep learning course"}; the third result set is {"deep learning"}; checking reveals that "deep learning" is already in the third result set, but "deep learning course" is not, therefore the fourth search result is "deep learning course", and the fourth result set is {"deep learning course"}.
[0064] In this embodiment, when performing a second-level search on the second candidate set based on the third string to determine the fourth result set, the process first involves performing a second-level search on the second candidate set based on the third string to obtain at least one candidate search result. For each candidate search result, a search is performed in the third result set. If no candidate search result is found in the third result set, the candidate search result is determined as the fourth search result. A fourth result set is then constructed based on each fourth search result. This avoids duplicate search results, ensures the uniqueness of the results in the first result set, and thus improves the effectiveness of the search results.
[0065] See also Figure 3B In step 1024, a first result set is constructed based on the third result set and the fourth result set.
[0066] Here, the third result set obtained from the first-level search is merged with the fourth result set obtained from the second-level search, and the total number of search results is determined. When the number reaches a first threshold, the third and fourth result sets are defined as the first result set. If the number does not reach the first threshold, the search results need to be supplemented through searches at other levels to form the first result set.
[0067] In this embodiment, when determining the first result set, a first-level search is first performed on the first candidate set based on the first string to obtain a third result set. The first candidate set includes multiple candidate strings and a second string corresponding to each candidate string. The second string is constructed based on the pinyin strings corresponding to the Chinese characters included in the candidate strings. The first letter of each pinyin string in the first string is extracted, and a third string corresponding to the input information is constructed based on each first letter. Based on the third string, a second-level search is performed on the second candidate set to obtain a fourth result set. The second candidate set includes a fourth string corresponding to each candidate string. The fourth string is constructed based on the first letter of the pinyin strings corresponding to the Chinese characters included in the candidate strings. The first result set is constructed based on the third and fourth result sets. In this way, multi-level searches cover different matching dimensions, improving the completeness of the first result set and meeting the search needs of users with different input habits.
[0068] In some embodiments, the step 1024 of "constructing a first result set based on the third result set and the fourth result set" can be implemented through the following process, including: Determine the second number of third search results included in the third result set, and determine the third number of fourth search results included in the fourth result set; sum the second and third numbers to determine the fourth number; when the fourth number is greater than or equal to a first threshold, determine the third and fourth result sets as the first result set.
[0069] Here, "third search result" refers to each candidate string in the third result set, and "second quantity" refers to the number of third search results in the third result set; "fourth search result" refers to each candidate string in the fourth result set, and "third quantity" refers to the number of fourth search results in the fourth result set; "fourth quantity" refers to the total number obtained by adding the second quantity and the third quantity; "first threshold" refers to a pre-set benchmark value for judging whether the number of results is sufficient, such as 5, 8, etc., which can be determined based on the number of search results expected by the user in the input information. The process first counts the number of results in the third result set (second quantity) and the number of results in the fourth result set (third quantity), and calculates their sum (fourth quantity); if the fourth quantity reaches or exceeds the first threshold, the third result set and the fourth result set are merged into the first result set. For example, if the first threshold is set to 2, the third result set has 1 result (second quantity = 1), the fourth result set has 2 results (third quantity = 2), and the fourth quantity = 3 ≥ 2, therefore the two sets are merged into the first result set.
[0070] In this embodiment, if the sum of the second number of third search results included in the third result set and the third number of fourth search results included in the fourth result set (i.e., the fourth number) is greater than or equal to the first threshold, it indicates that sufficient search results have been obtained, and lower-level search processing is no longer required. The third and fourth result sets can be directly determined as the first result set. Thus, determining whether the construction of the first result set is complete based on the number of results avoids invalid search operations, thereby improving search efficiency.
[0071] In some embodiments, see Figure 3C The step 1024, "constructing the first result set based on the third result set and the fourth result set," can also be achieved through steps 10241 to 10243, including: In step 10241, when the fourth quantity is less than the first threshold, a third-level search process is performed on the first candidate set based on the first string to obtain the fifth result set.
[0072] Here, "the fourth quantity being less than the first threshold" means that the total number of results in the third and fourth result sets has not reached the pre-set baseline value, indicating that insufficient search results have been obtained, thus requiring a lower-level search process. "Third-level search processing" refers to the third stage of retrieval, typically a fuzzy matching search (allowing deviations between the first and second strings within a preset range). "Fifth result set" refers to the set of candidate strings filtered after the third-level search. This step involves performing a third-stage search (such as fuzzy matching) on the first candidate set using the first string when the total number of results in the third and fourth result sets has not reached the first threshold. This identifies candidate strings where the second string matches the similarity condition of the first string, and these matches form the fifth result set.
[0073] In some embodiments, the step 10241, "based on the first string, performing a third-level search process in the first candidate set to obtain a fifth result set," can be implemented through the following process, including: For each candidate string in the first candidate set, determine the first similarity between the second string corresponding to the candidate string and the first string; when the first similarity satisfies the similarity condition, the candidate string is determined as the target string; search for the target string in the third result set and the fourth result set; when the target string is not found in the third result set and the fourth result set, the target string is determined as the fifth search result; construct the fifth result set based on each fifth search result.
[0074] Here, "first similarity" refers to the character-level similarity between the second and first strings of a candidate string, usually expressed as a percentage or score; "similarity condition" refers to a pre-set threshold for judging whether the first similarity meets the standard, such as 80% or higher; "target string" refers to a candidate string whose first similarity with the second string meets the similarity condition; "fifth search result" refers to a candidate string in the target string that does not appear in the third or fourth result sets; "constructing the fifth result set" refers to integrating all fifth search results into a single set. In this process, for each candidate string in the first candidate set, the similarity between its second and first strings is calculated to filter out target strings that meet the similarity standard. Then, it is checked whether these target strings are already in the third or fourth result sets; if not, they are used as fifth search results. Finally, all fifth search results are integrated into the fifth result set. For example, if the first string is "sen_du_xue_xi", and the second string "shen_du_xue_xi" corresponding to "deep learning" in the first candidate set has a first similarity of 90% with the first string (satisfying the 80% similarity condition), and "deep learning" is not in the third or fourth result sets, then the fifth search result is "deep learning", and the fifth result set is {"deep learning"}.
[0075] In this embodiment, for each candidate string in the first candidate set, a first similarity is first determined between the second string corresponding to the candidate string and the first string. When the first similarity satisfies the similarity condition, the candidate string is determined as the target string. Then, the target string is searched in the third and fourth result sets. When the target string is not found in the third and fourth result sets, it indicates that the string has not appeared repeatedly. At this time, the target string can be determined as the fifth search result, and a fifth result set is constructed based on each fifth search result. In this way, by supplementing the search results through fuzzy matching and avoiding the duplication of search results, the first result set is effectively supplemented, thereby improving the richness and data effectiveness of the first result set.
[0076] See also Figure 3C In step 10242, based on each Chinese character in the input information, a fourth-level search process is performed in the third candidate set to obtain a sixth result set. The third candidate set includes multiple candidate strings.
[0077] Here, the "fourth-level search processing" refers to the retrieval operation in the fourth stage, usually an exact or fuzzy matching retrieval based on the Chinese characters themselves; the "third candidate set" refers to a set that is pre-constructed and stores multiple candidate strings, and these strings usually include Chinese characters; the "sixth result set" refers to the set of candidate strings related to the Chinese characters in the input information that are filtered out after the fourth-level search. In this process, each Chinese character in the input information is used to perform the fourth-stage retrieval (such as Chinese character matching) in the third candidate set, so as to find the candidate strings that contain these Chinese characters or characters related thereto, and the sixth result set is formed by these contents. For example, the Chinese characters in the input information are "深", "度", "学", "习", and the candidate strings in the third candidate set include "深度研究", "学习资料", "深度学习", etc. After the fourth-level search, these strings all contain Chinese characters related to the Chinese characters in the input information, so the sixth result set is {"深度研究", "学习资料", "深度学习"}.
[0078] In step 10243, based on the third result set, the fourth result set, the fifth result set, and the sixth result set, a first result set is constructed.
[0079] Here, all the results in the third, fourth, fifth, and sixth result sets can be integrated into a new set, that is, the first result set. Or, some of the results in the third, fourth, fifth, and sixth result sets can be integrated into a new set as the first result set. Or, a result set can be selected from the fifth result set and the sixth result set, and constructed with the third and fourth result sets as the first result set. It should be noted that since duplicate removal processing is involved in the search processing of each level, there are no identical search results among the third, fourth, fifth, and sixth result sets. Therefore, duplicate removal processing does not need to be repeated when constructing the first result set. If duplicate removal processing is not performed on the result set in the search processing of a certain level, duplicate removal processing needs to be performed on the third result set, the fourth result set, the fifth result set, and the sixth result set during the construction of the first result set.
[0080] In the embodiment of the present application, when the fourth quantity is less than the first threshold, first, based on the first string, third-level search processing is performed in the first candidate set to obtain a fifth result set; then, based on each Chinese character in the input information, fourth-level search processing is performed in the third candidate set to obtain a sixth result set, where the third candidate set includes multiple candidate strings; then, based on the third result set, the fourth result set, the fifth result set, and the sixth result set, a first result set is constructed. In this way, more search results can be supplemented through the third-level and fourth-level search processing, so as to ensure that the quantity of the first result set meets the standard and improve the recall rate of the search.
[0081] In some embodiments, see Figure 3D The step 10243, "constructing the first result set based on the third result set, the fourth result set, the fifth result set, and the sixth result set," can be achieved through steps 2431 to 2436, including: In step 2431, the second similarity between the fifth result set and the input information is determined, as well as the first weight corresponding to the fifth result set.
[0082] Here, in step 2431, the similarity between each fifth search result in the fifth result set and the input information is first determined. Then, the mean of each similarity is determined as the second similarity. The "first weight" refers to a coefficient set for the fifth result set that reflects its importance in the final result, such as 0.3, 0.5, etc. For example, if the fifth result set includes fifth search result 1 and fifth search result 2, where the similarity between fifth search result 1 and the input information is 0.5 and the similarity between fifth search result 2 and the input information is 0.7, then the second similarity between the fifth result set and the input information is 0.6.
[0083] In step 2432, the second similarity is weighted based on the first weight to obtain the first score corresponding to the fifth result set.
[0084] Here, "weighted processing" refers to multiplying the second similarity by the first weight to obtain a score that reflects the overall value of the fifth result set, i.e., the first score. For example, if the second similarity is 85% and the first weight is 0.6, then the first score = 85% × 0.6 = 0.51 points. Alternatively, the weighted value can be multiplied by 100 to obtain a standardized score of 51 points.
[0085] In step 2433, the third similarity between the sixth result set and the input information is determined, as well as the second weight corresponding to the sixth result set.
[0086] Here, "third similarity" refers to the average similarity between all sixth search results in the sixth result set and the input information, and "second weight" refers to the coefficient set for the sixth result set that reflects its importance in the final result, such as 0.4, 0.6, etc.
[0087] In some embodiments, the step 2431 of "determining the second similarity between the fifth result set and the input information, and the first weight corresponding to the fifth result set" can be implemented through the following process, including: The second similarity is determined based on the similarity between each fifth search result in the fifth result set and the input information; the first weight is determined based on the proportion of letter strings in the input information.
[0088] Here, the similarity between each fifth search result and the input information refers to the degree of matching between a single fifth search result and the input information; the "second similarity" is usually the average of the similarities between all fifth search results and the input information; the proportion of letter strings in the input information refers to the ratio of the number of letter-like strings (such as English letters and Pinyin letters) in the input information to the total number of segmented words. To determine the proportion of letter strings in the input information, the input information needs to be segmented first to obtain multiple segments, and then the proportion of the segments corresponding to letter strings in the total number of segmented words needs to be determined. It is important to note that during the segmentation process, the English part needs to be segmented into units of English words. For example, if the input information is "dataloader node", where "data" is an English word corresponding to a letter string, and "loader" is also an English word corresponding to a letter string, then after segmentation, four segments are obtained: "data", "loader", "node", and "point". Among these, the segments corresponding to letter-like strings include two: "data" and "loader", so the proportion of letter strings in the total number of segmented words is 0.5. Determining the first weight refers to assigning weights based on the proportion of letter strings. Higher proportions may result in higher weights. A mapping table between the proportions of letter strings and the first weights can be pre-set. After determining the proportions of letter strings, the corresponding first weights are determined from the mapping table. This process involves first calculating the similarity between each fifth search result and the input information, then taking the average as the second similarity, and finally calculating the proportion of letter strings in the input information to determine the first weight. For example, if the fifth result set has two results with similarities of 80% and 90% respectively, and the second similarity is 85%; and letter strings account for 60% of the input information, then the corresponding first weight can be set to 0.6.
[0089] In some embodiments, the letter string refers to consecutive English characters. When the input information includes consecutive English characters, the proportion of the letter string is greater than 0, and the first weight is increased to 1.5. If the input information does not include consecutive English characters, the proportion of the letter string is 0, and the first weight is set to 1 by default.
[0090] The step 2433, "determining the third similarity between the sixth result set and the input information, and the second weight corresponding to the sixth result set," can be achieved through the following process: The third similarity is determined based on the similarity between each sixth search result in the sixth result set and the input information; the second weight is determined based on the proportion of Chinese characters in the input information.
[0091] Here, the similarity between each sixth search result and the input information refers to the degree of matching between a single sixth search result and the input information; the "third similarity" is usually the average of the similarities between all sixth search results and the input information; the proportion of Chinese characters in the input information refers to the percentage of Chinese characters in the input information out of the total number of characters; determining the second weight refers to assigning weights based on the proportion of Chinese characters, with higher proportions potentially having higher weights. This process involves first calculating the similarity between each sixth search result and the input information, taking the average as the third similarity, then calculating the proportion of Chinese characters in the input information, and determining the second weight based on this proportion. For example, if the sixth result set has three results with similarities of 90%, 85%, and 80% respectively, the third similarity is 85%; and the proportion of Chinese characters in the input information is 70%, the corresponding second weight is set to 0.7.
[0092] In some embodiments, a percentage threshold can be set, such as 60%. When the percentage of Chinese characters in the input information is >60%, the second weight is increased to 1.2. If the percentage of Chinese characters in the input information does not reach the percentage threshold, the second weight is 1 by default.
[0093] In this embodiment, the overall second similarity is first determined based on the similarity between each fifth search result in the fifth result set and the input information; then, the first weight is determined based on the proportion of letter strings in the input information; next, for the sixth result set, the overall third similarity is first determined based on the similarity between each sixth search result in it and the input information; then, the second weight corresponding to the sixth result set is determined based on the proportion of Chinese characters in the input information. This allows the determination of similarity and weight to better align with the characteristics of the input information, thereby improving the rationality of filtering search results.
[0094] In step 2434, the third similarity is weighted based on the second weight to obtain the second score corresponding to the sixth result set.
[0095] Here, "weighted processing" refers to multiplying the third similarity by the second weight to obtain a score that reflects the overall value of the sixth result set, i.e., the second score. This step calculates the overall score of the sixth result set by multiplying the second weight by the third similarity. For example, if the third similarity is 88% and the second weight is 0.5, then the second score = 88% × 0.5 = 0.44 points.
[0096] In step 2435, the target result set is determined from the fifth result set and the sixth result set based on the first score and the second score.
[0097] Here, the "target result set" refers to the set of results selected from the fifth and sixth result sets that have the highest overall scores. Typically, all or part of the results from the set with the highest scores are selected. This step involves comparing the first and second scores, and selecting results from the fifth and sixth result sets to form the target result set based on the score ranking. For example, if the first score of 51 is higher than the second score of 44, then all results from the fifth result set are determined as the target result set.
[0098] In step 2436, the union of the third result set, the fourth result set, and the target result set is determined as the first result set.
[0099] Here, "merge set" refers to the new set formed by combining all results from the three sets and removing duplicates. This step involves merging the third and fourth result sets with the target result set, removing duplicates, and using this as the first result set. For example, if the third result set is {"deep learning"}, the fourth result set is an empty set, and the target result set is {"deep learning framework"}, the merged first result set would be {"deep learning", "deep learning framework"}.
[0100] In this embodiment, firstly, a second similarity between the fifth result set and the input information, and a first weight corresponding to the fifth result set are calculated; then, the second similarity is weighted using the first weight to obtain a first score corresponding to the fifth result set; next, a third similarity between the sixth result set and the input information, and a second weight corresponding to the sixth result set are calculated; then, the third similarity is weighted using the second weight to obtain a second score corresponding to the sixth result set; then, based on the first score and the second score, a target result set is determined from the fifth and sixth result sets; finally, the combination of the third result set, the fourth result set, and the target result set is determined as the first result set. In this way, more accurate search results can be filtered out and the first result set constructed through weighted scoring, thereby ensuring the quality of the first result set and guaranteeing the accuracy of the target search results.
[0101] See also Figure 3A In step 103, when the first number of first search results included in the first result set is less than the first threshold, semantic analysis processing is performed on the input information to obtain the first semantic vector corresponding to the input information, and search processing is performed based on the first semantic vector to obtain the second result set.
[0102] Here, "first search result" refers to each search result in the first result set; "first quantity" refers to the number of first search results in the first result set; "semantic analysis processing" refers to the process of parsing the meaning of the input information and extracting semantic features; "first semantic vector" refers to the numerical vector converted from the semantic features of the input information, used to quantify the semantics; and "second result set" refers to the set of candidate strings that are semantically related to the input information, obtained based on the first semantic vector. When the number of results in the first result set does not reach the first threshold, the input information is semantically parsed and converted into a vector, and then the semantically related results are retrieved using this vector, forming the second result set. For example, if the first threshold is set to 3, and the first result set has only 2 results (first quantity = 2 < 3), the input information "deep learning" is semantically analyzed to obtain the first semantic vector, and results such as "deep neural network learning" and "deep machine learning" are obtained based on this vector, constituting the second result set.
[0103] In some embodiments, see Figure 3E The step 103, "performing search processing based on the first semantic vector to obtain the second result set," can be implemented through steps 1031 to 1033, including: In step 1031, for each candidate semantic vector in the fourth candidate set, a fourth similarity between the candidate semantic vector and the first semantic vector is determined. The fourth candidate set includes multiple candidate strings and the candidate semantic vector corresponding to each candidate string.
[0104] Here, the "fourth candidate set" refers to a pre-constructed set that stores multiple candidate strings and their corresponding semantic vectors (candidate semantic vectors); the "candidate semantic vector" refers to a numerical vector converted from the semantic features of the candidate strings; and the "fourth similarity" refers to the degree of similarity between the candidate semantic vector and the first semantic vector in the vector space, usually expressed by indicators such as cosine similarity. For each candidate semantic vector in the fourth candidate set, its similarity to the first semantic vector is calculated to obtain the fourth similarity. For example, the fourth similarity between the candidate semantic vector corresponding to "deep neural network" and the first semantic vector (input information "deep learning") in the fourth candidate set is 0.85, and the fourth similarity between the candidate semantic vector corresponding to "image recognition" and the first semantic vector is 0.3.
[0105] In step 1032, each candidate semantic vector is sorted in descending order based on the fourth similarity to obtain a semantic vector sequence.
[0106] Here, "descending order sorting" refers to arranging candidate semantic vectors in descending order of fourth similarity, and "semantic vector sequence" refers to the ordered list of candidate semantic vectors formed after sorting. All candidate semantic vectors are arranged in descending order of their fourth similarity with the first semantic vector to form an ordered sequence. For example, the fourth similarities of candidate semantic vectors 1 to 4 are 0.85, 0.7, 0.1, and 0.3, respectively. After descending order sorting, the semantic vector sequence is [candidate semantic vector 1 (0.85), candidate semantic vector 2 (0.7), candidate semantic vector 4 (0.3), candidate semantic vector 3 (0.1)].
[0107] In step 1033, the first N candidate semantic vectors in the semantic vector sequence are determined as the second semantic vectors, and the candidate strings corresponding to each second semantic vector are determined as the second result set, where N is an integer greater than 2.
[0108] Here, "second semantic vector" refers to the top N candidate semantic vectors in the semantic vector sequence; "N" refers to the pre-defined number of candidate semantic vectors to be selected, such as 3, 5, etc., and is an integer greater than 2; "second result set" refers to the set of candidate strings corresponding to the top N candidate semantic vectors. In this step, the top N candidate semantic vectors are selected from the semantic vector sequence, and their corresponding candidate strings are integrated into the second result set. For example, if N=3, the candidate strings corresponding to the top 3 candidate semantic vectors in the semantic vector sequence are "deep neural network", "deep machine learning", and "deep learning framework", so the second result set is {"deep neural network", "deep machine learning", "deep learning framework"}.
[0109] In this embodiment, the fourth candidate set includes multiple candidate strings and a candidate semantic vector corresponding to each candidate string. For each candidate semantic vector in the fourth candidate set, a fourth similarity is first calculated between the candidate semantic vector and the first semantic vector. Then, each candidate semantic vector is sorted in descending order based on the fourth similarity to obtain a semantic vector sequence. Subsequently, the first N candidate semantic vectors in the semantic vector sequence are determined as second semantic vectors (N is an integer greater than 2), and the candidate string corresponding to each second semantic vector is determined as a second result set. In this way, semantically relevant search results can be obtained through semantic vector matching, supplementing the shortcomings of pinyin search and thus improving the richness and semantic relevance of search results.
[0110] In some embodiments, N in step 1033 above can be determined by the following process, including: Obtain a preset threshold scaling factor, determine a second threshold based on the product of the first threshold and the threshold scaling factor, obtain a third threshold, and determine the maximum value between the second threshold and the third threshold as N.
[0111] Here, "threshold scaling factor" refers to a pre-set proportional coefficient used to adjust the first threshold, such as 0.5, 1.0, etc.; "second threshold" refers to the value obtained by multiplying the first threshold by the threshold scaling factor; "third threshold" refers to a pre-set minimum baseline value of N, such as 3, 5, etc. The process first calculates the second threshold based on the first threshold and the threshold scaling factor, then compares it with the third threshold, and takes the larger value as N. For example, if the first threshold is 5 and the threshold scaling factor is 0.6, the second threshold = 5 × 0.6 = 3; the third threshold is 3, so N = max(3, 3) = 3.
[0112] In this embodiment, a preset threshold scaling factor is obtained, and it is multiplied by a first threshold to obtain a second threshold. Then, a third threshold is obtained, and the second threshold and the third threshold are compared. The larger value is taken as N. This ensures that the value of N is reasonable, both related to the first threshold and with a minimum guarantee, thus ensuring that the number of second result sets is sufficient.
[0113] See also Figure 3A In step 104, the target search result is determined based on the first result set and the second result set, and the target search result is output.
[0114] Here, "target search results" refers to the search results that best meet the user's needs, selected from the first and second result sets. Outputting target search results means displaying these results to the user. By integrating and filtering the first and second result sets, the final results displayed to the user are determined and presented. For example, if the first result set is {"deep learning", "deep learning framework"} and the second result set is {"deep neural network", "deep machine learning"}, the target search results, after filtering, are determined to be {"deep learning", "deep neural network", "deep machine learning"} and displayed to the user.
[0115] In this embodiment, in response to receiving input information for data search and determining that the input information includes at least one Chinese character, a pinyin string corresponding to each Chinese character is determined; a first string corresponding to the input information is constructed based on each pinyin string, and at least two levels of search processing are performed based on the first string to obtain a first result set, with different levels of search processing corresponding to different search precisions. Thus, by converting Chinese characters into pinyin strings to construct the first string, it can adapt to the user's possible pinyin input habits. Simultaneously, by utilizing different levels of search precision (such as exact matching and fuzzy error tolerance), it ensures a fast response to accurate input while also being compatible with pinyin input deviations, improving adaptability to mixed query scenarios containing Chinese characters. Furthermore, prioritizing results obtained through pinyin-level search reduces resource-intensive semantic computation calls, ensuring search efficiency. Subsequently, when the first number of first search results included in the first result set is less than a first threshold, semantic analysis processing is performed on the input information to obtain a first semantic vector corresponding to the input information, and search processing is performed based on the first semantic vector to obtain a second result set. In this way, by supplementing the search with semantic vector search, more relevant results can be retrieved from a semantic association perspective when the search results at the two levels are insufficient. This avoids the omission of effective information due to the limitations of pinyin matching, further improving the search recall rate. Simultaneously, activating the semantic layer on demand balances resource consumption and search performance while ensuring the completeness of the results. Finally, the target search result is determined based on the first and second result sets and output. By integrating the results of different search methods, the efficiency and accuracy of pinyin-level search are retained, while supplementary information from semantic search is incorporated. This ensures that the output target result balances accuracy, completeness, and scenario adaptability, thereby improving search response speed, result precision, and fault tolerance.
[0116] In some embodiments, the second result set includes at least one second search result, see [link to relevant documentation]. Figure 3F The step 104, "determining the target search result based on the first result set and the second result set," can be achieved through steps 1041 to 1044, including: In step 1041, the union of the first result set and the second result set is determined as the seventh result set. The seventh result set includes multiple seventh search results, which are either the first search result or the second search result.
[0117] Here, "second search result" refers to each search result in the second result set; "seventh result set" refers to the set formed by merging the first and second result sets, containing all first and second search results; "seventh search result" refers to each candidate string in the seventh result set, which may come from either the first or second result set, so it could be either a first or second search result. Merging the first and second result sets forms the seventh result set, which contains all relevant results. For example, if the first result set is {"deep learning"} and the second result set is {"deep neural network"}, then the seventh result set is {"deep learning", "deep neural network"}.
[0118] In step 1042, for each seventh search result in the seventh result set, the sixth similarity between the seventh search result and the input information is determined, and the fourth weight corresponding to the seventh search result is determined.
[0119] Here, "sixth similarity" refers to the degree of matching between a single seventh search result and the input information, which can be calculated by combining multiple dimensions such as pinyin and semantics; "fourth weight" refers to the coefficient assigned to each seventh search result, reflecting its importance. For each result in the seventh result set, its similarity (sixth similarity) with the input information is calculated, and the corresponding weight (fourth weight) is determined. For example, the sixth similarity of the seventh search result "deep learning" with the input information is 95%, and the fourth weight is 0.8; the sixth similarity of "deep neural network" is 85%, and the fourth weight is 0.7.
[0120] In some embodiments, the fourth weight corresponding to the first-level search result is greater than the fourth weight corresponding to the second-level search result, and also greater than the fourth weight corresponding to the third- and fourth-level search results. The fourth weights corresponding to the third- and fourth-level search results may be the same or different. For example, the seventh search result 1 is a first-level search result with a fourth weight of 0.9; the seventh search result 2 is a second-level search result with a fourth weight of 0.8; the seventh search result 3 is a third-level search result with a fourth weight of 0.6; and the seventh search result 4 is a fourth-level search result with a fourth weight of 0.6.
[0121] In step 1043, the sixth similarity is weighted based on the fourth weight to obtain the fourth score corresponding to the seventh search result.
[0122] Here, "weighted processing" refers to multiplying the sixth similarity score by the fourth weight to obtain a score that reflects the overall value of the seventh search result, i.e., the fourth score. The overall score for each seventh search result is calculated by multiplying the fourth weight by the sixth similarity score. For example, if the sixth similarity score for "deep learning" is 95% and the fourth weight is 0.8, then the fourth score = 95% × 0.8 = 76 points.
[0123] In step 1044, the target search result is determined from the plurality of seventh search results based on the fourth score corresponding to each seventh search result.
[0124] Here, results are sorted from highest to lowest according to their fourth score, and the top-ranked results are selected as the final target search results. For example, if the results are sorted by fourth score as "deep learning" (76 points), "deep learning framework" (60 points), and "deep neural network" (59.5 points), then the top two results can be selected as the target search results, meaning the target search results include "deep learning" and "deep learning framework".
[0125] In this embodiment, the second result set includes at least one second search result. When determining the target search result, the first and second result sets are first merged to determine the seventh result set. This seventh result set includes multiple seventh search results, and each seventh search result can be either a first or a second search result. Then, for each seventh search result in the seventh result set, a sixth similarity between the seventh search result and the input information, and a fourth weight corresponding to the seventh search result, are determined. The sixth similarity is weighted according to the fourth weight to obtain a fourth score corresponding to the seventh search result. Finally, based on the fourth score corresponding to each seventh search result, the target search result is selected from the multiple seventh search results. In this way, by filtering search results using a comprehensive fourth score, the quality of the target search result can be ensured, improving the user's search experience.
[0126] In some embodiments, see Figure 3G When the first quantity is greater than or equal to the first threshold, the target search result can also be determined through steps 201 to 204, including: In step 201, when the first quantity is greater than or equal to the first threshold, for each first search result, a fifth similarity between the first search result and the input information is determined, and a third weight corresponding to the first search result is determined.
[0127] Here, "first quantity greater than or equal to first threshold" means that the number of results in the first result set reaches or exceeds a pre-set benchmark value; "fifth similarity" refers to the degree of matching between a single first search result and the input information; "third weight" refers to the coefficient set for each first search result that reflects its importance. When the number of results in the first result set is sufficient, the similarity (fifth similarity) between each first search result and the input information is calculated, and the corresponding weight (third weight) is determined.
[0128] In step 202, the fifth similarity is weighted based on the third weight to obtain the third score corresponding to the first search result.
[0129] Here, "weighted processing" refers to multiplying the fifth similarity score by the third weight to obtain a score that reflects the overall value of the first search result, i.e., the third score. For example, if the fifth similarity score of "deep learning" is 90% and the third weight is 0.9, then the third score = 90% × 0.9 = 81 points; if the fifth similarity score of "deep learning framework" is 80% and the third weight is 0.7, then the third score = 80% × 0.7 = 56 points.
[0130] In step 203, each first search result is sorted in descending order based on each third score to obtain the first result sequence.
[0131] Here, "descending sort" refers to arranging the first search results in descending order of their third score; "first result sequence" refers to the ordered list of the first search results after sorting. Arranging all the first search results in descending order of their third score creates an ordered sequence, which is the first result sequence.
[0132] In step 204, the first search result in the first result sequence that is located before a preset position is determined as the target search result.
[0133] Here, "preset position" refers to a pre-defined cutoff position for selecting the target results, such as the first 5 or first 10, which usually corresponds to the value of the first threshold. For example, if the first threshold is 10, then the preset position is the first 10. Results before the preset position are selected from the first result sequence as the target search result. For example, if the first threshold is 2, then the preset position is the first 2, and the first result sequence is ["deep learning", "deep research", "deep mining"], then the target search result is {"deep learning", "deep research"}.
[0134] In this embodiment, when the first quantity is greater than or equal to the first threshold, it indicates that the number of first search results is sufficient. At this point, for each first search result, a fifth similarity between the first search result and the input information is determined, and a third weight corresponding to the first search result is determined. Then, the fifth similarity is weighted based on the third weight to obtain a third score corresponding to the first search result. Next, each first search result is sorted in descending order based on each third score to obtain a first result sequence. Finally, the first search result in the first result sequence preceding a preset position is determined as the target search result. In this way, when there are sufficient first search results, the target search result can be quickly filtered out, reducing unnecessary computational resources and thus improving search efficiency and search result quality.
[0135] The following will describe an exemplary application of the embodiments of this application in a real-world application scenario.
[0136] This application's embodiments address mixed Chinese and English search scenarios, resolving issues such as language fragmentation, slow response, and poor fault tolerance in related search technologies through five core technical key points. Specific functions and values are as follows: 1. Unified Processing Engine for Mixed Languages: This application proposes an integrated Chinese-English symbol parsing algorithm and establishes a symbol protection mechanism to convert key symbol characters such as @ and _ into a string of characters or codes (tokens) reserved for authentication and data transmission, such as at. This engine can support mixed Chinese and English input information, such as "Data_loader node", and can solve the problem of the separation between Chinese / English and symbol processing in related technologies, realizing unified parsing of mixed language input.
[0137] 2. Dual-channel dynamic indexing architecture: The search architecture of this application embodiment can handle multiple Pinyin, language types, or mixed forms of search. On the one hand, it can achieve lightning-fast initial letter search, for example, entering "sdxx" can quickly match "deep learning"; on the other hand, it supports full Pinyin search, entering "xuexi" can match "learning", covering the input habits of different users.
[0138] 3. Three-level trigger-based search strategy: This embodiment adopts a three-level trigger process: "precise pinyin search → fuzzy matching fill-in → semantic fallback search". This strategy enables dynamic resource scheduling, reduces semantic layer calls, lowers search latency, and balances search efficiency with resource consumption.
[0139] like Figure 4 As shown, Figure 4 This is a flowchart illustrating the step-by-step completion of search results provided in this application embodiment. First, a precise Pinyin search is performed 41. Then, it is determined whether the results are insufficient 42. If so, a fuzzy Pinyin search is performed 43. Next, it is determined whether the results are insufficient 44. If the results are still insufficient after Pinyin fuzzy completion, a fuzzy Chinese search is performed 45. The results are determined again 46. If the results are still insufficient after the fuzzy Chinese search, a semantic search is finally performed 47.
[0140] 4. Intelligent Error Tolerance System: This system uses a cross-language similarity algorithm to handle user input information with error tolerance. In practical applications, it can automatically correct "neural networks" to "neural networks," and it is also compatible with Southern accent pinyin, such as "sen_du," which can correctly match the corresponding content "depth," thus improving input error tolerance.
[0141] 5. Result Traceability and Identification System: This system uses specific identifiers to distinguish search results obtained from different modules. For users, this clearly distinguishes between exact matches and error-tolerant results; for operations and maintenance personnel, it allows them to query the hit rate at each search stage, providing data support for system optimization.
[0142] The following describes the implementation of the core functions of the search system provided in the embodiments of this application, including: 1. Input processing engine: Chinese character extraction: Use regular expressions to extract all Chinese characters from the query and concatenate them in their original order. If there are no Chinese characters, return an empty string. For example, extract "training" from "Python training".
[0143] Full-sentence Pinyin Conversion: Converts each Chinese character in the query into its corresponding Pinyin string and concatenates them in order. Non-Chinese characters (including symbols and uppercase and lowercase English characters) remain unchanged. For example, "Data_loader" will still be "Data_loader" after conversion.
[0144] 2. Dual-channel Pinyin search: Index traversal mechanism: Iterate through each candidate string and its corresponding third or fourth string in each candidate set in turn. When the first string of the input information (i.e. the full spelling string) appears as a substring in the third or fourth string, add the candidate string to the first result set. It can search for both full spelling and first spelling channels at the same time.
[0145] Results integration: After deduplicating the search results, the first k results (corresponding to the first threshold in other embodiments) are extracted and returned in order for each level of search, and the number of returned results is automatically controlled.
[0146] 3. Dynamic fill-in system: A four-level gap-filling strategy is adopted to dynamically detect the gap in search results and activate gap-filling step by step as needed, including the following four stages: The first stage (corresponding to the first and second levels of search processing in other embodiments): Pinyin precise search, based on the first string, performs precise search on the first candidate set (full Pinyin candidate set) and the second candidate set (first Pinyin candidate set), and attempts to obtain at most k results.
[0147] The second stage (corresponding to the third level of search processing in other embodiments): Pinyin fuzzy completion. If the number of search results in the first and second levels is less than k, perform a pinyin fuzzy search on the first string query according to the required number of results to fill the gap.
[0148] The third stage (corresponding to the fourth level of search processing in other embodiments): Chinese fuzzy completion. If there are still gaps in the search results of the first three levels, and the query contains Chinese fragments, perform a fuzzy search using Chinese characters in the third candidate set (Chinese candidate set) to continue to complete the search.
[0149] Fourth stage: If the search results of the first four levels still do not reach k, then the search is supplemented by semantic vectors, with Chinese characters as the priority (if there are no Chinese characters, the complete input information is used) entering the semantic search channel, and the search results are supplemented according to the missing amount.
[0150] In this embodiment, when the pinyin index can directly match the input content, a pinyin precise search is triggered (corresponding to the first and second level search processing in other embodiments). This means that the first string of the input information completely matches the pinyin in the first candidate set, or the second string (i.e., the first pinyin string of the input information) completely matches the pinyin in the second candidate set, which can quickly obtain highly accurate results. Pinyin fuzzy search (corresponding to the third level search processing in other embodiments) can still return relevant results even when the first string has certain errors (such as misspellings, abbreviations, etc.), improving fault tolerance. Chinese fuzzy search (corresponding to the fourth level search processing in other embodiments) can be triggered when matching native Chinese content, so even if the input Chinese characters have typos or other problems, there is still a chance to obtain the desired search results. Semantic completion search is triggered using vector matching technology. It mainly performs semantic completion search when the previous pinyin-based search results are insufficient, to ensure the coverage of search results, allowing non-professional or broadly expressed inputs to obtain semantically consistent results.
[0151] In this embodiment, intelligent deduplication of search results is performed. A set of "display names" that record the appearing search results is maintained, and the search result list is traversed sequentially. When the "display name" of a search result has not yet appeared, it is added to the first result set or the second result set and the result is retained. If it has already appeared, it is skipped, thus obtaining a result set deduplicated in the order of appearance. In this way, it can ensure that duplicate search results from different search channels are displayed only once.
[0152] The following describes the Application Programming Interface (API) product interface specification in this application embodiment. The request body (input information) contains two fields: query (string type, the user's original query, such as "neural network training") and k (integer type, the maximum number of expected results, such as 5). The response body (output information) contains two top-level fields: results (list type, each result item includes node name, display name, search type, and extensible attributes) and query_analysis (object type, containing query parsing information).
[0153] In this embodiment, the log auditing system outputs two logs: one records the number of merged results for the pinyin search (format example: "Pinyin search results: X results"), and the other records the number of results that need to be supplemented (format example: "Number of results to be supplemented: Y results"), thus fully recording the search decision chain. Furthermore, the index loading mechanism provided in this embodiment can immediately restore full search capabilities after a service restart, without any additional waiting time. Performance data collection records the request start time at the beginning of search processing, calculates the processing time (in seconds, rounded to three decimal places) after processing is complete, and detects the processing time of a single search request (in milliseconds) through log output.
[0154] See Figure 5 , Figure 5 This is a flowchart illustrating the precise Chinese search process provided in an embodiment of this application. For example... Figure 5 As shown, user 51 sends a search request to application programming interface 52 containing the query content "image processing" and the expected number of results "3" by inputting the information {"image processing", "K": 3}. Application programming interface 52 first extracts Chinese characters through parser 53 to obtain the Chinese characters for "image processing", and then performs a pinyin conversion operation through parser 53 to obtain the pinyin string "tu_xiang_chu_li". Next, "tu_xiang_chu_li" and "3" are passed to precise search 54 for pinyin precise search (corresponding to the first and second level search processing in other embodiments), and the precise search results are returned (such as "[display name: image processing node, ...]") (corresponding to the third and fourth result sets in other embodiments). Finally, application programming interface 52 returns the precise search results as the target search results to user 51. The search results carry the search type (such as search_type: pinyin).
[0155] See Figure 6 , Figure 6 This is a schematic diagram of the process for a mixed Chinese and English search provided in an embodiment of this application. For example... Figure 6As shown, user 61 sends a search request to application programming interface 62 containing the query "CNN training" and the expected number of results "5" by inputting the information {"CNN training", "K": 5}. Application programming interface 62 first extracts Chinese characters through parser 63 to obtain the Chinese characters for "training", then performs a pinyin conversion operation through parser 63 to obtain the pinyin string "CNNxun_lian". Next, "CNNxun_lian" and "5" are passed to precise search 64 for pinyin precise search, and the precise search result is returned (e.g., "[CNN training model]"). Assuming there is only one precise search result, since 1 < 5, the returned precise search result is less than the expected number of 5. Therefore, calculations determine that 4 more search results are needed. Next, parameters such as "CNN training", "5", and language type as Pinyin are passed to fuzzy search 65 to perform Pinyin fuzzy search (corresponding to the third level of search processing in other embodiments), and return fuzzy search results (such as "[CNN training model 2]") (corresponding to the fifth result set in other embodiments). Then, the combined search results of precise search results and fuzzy search results are returned to the user 61 as the target search results.
[0156] See Figure 7 , Figure 7 This is a schematic diagram of the semantic completion search process provided in an embodiment of this application. For example... Figure 7 As shown, user 71 sends a search request to application programming interface 72 containing the query content "neural network" and the expected number of results "10" by inputting the information {"neural network", "K": 10}. Application programming interface 72 performs a Chinese character extraction operation through parser 73 to obtain the Chinese characters "neural network", and performs a pinyin conversion operation to obtain the pinyin string "shen_jing_wang_lu". Then, a precise pinyin search is performed through precise search 74, but the result is "no precise pinyin match". Subsequently, a first pinyin fuzzy search is performed through fuzzy search 75 to complete the search (corresponding to the third level of search processing in other embodiments), and... Return the pinyin fuzzy search results (corresponding to the fifth result set in other embodiments); since the search results are still less than 5, perform a second fuzzy search to supplement them, call fuzzy search 75 to perform Chinese fuzzy search (corresponding to the fourth level of search processing in other embodiments), and return the Chinese fuzzy search results (corresponding to the sixth result set in other embodiments); since the search results are still less than 5, call semantic search 76 to perform semantic search, and return the semantic search results (corresponding to the second result set in other embodiments); finally, through the application programming interface 72, return the comprehensive result set containing the pinyin fuzzy search results, the Chinese fuzzy search results, and the semantic search results as the target search results to the user 71.
[0157] See Figure 8 , Figure 8 This is a schematic diagram of the English search process provided in an embodiment of this application. For example... Figure 8 As shown, user 81 sends a search request to application programming interface 82 containing the query content "Data_Loader" and the expected number of results "3" by inputting the information {"Data_Loader", K": 3}. Application programming interface 82 determines through parser 83 that the Chinese part is empty (no Chinese characters) and performs a pinyin conversion operation on the English characters "Data_Loader". Since there are no Chinese characters, the pinyin conversion is still "Data_Loader". Then, a pinyin precise search is performed through precise search 84 and the precise search result is returned (such as "[Data_Loader node]"). Finally, application programming interface 82 returns the precise search result as the target search result to user 81.
[0158] This application's embodiments cover four major scenarios: precise Chinese search, mixed Chinese and English search, error-tolerant search (misspellings, misspellings), and pure English search. The process starts from the API gateway entry point, accurately demonstrating the routing processing function control flow and the pinyin index traversal process. It includes decision branches such as the supplementation path when the number of results is insufficient, the separate activation of Chinese and pinyin fuzzy search, and the existence check of Chinese characters for Chinese blocks. At the same time, it retains key operations such as pinyin query generation, fuzzy search invocation, and result deduplication mechanism, reflecting the progressiveness of supplementation, the dependency relationship of the number of results, and the priority of the supplementation order.
[0159] The following describes the overall technical architecture of the search system provided in this application embodiment. This application embodiment constructs a three-level linked hybrid search engine: "input processor → precise search layer → fuzzy search layer → semantic search layer". The functions and technical details of each level are as follows: 1. Input Processor: Real-time parsing of input information containing mixed strings of Chinese, English, and symbols, breaking it down into standardized elements that can be directly processed to obtain the complete pinyin string, i.e., the first string. The specific processing flow is as follows: Language element separator: Extracts continuous Chinese character blocks through regular expression matching, and retains the remaining non-Chinese characters as is; Dynamic pinyin converter: Performs overall pinyin conversion on Chinese character blocks ("training model" → "xun_lian_mo_xing"), using underscores as delimiters to ensure that word boundaries are recognizable, and retains the original non-Chinese symbols during the conversion process (e.g., "Data_loader node" → "Data_loader_jie_dian"); Symbol tokenization: Constructs a mapping table between commonly used technical symbols (@, _, >, #, etc.) and specific symbol identifiers (tokens) (e.g., __AT__, UNDERSCORE). When returning search results, the token is restored to the original symbol to ensure display consistency.
[0160] This enables context-independent conversion, allowing Chinese character extraction and Pinyin conversion to be performed independently, avoiding segmentation errors caused by mixing Chinese and English; and achieves bidirectional compatibility processing, with the output Pinyin stream simultaneously supporting cross-language calculations by both precise index matching and fuzzy matching engines.
[0161] 2. Precise Search Layer: Establish a Pinyin index structure that supports lightning-fast search, covering complete Pinyin input and abbreviation input scenarios.
[0162] The precise search layer pre-constructs a dual-channel index architecture: the full-pinyin channel stores the full pinyin strings of candidate strings ("deep learning" → "shen_du_xue_xi") through the first candidate set, and the initial-letter channel stores the initial-letter strings of the display names ("deep learning" → "sdxx") through the second candidate set. The precise search layer adopts a real-time search strategy, following the principle of prioritizing the first letter. For the first string of the input information (such as "sdxx"), it searches in the initial-letter channel; at the same time, it performs a full-pinyin search in the full-pinyin channel, and substring matching can be performed during the search process (such as "xue_xi" can match "shen_du_xue_xi"). During system startup, all display names are pre-converted into a dual-channel index and persisted as a binary file to avoid real-time conversion overhead; for very long pinyin strings (over 30 characters), a hash digest is used for storage, and invalid items are quickly eliminated during the search using a Bloom filter.
[0163] In this way, the weights can be reasonably allocated through the precise search layer. For example, when inputting "xl", the full spelling of "xun_lian" is matched first, which takes priority over the first letter of "xl". It also supports cross-language penetration, with English strings being directly passed through to the index layer (such as "loader" matching the "Data_loader node").
[0164] 3. Fuzzy Matching Layer: When the search results from the precise search layer are insufficient, a fuzzy algorithm is used to improve the mixed-language error-tolerant search capability. The execution process is as follows: Multimodal candidate set construction: Select items containing the target Chinese characters (referring to Chinese characters contained in the input information) from all display names in the third candidate set (Chinese candidate set). The first candidate set will uniformly convert the display names into pinyin strings without phonetic symbols (e.g., "technical document" → "ji_shu_wen_dang"). Weighted ratio algorithm matrix operation (Wratio): Similarity score = max(first weight (input information, search results of the first candidate set), second weight (input information, search results of the third candidate set). The weight coefficients can be dynamically adjusted. When the proportion of Chinese characters in the input information is >60%, the second weight increases to 1.2; when the input contains consecutive English characters (corresponding to letter strings in other embodiments), the first weight increases to 1.5. Threshold filtering and sorting: Discard candidate results with similarity <70%, remove duplicates in the search results corresponding to the third and first candidate sets, and retain the highest-scoring version, completing the merging of cross-language results. Fault tolerance design: Supports pinyin dialect variations (e.g., "sen_du" matches "shen_du") and technical term abbreviations (e.g., "gradient descent → tdxj" matches "grad_descent"); retains symbols such as @ and _ in the query to directly participate in similarity calculation. Dynamic candidate set generation: When the input contains Chinese characters, activate the third candidate set + the first candidate set; when the input is pure pinyin, activate the first candidate set + the second candidate set.
[0165] 4. Semantic Search Layer: As a final fallback strategy, it is used to supplement semantically relevant search results not covered by the first two layers. The trigger condition is when the total number of search results from the precise search layer and the fuzzy search layer (corresponding to the first number in other embodiments) is less than the required threshold k. For example, if k=10, the first two layers only return 5 results, then the semantic search layer is activated to supplement the results with 5 search results.
[0166] Semantic Focus: When the input contains valid Chinese characters, Chinese characters are prioritized for semantic queries (e.g., "PyTorch training" focuses on "training"). If the input does not contain Chinese characters, the complete Pinyin stream is used as the semantic vector input. Vectorized Search: A multilingual sentence vector model is used to generate the first semantic vector. Nearest neighbor search is performed based on a search tool, and the candidate with the highest cosine similarity is returned. Result Deduplication Filtering: Display names that are duplicated with the results of the first two layers (precise search layer and fuzzy search layer) are removed. A semantic similarity threshold (>0.65) is set to avoid supplementing irrelevant results. Resource Control: An incremental padding method is used, limiting the padding quantity to a maximum value (5, k×0.3) (k is the expected total number of results) to avoid excessive resource consumption by semantic search. At the same time, a short query filter is set, and the semantic layer is automatically skipped when the number of input characters is <2 (short strings have lower vectorization significance).
[0167] In this embodiment, the construction of the phonetic-free pinyin conversion index is specifically as follows: Pure letter pinyin is generated using a standard pattern, while tones are removed from the pinyin; for example, "deep learning" is converted to "shen_du_xue_xi". Furthermore, a special character preservation mechanism is established to include non-Chinese characters in the search index; for example, the index content corresponding to the "data loader node (Data_loader node)" is "Data_loaderjiedian". Regarding the two-level cache index construction, an example index architecture includes "sdxx" corresponding to "deep learning" (for the initial letter channel), "shen_du_xue_xi" corresponding to "deep learning" (for the full pinyin channel), and "loader_jd" corresponding to the "data loader node (Data_loader node)" (for the mixed Chinese-English index). The initial letter channel supports lightning-fast abbreviation search, the full pinyin channel ensures pinyin variant matching, and all indexes are pre-generated and persistently stored to reduce the overhead of real-time conversion. The cross-language fuzzy matching engine is designed as follows: It adapts to a weighted ratio algorithm, placing Chinese character strings and Pinyin strings in the same edit distance space. Similarity is calculated using the maximum value (weighted ratio algorithm (original query, Chinese character candidate), weighted ratio algorithm (Pinyin query, Pinyin candidate)). A similarity threshold is set to filter low-quality matching results. A multi-threaded parallel computing approach is employed to simultaneously process Chinese character matching and Pinyin matching tasks. The intelligent query parser uses a three-order input decomposition mechanism: a Chinese character extractor uses regular expressions to strip Chinese character blocks from the input; a Pinyin converter transforms the entire Chinese sentence into Pinyin without phonetic symbols while retaining the original symbols; and a symbol marker converts technical symbols into special symbols to ensure their participation in subsequent matching. The three-level linkage search process consists of three steps: The first level is a precise matching at the pinyin index layer, prioritizing the search of the first letter channel, followed by the search of the full pinyin channel, and returning the first k results in real time; the second level is a dynamic activation of the fuzzy matching layer, which, if the number of search results for the pinyin channel is insufficient, first activates the pinyin fuzzy search, and if there is still a gap in results, then activates the native Chinese fuzzy search; the third level is a semantic vector search, which is only triggered when the total number of search results from the pinyin layer and the fuzzy layer is insufficient, and the number of supplementary results is limited to avoid wasting resources.
[0168] The technological breakthroughs of this solution are mainly reflected in three aspects: First, the symbol protection mechanism breaks through the limitation of traditional engines discarding technical symbols. Through symbol tokenization, it achieves the complete preservation and effective search of technical symbols. Second, the dual-channel pinyin index can simultaneously support first-letter lightning search and full-pinyin fuzzy error tolerance, covering diverse input scenarios. Third, the dynamic resource scheduling model observes three core indicators online: the number of candidates for the pinyin channel, the number of effective fuzzy hits (i.e., the number of remaining entries after filtering out obvious noise or low-quality matches), and the symbol tokenization ratio (referring to the proportion of queries parsed as protected symbol tokens, which reflects...). (Technical symbol density and structural complexity) When any upgrade judgment condition is met (including the number of candidates for the Pinyin channel being significantly low, for example, less than half of the preset baseline configured according to the business, the baseline can be set to 50% of the target number of returned items k; or the fuzzy channel not producing a valid hit; or the proportion of the symbol tags in the query exceeding the set threshold, such as 40%, which indicates that the query is highly dependent on symbols and keywords and Pinyin are difficult to cover), resource scheduling actions will be triggered: start the semantic supplementation layer, first encode the query into a semantic vector, then enter the vector index to perform a nearest neighbor search to obtain semantically related candidates, and finally merge and rearrange the semantic candidates with the existing candidates.
[0169] In summary, the embodiments of the present application at least have the following technical effects: First, it significantly improves the accuracy and efficiency of mixed-language search. On the one hand, through Chinese character extraction and full-sentence pinyin conversion, it realizes intelligent parsing of Chinese-English mixed input, which can accurately separate English terms and Chinese characters, and can completely retain technical symbols and semantic units. On the other hand, relying on the dual-channel index to achieve lightning response, the first-letter channel supports abbreviation searches such as "xxjl" → "learning and communication", and the full-pinyin channel can achieve variant matching such as "xuexi" → "learning", and can also support partial fusion scenarios of full pinyin and abbreviations such as "xuexijl" → "learning and communication". Second, it breaks through the fault tolerance bottleneck of traditional search. It not only constructs a three-layer fault tolerance guarantee mechanism to correct typos through the weighted ratio algorithm (such as "neural network" → "neural network"), but also protects key technical symbols; at the same time, it optimizes dynamic resource scheduling, and the semantic complement layer is only activated on demand when the number of merged results is less than the expected number of results. Compared with the full-semantic search scheme, it greatly reduces the frequency of semantic calculation calls and saves a large amount of resources. Third, it realizes seamless multi-language fusion search. It can not only break through the problem of Chinese-English mixed processing and synchronously process English characters and Chinese characters for inputs such as "CNN training", but also innovate the search identification system. Different result types correspond to different user perception values - the precise search type allows users to quickly obtain highly matched results, the fuzzy search type allows users to still get expected results when there are incorrect inputs, and the semantic search type can meet the needs of users when they input non-professionally and return results that match the description. Fourth, it improves the robustness and maintainability of the system. On the one hand, it adopts a pre-loaded index mechanism to load the pinyin index file and vector index file when the service starts. After the service is restarted in the operation and maintenance scenario, the service ability can be restored 100% without waiting for cold start. On the other hand, it has a full-link query ability and can accurately record the trigger reasons and resource consumption of each level of complementation. For example, in a certain search, there are 8 pinyin search results, 2 results need to be supplemented, 1 result is supplemented by pinyin fuzzy, and 1 result is supplemented by semantics, and the total time consumption is only 0.147 seconds. Fifth, it enhances the scalability of the architecture. The pinyin index layer can be seamlessly connected to the distributed storage system, and the fuzzy matching engine supports plug-in algorithm upgrades, which provides convenience for subsequent function iteration.
[0170] Next, continue to describe the exemplary structure of the search device 233 provided by the embodiments of the present application as a software module. In some embodiments, as Figure 2 shown, the software module stored in the search device 233 in the memory 230 may include: A determination module 2331, configured to determine the pinyin string corresponding to each Chinese character when receiving input information for data search and determining that the input information includes at least one Chinese character; Search module 2332 is used to construct a first string corresponding to the input information based on each of the pinyin strings, and perform at least two levels of search processing based on the first string to obtain a first result set, wherein different levels of search processing correspond to different search precisions; The search module 2331 is further configured to perform semantic analysis processing on the input information when the first number of first search results included in the first result set is less than a first threshold, to obtain a first semantic vector corresponding to the input information, and to perform search processing based on the first semantic vector to obtain a second result set. The determining module 2332 is further configured to determine the target search result based on the first result set and the second result set, and output the target search result.
[0171] In some embodiments, the search module 2331 is further configured to perform a first-level search process on the first candidate set based on the first string to obtain a third result set, wherein the first candidate set includes multiple candidate strings and a second string corresponding to each candidate string, the second string being constructed based on the pinyin strings corresponding to the Chinese characters included in the candidate strings; extract the first letter of each pinyin string in the first string, and construct a third string corresponding to the input information based on each first letter; perform a second-level search process on the second candidate set based on the third string to obtain a fourth result set, wherein the second candidate set includes a fourth string corresponding to each candidate string, the fourth string being constructed based on the first letter of the pinyin strings corresponding to the Chinese characters included in the candidate strings; and construct the first result set based on the third result set and the fourth result set.
[0172] In some embodiments, the search module 2331 is further configured to perform a second-level search process in the second candidate set based on the third string to obtain at least one candidate search result; for each candidate search result, search for the candidate search result in the third result set; when no candidate search result is found in the third result set, determine the candidate search as the fourth search result; and construct the fourth result set based on each fourth search result.
[0173] In some embodiments, the search module 2331 is further configured to determine a second number of third search results included in the third result set, and a third number of fourth search results included in the fourth result set; to determine a fourth number by summing the second number and the third number; and to determine the third result set and the fourth result set as the first result set when the fourth number is greater than or equal to the first threshold.
[0174] In some embodiments, the search module 2331 is further configured to: when the fourth quantity is less than the first threshold, perform a third-level search process in the first candidate set based on the first string to obtain a fifth result set; perform a fourth-level search process in the third candidate set based on each Chinese character in the input information to obtain a sixth result set, wherein the third candidate set includes multiple candidate strings; and construct the first result set based on the third result set, the fourth result set, the fifth result set, and the sixth result set.
[0175] In some embodiments, the search module 2331 is further configured to: determine a first similarity between a second string corresponding to a candidate string and the first string for each candidate string in the first candidate set; when the first similarity satisfies a similarity condition, determine the candidate string as a target string; search for the target string in the third result set and the fourth result set; when the target string is not found in the third result set and the fourth result set, determine the target string as a fifth search result; and construct the fifth result set based on each fifth search result.
[0176] In some embodiments, the search module 2331 is further configured to: determine a second similarity between the fifth result set and the input information, and a first weight corresponding to the fifth result set; perform weighted processing on the second similarity based on the first weight to obtain a first score corresponding to the fifth result set; determine a third similarity between the sixth result set and the input information, and a second weight corresponding to the sixth result set; perform weighted processing on the third similarity based on the second weight to obtain a second score corresponding to the sixth result set; determine a target result set from the fifth result set and the sixth result set based on the first score and the second score; and determine the first result set as the union of the third result set, the fourth result set, and the target result set.
[0177] In some embodiments, the search module 2331 is further configured to determine the second similarity based on the similarity between each fifth search result in the fifth result set and the input information; determine the first weight based on the proportion of letter strings in the input information; determine the third similarity based on the similarity between each sixth search result in the sixth result set and the input information; and determine the second weight based on the proportion of Chinese characters in the input information.
[0178] In some embodiments, the search module 2331 is further configured to determine a fourth similarity between each candidate semantic vector in the fourth candidate set and the first semantic vector, wherein the fourth candidate set includes multiple candidate strings and a candidate semantic vector corresponding to each candidate string; sort each candidate semantic vector in descending order based on the fourth similarity to obtain a semantic vector sequence; determine the first N candidate semantic vectors in the semantic vector sequence as second semantic vectors, and determine the candidate string corresponding to each second semantic vector as the second result set, where N is an integer greater than 2.
[0179] In some embodiments, the determining module 2332 is further configured to obtain a preset threshold scaling factor, determine a second threshold based on the product between the first threshold and the threshold scaling factor, obtain a third threshold, and determine the maximum value between the second threshold and the third threshold as N.
[0180] In some embodiments, the search module 2331 is further configured to determine the non-Chinese characters from the input information and determine the position information corresponding to each character in the input information; based on the position information, concatenate each of the pinyin strings and the non-Chinese characters to obtain the first string.
[0181] In some embodiments, the search module 2331 is further configured to determine the symbol identifier corresponding to the symbol character from a preset symbol mapping table; update the symbol character in the non-Chinese characters to the symbol identifier to obtain the updated non-Chinese characters; and concatenate each of the pinyin strings and the updated non-Chinese characters based on the position information to obtain the first string.
[0182] In some embodiments, the determining module 2332 is further configured to, when the first quantity is greater than or equal to the first threshold, determine a fifth similarity between the first search result and the input information for each first search result, and determine a third weight corresponding to the first search result; perform weighted processing on the fifth similarity based on the third weight to obtain a third score corresponding to the first search result; sort each first search result in descending order based on each third score to obtain a first result sequence; and determine the first search result located before a preset position in the first result sequence as the target search result.
[0183] In some embodiments, the determining module 2332 is further configured to determine a seventh result set as the union of the first result set and the second result set, the seventh result set including a plurality of seventh search results, the seventh search results being either the first search result or the second search result; for each of the seventh search results in the seventh result set, determine a sixth similarity between the seventh search result and the input information, and determine a fourth weight corresponding to the seventh search result; perform weighted processing on the sixth similarity based on the fourth weight to obtain a fourth score corresponding to the seventh search result; and determine the target search result from the plurality of seventh search results based on the fourth score corresponding to each of the seventh search results.
[0184] This application provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the search method described above in this application.
[0185] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the search method provided in this application. For example, ... Figure 3A The search method is shown.
[0186] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0187] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0188] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored in a portion of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0189] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0190] In summary, through the embodiments of this application, in response to receiving input information for data search and determining that the input information includes at least one Chinese character, the pinyin string corresponding to each Chinese character is determined; a first string corresponding to the input information is constructed based on each pinyin string, and at least two levels of search processing are performed based on the first string to obtain a first result set, with different levels of search processing corresponding to different search precisions. Thus, by converting Chinese characters into pinyin strings to construct the first string, it can adapt to the user's possible pinyin input habits. Simultaneously, by utilizing different levels of search precision (such as exact matching and fuzzy error tolerance), it ensures a fast response to accurate input while also being compatible with pinyin input deviations, improving adaptability to mixed query scenarios containing Chinese characters. Furthermore, prioritizing results obtained through pinyin-level search reduces resource-intensive semantic computation calls, ensuring search efficiency. Subsequently, when the first number of first search results included in the first result set is less than a first threshold, semantic analysis processing is performed on the input information to obtain a first semantic vector corresponding to the input information, and search processing is performed based on the first semantic vector to obtain a second result set. In this way, by supplementing the search with semantic vector search, more relevant results can be retrieved from a semantic association perspective when the search results at the two levels are insufficient. This avoids the omission of effective information due to the limitations of pinyin matching, further improving the search recall rate. Simultaneously, activating the semantic layer on demand balances resource consumption and search performance while ensuring the completeness of the results. Finally, the target search result is determined based on the first and second result sets and output. By integrating the results of different search methods, the efficiency and accuracy of pinyin-level search are retained, while supplementary information from semantic search is incorporated. This ensures that the output target result balances accuracy, completeness, and scenario adaptability, thereby improving search response speed, result precision, and fault tolerance.
[0191] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A search method characterized by, The method comprises: in response to receiving input information for data search, and determining that at least one Chinese character is included in the input information, determining a pinyin string corresponding to each Chinese character; based on each pinyin string, constructing a first string corresponding to the input information, and performing search processing of at least two levels based on the first string to obtain a first result set, different levels of search processing corresponding to different search accuracies; when the first number of first search results included in the first result set is less than a first threshold value, performing semantic analysis processing on the input information to obtain a first semantic vector corresponding to the input information, and performing search processing based on the first semantic vector to obtain a second result set; determining a target search result based on the first result set and the second result set, and outputting the target search result.
2. The method of claim 1, wherein, The method further comprises: performing first-level search processing in a first candidate set based on the first string to obtain a third result set, the first candidate set including a plurality of candidate strings and a second string corresponding to each candidate string, the second string being constructed based on a pinyin string corresponding to a Chinese character included in the candidate string; extracting the first letter of each pinyin string in the first string, and constructing a third string corresponding to the input information based on each first letter; performing second-level search processing in a second candidate set based on the third string to obtain a fourth result set, the second candidate set including a fourth string corresponding to each candidate string, the fourth string being constructed based on the first letter of a pinyin string corresponding to a Chinese character included in the candidate string; constructing the first result set based on the third result set and the fourth result set.
3. The method of claim 2, wherein, The method further comprises: performing second-level search processing in the second candidate set based on the third string to obtain at least one candidate search result; for each candidate search result, searching for the candidate search result in the third result set; when the candidate search result is not found in the third result set, determining the candidate search result as a fourth search result; constructing the fourth result set based on each fourth search result.
4. The method of claim 2, wherein, The method further comprises: determining a second number of third search results included in the third result set, and determining a third number of fourth search results included in the fourth result; determining a fourth number as the sum of the second number and the third number; when the fourth number is greater than or equal to the first threshold value, determining the third result set and the fourth result set as the first result set.
5. The method of claim 4, wherein, The method further comprises: When the fourth quantity is less than the first threshold, based on the first string, a third level of search processing is performed in the first candidate set to obtain a fifth result set; Based on each of the Chinese characters in the input information, a fourth level of search processing is performed in a third candidate set to obtain a sixth result set, the third candidate set including a plurality of candidate strings; Based on the third result set, the fourth result set, the fifth result set and the sixth result set, the first result set is constructed.
6. The method of claim 5, wherein, The third level of search processing based on the first string in the first candidate set to obtain a fifth result set includes: For each of the candidate strings in the first candidate set, a first similarity between a second string corresponding to the candidate string and the first string is determined; When the first similarity meets a similarity condition, the candidate string is determined as a target string; The target string is searched in the third result set and the fourth result set; When the target string is not found in the third result set and the fourth result set, the target string is determined as a fifth search result; Based on each of the fifth search result, the fifth result set is constructed.
7. The method of claim 5, wherein, The first result set is constructed based on the third result set, the fourth result set, the fifth result set and the sixth result set, including: A second similarity between the fifth result set and the input information is determined, and a first weight corresponding to the fifth result set is determined; The second similarity is weighted based on the first weight to obtain a first score corresponding to the fifth result set; A third similarity between the sixth result set and the input information is determined, and a second weight corresponding to the sixth result set is determined; The third similarity is weighted based on the second weight to obtain a second score corresponding to the sixth result set; Based on the first score and the second score, a target result set is determined from the fifth result set and the sixth result set; The union of the third result set, the fourth result set and the target result set is determined as the first result set.
8. The method of claim 7, wherein, The second similarity between the fifth result set and the input information is determined, and the first weight corresponding to the fifth result set is determined, including: Based on the similarity between each fifth search result in the fifth result set and the input information, the second similarity is determined; Based on the proportion of letter strings in the input information, the first weight is determined; The third similarity between the sixth result set and the input information is determined, and the second weight corresponding to the sixth result set is determined, including: Based on the similarity between each sixth search result in the sixth result set and the input information, the third similarity is determined; Based on the proportion of Chinese characters in the input information, the second weight is determined.
9. The method of claim 1, wherein, The search processing based on the first semantic vector to obtain a second result set includes: For each candidate semantic vector in the fourth candidate set, a fourth similarity between the candidate semantic vector and the first semantic vector is determined, the fourth candidate set including a plurality of candidate character strings and a candidate semantic vector corresponding to each of the candidate character strings; The fourth similarity is sorted in descending order based on each of the candidate semantic vectors to obtain a semantic vector sequence; The first N candidate semantic vectors in the semantic vector sequence are determined as second semantic vectors, and a candidate character string corresponding to each of the second semantic vectors is determined as the second result set, N being an integer greater than 2.
10. The method of claim 9, wherein, The method further comprises: A threshold scaling coefficient is obtained, and a second threshold is determined based on a product between the first threshold and the threshold scaling coefficient; A third threshold is obtained, and the maximum of the second threshold and the third threshold is determined as N.
11. The method according to any one of claims 1 to 10, characterized in that, When the input information further includes a non-Chinese character, the constructing the first character string corresponding to the input information based on each of the pinyin character strings comprises: The non-Chinese character is determined from the input information, and position information corresponding to each character in the input information is determined; The non-Chinese character is updated to the symbol identifier to obtain an updated non-Chinese character based on the position information.
12. The method of claim 11, wherein, The method further comprises: When the first number is greater than or equal to the first threshold, for each of the first search results, a fifth similarity between the first search result and the input information is determined, and a third weight corresponding to the first search result is determined; The third weight is weighted based on the fifth similarity to obtain a third score corresponding to the first search result; Each of the first search results is sorted in descending order based on each of the third scores to obtain a first result sequence; 13. The method according to any one of claims 1 to 10, characterized in that, The first search result located before the preset position in the first result sequence is determined as the target search result. The second result set includes at least one second search result, and the determining the target search result based on the first result set and the second result set comprises: The union of the first result set and the second result set is determined as a seventh result set, the seventh result set including a plurality of seventh search results, the seventh search result being the first search result or the second search result; For each of the seventh search results in the seventh result set, a sixth similarity between the seventh search result and the input information is determined, and a fourth weight corresponding to the seventh search result is determined. 14. The method according to any one of claims 1 to 10, characterized in that, weighting processing is performed on the sixth similarity based on the fourth weight, to obtain a fourth score corresponding to the seventh search result; the target search result is determined from the plurality of seventh search results based on the fourth score corresponding to each of the seventh search results.
15. A search apparatus characterized by comprising: The apparatus comprises: A determination module is configured to, in response to receiving input information for data search, and in response to determining that at least one Chinese character is included in the input information, determine a pinyin string corresponding to each of the Chinese characters; A search module is configured to construct a first string corresponding to the input information based on each of the pinyin strings, and perform search processing in at least two levels based on the first string, to obtain a first result set, different levels of search processing corresponding to different search accuracies; The search module is further configured to, when a first number of first search results included in the first result set is less than a first threshold, perform semantic analysis processing on the input information, to obtain a first semantic vector corresponding to the input information, and perform search processing based on the first semantic vector, to obtain a second result set; The determination module is further configured to determine a target search result based on the first result set and the second result set, and output the target search result.
16. An electronic device, comprising: The electronic device comprises: A memory is configured to store computer executable instructions or computer programs; A processor is configured to, when executing the computer executable instructions or computer programs stored in the memory, implement the method of any one of claims 1 to 14.
17. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, The computer executable instructions or computer programs are executed by the processor to implement the method of any one of claims 1 to 14.
18. A computer program product comprising computer-executable instructions or a computer program, characterized in that, The computer executable instructions or computer programs are executed by the processor to implement the method of any one of claims 1 to 14.