Search macro retrieval method and device, electronic equipment, storage medium and program

By matching the search macro search statements in natural language format input by the user with the vectorized description data of the search macro, the problems of low search efficiency and high learning and maintenance costs in the prior art are solved, and efficient search macro search is achieved.

CN119938945APending Publication Date: 2025-05-06BEIJING YOUTEJIE INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510027509.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

When searching search macros in the prior art, users need to have sufficient understanding of the defined search macros, resulting in high learning and maintenance costs and low retrieval efficiency.

Method used

By obtaining the search macro search statement in natural language format input by the user, the vectorized description data of the search macro is matched with the search statement to obtain the alternate search macro, and filter it to obtain the target search macro and feedback it to the user.

Benefits of technology

It reduces the learning and maintenance costs of search macro users, improves the search efficiency of search macros, and allows users to retrieve search macros that meet their needs without mastering the purpose and calling methods of search macros.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938945A_ABST
    Figure CN119938945A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a search macro retrieval method and device, electronic equipment, a storage medium and a program, and the method comprises the steps: obtaining a search macro retrieval statement in a natural language format input by a current user; performing similarity matching on vectorized description data of the search macro and the search macro retrieval statement to obtain a standby search macro; and filtering the standby search macro to obtain a target search macro, and feeding back the target search macro to the current user. According to the technical scheme provided by the embodiment of the invention, the learning and maintenance cost of search macro users can be reduced, and the search efficiency of the search macro is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of data retrieval, and in particular to a retrieval method, device, electronic device, storage medium and program for searching macros. Background Art

[0002] Search macro is a kind of encapsulation method, similar to the macro mechanism in computer language. It can expand the specific search macro definition before actual execution, thereby reducing the input complexity of complex related statements. Taking SPL (Search Processing Language, a low-code development language designed specifically for log analysis) search macro as an example, search macro supports security features such as parameter naming and parameter verification, and can be nested, that is, calling another macro in one macro. They can contain any part of the SPL command, such as eval (evaluate) statements or search terms, without having to constitute a complete command. Search macros support parameterization, allowing the definition of input parameters, which can be assigned specific values ​​when calling the search macro, allowing the search macro to exhibit changing behaviors according to different needs.

[0003] As the number of search macros increases, the complexity of managing and maintaining these search macros also increases. This includes issues such as updating macros, fixing errors, ensuring compatibility between macros, and preventing naming conflicts. For new users, it is a challenge to master the purpose and calling methods of a large number of search macros. This increases the learning burden for users and may reduce their efficiency and satisfaction in using the system. As the number of search macros increases, more detailed documentation is needed to describe the function and usage of each search macro, as well as how to effectively combine search macros. At the same time, more investment is needed in training users and developers to ensure that they can use these search macros proficiently.

[0004] In the process of implementing the present invention, the inventors found that the prior art has the following defects: when searching for search macros in the prior art, the user needs to have sufficient understanding of the defined search macros, which requires maintaining the document of the defined search macros. Then, the corresponding search macros are extracted according to the keywords or the names of the search macros. This method can maintain search macros at several or dozens of levels. As the number of search macros continues to grow, the traditional search macro retrieval method will require very high maintenance costs and learning costs. Summary of the invention

[0005] The embodiments of the present invention provide a search macro retrieval method, device, electronic device, storage medium and program, which can reduce the learning and maintenance costs of search macro users and improve the search macro retrieval efficiency.

[0006] According to one aspect of the present invention, a retrieval method for a search macro is provided, comprising:

[0007] Get the search macro retrieval statement in natural language format input by the current user;

[0008] Performing similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a backup search macro;

[0009] The backup search macros are filtered to obtain target search macros, and the target search macros are fed back to the current user.

[0010] According to another aspect of the present invention, there is provided a retrieval device for searching macros, comprising:

[0011] A search macro retrieval statement acquisition module is used to acquire the search macro retrieval statement in natural language format input by the current user;

[0012] A spare search macro acquisition module, used for performing similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a spare search macro;

[0013] The target search macro feedback module is used to filter the backup search macros to obtain the target search macro, and feed back the target search macro to the current user.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the search macro retrieval method described in any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the search macro retrieval method described in any embodiment of the present invention when executed.

[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the search macro retrieval method according to any embodiment of the present invention is implemented.

[0020] The embodiment of the present invention obtains the search macro retrieval statement in natural language format input by the current user, performs similarity matching between the vectorized description data of the search macro and the search macro retrieval statement, obtains a backup search macro, and then filters the backup search macro to obtain a target search macro, and feeds the target search macro back to the current user, thereby solving the problems of high learning and maintenance costs and low retrieval efficiency in existing search macro retrieval methods, reducing the learning and maintenance costs of search macro users and improving the retrieval efficiency of search macros.

[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 is a flow chart of a search macro retrieval method provided by Embodiment 1 of the present invention;

[0024] Figure 2 is a flow chart of a search macro retrieval method provided by Embodiment 2 of the present invention;

[0025] Figure 3 is a flowchart of another search macro retrieval method provided by Embodiment 2 of the present invention;

[0026] Figure 4 is a schematic diagram of a retrieval device for searching macros provided in Embodiment 3 of the present invention;

[0027] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] Embodiment 1

[0031] Figure 1 This is a flowchart of a search macro retrieval method provided by the first embodiment of the present invention. This embodiment is applicable to the case where a search macro retrieval statement in a natural language format is retrieved and matched according to the vectorized description data of the search macro. The method can be executed by a search macro retrieval device, which can be implemented by software and / or hardware, and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. As long as the search macro retrieval method can be executed, the embodiment of the present invention does not limit the specific device type of the electronic device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0032] S110: Obtain a search macro retrieval statement in a natural language format currently input by the user.

[0033] The current user may be a user who has a search macro search requirement. The search macro search statement may be a statement input by the current user and used to search for a corresponding search macro.

[0034] The current user can enter a search macro retrieval statement in a natural language format based on the search box of the search macro. Correspondingly, the search box can call an interface to obtain the search macro retrieval statement entered by the current user. Exemplarily, the search macro retrieval statement in a natural language format can be "I want to count the number of people in each grade by gender, what search macro should I use?" That is, the search macro retrieval statement in a natural language format can express the search macro retrieval intention of the current user in an easy-to-understand manner. As a result, the current user does not need to pay the learning cost and usage cost for the search macro, and can retrieve the search macro that meets the needs through the search macro retrieval statement in a natural language format, thereby improving the retrieval efficiency and usage satisfaction of the search macro.

[0035] S120: Perform similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a backup search macro.

[0036] The vectorized description data may include vectorized representation data of the description data of the search macro. The standby search macro may be a search macro obtained by preliminary matching based on similarity matching between the vectorized description data of the search macro and the search macro search statement. Optionally, the search macro may be an SPL search macro or a search macro of other language types. The embodiment of the present invention does not limit the type of the search macro.

[0037] Correspondingly, after obtaining the search macro retrieval statement in natural language format input by the current user, the vectorized description data of the search macro can be obtained to calculate the similarity between the search macro retrieval statement and the vectorized description data of each search macro, so as to filter out the search macro that matches the retrieval intent of the search macro retrieval statement from each search macro based on the calculated similarity as a backup search macro.

[0038] S130: Filter the backup search macros to obtain a target search macro, and feed back the target search macro to the current user.

[0039] The target search macro may be a search macro that matches and is related to the search macro search statement.

[0040] Optionally, the number of spare search macros may be one or more. It is understandable that among the spare search macros initially obtained by performing similarity matching between the vectorized description data and the search macro search statement, some spare search macros may have a higher correlation with the search macro search statement, while some spare search macros may have a lower correlation with the search macro search statement.

[0041] After the backup search macros are screened out according to the similarity calculation results, if there are multiple backup search macros, the backup search macros can be further filtered to delete the backup search macros that are not related to the search macro search statement, and further screen out the search macro with the highest relevance to the search macro search statement as the target search macro. After obtaining the target search macro, the target search macro can be fed back to the current user.

[0042] It can be seen that in the above technical solution, when the user needs to retrieve the search macro, there is no need to master the purpose and calling method of the search macro, nor the use method of the search macro. The user only needs to provide a search macro search statement in natural language format according to the use requirements of the search macro, and the system can automatically parse and search and match the search macro search statement in natural language format provided by the user, thereby providing the user with a search macro with a high matching degree that meets the use requirements of the search macro, greatly reducing the learning and maintenance costs required for the search macro retrieval process, and can also effectively improve the search macro retrieval efficiency.

[0043] The embodiment of the present invention obtains the search macro retrieval statement in natural language format input by the current user, performs similarity matching between the vectorized description data of the search macro and the search macro retrieval statement, obtains a backup search macro, and then filters the backup search macro to obtain a target search macro, and feeds the target search macro back to the current user, thereby solving the problems of high learning and maintenance costs and low retrieval efficiency in existing search macro retrieval methods, reducing the learning and maintenance costs of search macro users and improving the retrieval efficiency of search macros.

[0044] Embodiment 2

[0045] Figure 2 is a flowchart of a search macro retrieval method provided in Embodiment 2 of the present invention. Figure 3 is a flowchart of another search macro retrieval method provided by the second embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, multiple specific optional implementation methods are provided for generating vectorized description data of search macros, performing similarity matching between the vectorized description data of search macros and search macro retrieval statements, and filtering spare search macros. Figure 2 and Figure 3 As shown, the method of this embodiment may include:

[0046] S210: Determine description data of the search macro according to syntax parsing data of the search macro.

[0047] The syntax parsing data may be data content obtained after syntax parsing the search macro.

[0048] In a specific example, taking the SPL search macro as an example, the necessary parameters of the SPL search macro may include name, description and macro definition. The name is the calling name of the search macro, followed by the number of parameters in parentheses. For example, in testMacro(2), "testMacro()" represents the function of the test macro instruction, and the number "2" in the function means that the number of parameters is 2. The description of the search macro is used to briefly describe the macro function. Some search macros have description data, while some search macros do not. The macro definition is the SPL statement represented by the macro. When the macro has parameters, the parameters need to be wrapped with double "$" symbols. Exemplarily, one of the search macros can be the following structure: name countby(1); description: grouping technique by X; macro definition: *|stats count()by$X$. The application of SPL search macros can reduce the workload of repeatedly writing the same logic and split complex SPL into smaller and more manageable parts.

[0049] Specifically, a syntax parser may be used to perform syntax parsing on the search macro, and the search macro may be parsed into a variety of data contents such as name, description, and macro definition. Accordingly, if the search macro has description data, after the search macro is parsed to obtain the parsed data, the description data of the search macro may be directly obtained from the parsed data. If the description data of the search macro is empty, after the search macro is parsed to obtain the parsed data, the parsed data may be used to generate the description data of the search macro.

[0050] In an optional embodiment of the present invention, the search macro includes an underlying search macro, and determining the description data of the search macro based on the syntax parsing data of the search macro may include: determining the name, custom description, macro definition, command definition and function definition information of the underlying search macro based on the syntax parsing data of the underlying search macro; when it is determined that the custom description of the underlying search macro does not meet the description completeness condition, generating a first target prompt based on the name, macro definition, command definition and function definition information of the underlying search macro; and inputting the first target prompt into the target big model to output the description data of the underlying search macro according to the first target prompt through the target big model.

[0051] The underlying search macro may be a search macro that does not call other search macros. The custom description may be the description data of the custom configuration in the search macro. The command and function may be the macro command and the corresponding function configured by definition in the search macro.

[0052] The description completeness condition may be a condition for determining whether the custom description of the search macro is complete and usable. The first target prompt may be a prompt for instructing the target macro model to generate description data of the underlying search macro.

[0053] According to the calling relationship of search macros, search macros can be divided into bottom-level search macros and nested search macros. Among them, bottom-level search macros do not call other search macros, while nested search macros will nestedly call other search macros. Whether it is a bottom-level search macro or a nested search macro, in general, the definer of the search macro will provide a custom description, but the custom description of the search macro may be relatively brief and cannot fully describe the definition of the search macro, or some search macros do not include the content of the custom description. At the same time, in order to improve the accuracy and completeness of the search macro description data, for search macros whose custom descriptions do not meet the description completeness conditions, a bottom-up approach can be used to generate the corresponding description data using the target large language model.

[0054] Exemplarily, the description completeness condition may be having detailed and complete description data. That is, if the custom description of the search macro is empty, or the custom description of the search macro is relatively brief and cannot fully describe the definition of the search macro, it can be considered that the custom description of the search macro does not meet the description completeness condition.

[0055] Correspondingly, for the underlying search macro, the syntax parser can be first used to perform syntax parsing on the underlying search macro to obtain syntax parsing data such as the name, custom description, macro definition, command definition, and function definition of the underlying search macro. Exemplarily, for the underlying search macro "*|stats count()by$X$", the search macro is used to count the event counts of a specific field and group them according to the value of the field. It is an SPL statement. The command "stats" and function "count()" of the search macro can be obtained through the syntax parser, and then the corresponding descriptions of "stats" and "count" can be found in the syntax document. In this way, the name, custom description, macro definition, command definition, and function definition information of the search macro can be obtained. If the custom description of the underlying search macro does not meet the description completeness condition, the first target prompt can be generated according to the name, macro definition, command definition, and function definition information of the underlying search macro, and the first target prompt can be input into the target macro model to output the detailed and complete description data of the underlying search macro according to the first target prompt through the target macro model.

[0056] In a specific example, the first target prompt may be the following:

[0057] Search macro name example Search macro (1)

[0058] Search macro definition search statement | bucket keyword bucket rule | statistics keyword statistics function 1, statistics function 2 by $X$

[0059] Use the syntax definition:

[0060] — Bucket keywords: Definition 1,

[0061] —Statistical keywords: Definition 2,

[0062] Function definition:

[0063] —Statistical function 1: Function definition 1

[0064] —Statistical function 2: Function definition 2

[0065] Please first describe the functions of the above search macro step by step, and finally summarize the functions of the above search macro in one paragraph.

[0066] In an optional embodiment of the present invention, the search macro also includes a nested search macro, and determining the description data of the search macro based on the syntax parsing data of the search macro may also include: determining the name, custom description, macro definition, command definition and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro based on the syntax parsing data of the nested search macro; when it is determined that the custom description of the nested search macro does not meet the description completeness condition, generating a second target prompt based on the name, macro definition, command definition and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro; and inputting the second target prompt into the target big model to output the description data of the nested search macro based on the second target prompt through the target big model.

[0067] Among them, the nested search macro can be a search macro that needs to call other search macros.

[0068] Correspondingly, after all the underlying search macros have been determined to have corresponding description data, the description data of the nested search macros can be processed in a bottom-up manner. For the nested search macros, a syntax parser can be first used to perform syntax parsing on the nested search macros to obtain syntax parsing data such as the name, custom description, macro definition, command definition, and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro. If the custom description of the nested search macro does not meet the description completeness condition, a second target prompt can be generated based on the name, macro definition, command definition, and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro, and the second target prompt can be input into the target macro model to output detailed and complete description data of the underlying search macro according to the second target prompt through the target macro model.

[0069] In a specific example, the second target prompt may be as follows:

[0070] Search macro name Nested search macro (1)

[0071] Search macro definition search statement `Search macro 1()` | Statistics keyword statistics function 1by$X$

[0072] Use the syntax definition:

[0073] —Statistical Keywords: Definition 1

[0074] Function definition:

[0075] —Statistical function 1: Function definition 1

[0076] The search macro called:

[0077] —Search Macro 1

[0078] Definition: Search for the definition of macro 1

[0079] Description: Search for the description of macro 1

[0080] Please first describe the functions of the above search macro step by step, and finally summarize the functions of the above search macro in one paragraph.

[0081] Among them, the target large model can be any large language model (Large Language Model, LLM, can be referred to as a large model), and the embodiment of the present invention does not limit the model type of the target large model. A large language model is also called a large language model, which refers to a deep learning model that can process text sequences using a large amount of relevant data such as text data, voice data, or text-image data, etc., and can generate natural language text or understand the meaning of language text. Such models usually have a parameter scale of more than billions. Large language models can handle a variety of natural language tasks, such as text classification, question and answer, and dialogue, and are widely used. The input of the large language model is data, such as text data, voice data, or text-image data, etc. The large language model can obtain the corresponding word vector representation by encoding the input data, and further decodes the word vector obtained by the encoding, thereby automatically completing the processing of the input data and obtaining the output data corresponding to the input data. Exemplarily, a text can be input to the large language model, and the large language model processes and predicts the input text, and outputs the answer text corresponding to the text.

[0082] S220. Perform vector encoding on the description data of the search macro to obtain vectorized description data of the search macro.

[0083] After the search macro completes the description data generation process, the description data of the search macro can be further vector encoded, so as to convert the description data of the search macro into a vector form and obtain the vectorized description data of the search macro. The description data is represented as a numerical vector through vector encoding technology, and this vectorized description can be stored, retrieved and compared more conveniently. The vectorized description data of the search macro can be stored in a database for use in subsequent searches, matching or applications. This method can improve the processing efficiency and accuracy of the search macro description data, making the management and use of the search macro more efficient and convenient.

[0084] Optionally, the vectorized description data of the search macro may include a description document and a description vector.

[0085] The description document may be a document describing the data itself, and the description vector may be a vector encoding content describing the data.

[0086] That is, the vectorized description data of the search macro can include two types of information: description document and description vector. There is an associated mapping relationship between the description document and the description vector corresponding to the same search macro. Optionally, a mapping relationship between the search macro identifier, the description document and the description vector can be established to facilitate the rapid positioning of the corresponding search macro according to the retrieved description document and / or description vector. Optionally, the search macro identifier can be a unique identifier type such as the search macro name or number.

[0087] Accordingly, the above method may further include the following operations:

[0088] S230: Using an information retrieval probability model, calculate the similarity between the description document in the vectorized description data of the search macro and the search macro search statement to obtain a first backup search macro.

[0089] The information retrieval probability model may be a probability model for information retrieval, and the embodiment of the present invention does not limit the specific model type of the information retrieval probability model. The first standby search macro may be a standby search macro retrieved by the information retrieval probability model for the search macro search statement.

[0090] In the retrieval process of the search macro, the information retrieval probability model can be used to calculate the similarity between the description document and the search macro retrieval statement in the vectorized description data of the search macro, that is, the similarity between the description data and the search macro retrieval statement is calculated from the perspective of the text document to obtain the first backup search macro. The information retrieval probability model can be used to rank the description documents. For the information retrieval probability model, the description document is regarded as a vector containing a series of terms, and the query of the search macro retrieval statement is also represented as a set of terms. The information retrieval probability model can obtain the description document data from the database, and consider factors such as the frequency of the query terms in the description document and the length of the description document to calculate the similarity score between the description document and the query. According to the similarity score calculated by the information retrieval probability model, the top m first backup search macros can be screened out.

[0091] S240: Use a vectorization model to calculate the similarity between the description vector in the vectorized description data of the search macro and the query vector of the search macro retrieval statement to obtain a second backup search macro.

[0092] The vectorized model may be a model for calculating similarity based on vectors, and the embodiment of the present invention does not limit the specific model type of the vectorized model. The second standby search macro may be a standby search macro retrieved by the vectorized model for the search macro search statement.

[0093] In the retrieval process of the search macro, a vectorization model can also be used to calculate the similarity between the description vector in the vectorized description data of the search macro and the search macro retrieval statement, that is, the similarity between the description data and the search macro retrieval statement is calculated from the perspective of the text vector to obtain the second backup search macro. The vectorization model can first vectorize the search macro retrieval statement to obtain a query vector, and obtain the description vector from the database, and then calculate the similarity score between the query vector and the description vector. According to the similarity score calculated by the vectorization model, the top n second backup search macros can be screened out.

[0094] S250: Use a reciprocal sorting fusion method to fuse the first standby search macro and the second standby search macro to obtain the standby search macro.

[0095] The reciprocal sorting fusion method is a commonly used information retrieval technology that can integrate the screening results of search macros from different models to improve the quality and diversity of search results. In the reciprocal sorting fusion method, the ranking order of the first backup search macro and the second backup search macro can be considered, and their reciprocal values ​​(i.e., reciprocal rankings) can be added or weighted to obtain a comprehensive ranking score. Finally, the first backup search macro and the second backup search macro are reordered according to this comprehensive score, and finally the top k backup search macros are obtained.

[0096] S260: Filter the backup search macros to obtain a target search macro, and feed the target search macro back to the current user.

[0097] In an optional embodiment of the present invention, filtering the backup search macros to obtain the target search macro may include: inputting each of the backup search macros into a target macro model; calculating the correlation between each of the backup search macros and the search macro retrieval statement through the target macro model; and filtering the target search macro from each of the backup search macros according to the correlation calculation result.

[0098] In order to further improve the accuracy of search macro retrieval, after obtaining the backup search macros through multiple model retrievals, each backup search macro can be input into the target macro model to calculate the relevance between each backup search macro and the search macro retrieval statement through the target macro model. If the backup search macro is related to the search macro retrieval statement, it can be recommended to the current user as a target search macro. If the backup search macro is not related to the search macro retrieval statement, the backup search macro is discarded.

[0099] The above technical solution can introduce large model technology to automatically generate description data of search macros, so as to use the description data of search macros to recommend semantically related search macros to users. At the same time, using large language model technology to manage these search macros can effectively help new users to quickly find the desired search macros, which can reduce the learning and maintenance costs of search macro users.

[0100] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data comply with relevant laws, regulations and standards in relevant regions.

[0101] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present invention.

[0102] Embodiment 3

[0103] Figure 4 is a schematic diagram of a retrieval device for searching macros provided in Embodiment 3 of the present invention, such as Figure 4 As shown, the device includes: a search macro retrieval statement acquisition module 310, a backup search macro acquisition module 320 and a target search macro feedback module 330, wherein:

[0104] A search macro retrieval statement acquisition module 310 is used to acquire a search macro retrieval statement in a natural language format currently input by a user;

[0105] A backup search macro acquisition module 320 is used to perform similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a backup search macro;

[0106] The target search macro feedback module 330 is used to filter the backup search macros to obtain the target search macro, and feed back the target search macro to the current user.

[0107] The embodiment of the present invention obtains the search macro retrieval statement in natural language format input by the current user, performs similarity matching between the vectorized description data of the search macro and the search macro retrieval statement, obtains a backup search macro, and then filters the backup search macro to obtain a target search macro, and feeds the target search macro back to the current user, thereby solving the problems of high learning and maintenance costs and low retrieval efficiency in existing search macro retrieval methods, reducing the learning and maintenance costs of search macro users and improving the retrieval efficiency of search macros.

[0108] Optionally, a vectorized description data generation module is used to: determine the description data of the search macro according to the syntax parsing data of the search macro; and perform vector encoding on the description data of the search macro to obtain the vectorized description data of the search macro.

[0109] Optionally, the search macro includes an underlying search macro, and the vectorized description data generation module is also used to: determine the name, custom description, macro definition, command definition and function definition information of the underlying search macro based on the syntax parsing data of the underlying search macro; when it is determined that the custom description of the underlying search macro does not meet the description completeness condition, generate a first target prompt based on the name, macro definition, command definition and function definition information of the underlying search macro; input the first target prompt into the target big model to output the description data of the underlying search macro according to the first target prompt through the target big model.

[0110] Optionally, the search macro also includes a nested search macro, and the vectorized description data generation module is also used to: determine the name, custom description, macro definition, command definition and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro based on the syntax parsing data of the nested search macro; when it is determined that the custom description of the nested search macro does not meet the description completeness condition, generate a second target prompt based on the name, macro definition, command definition and function definition information of the nested search macro, as well as the custom description and macro definition information of the underlying search macro called by the nested search macro; input the second target prompt into the target big model to output the description data of the nested search macro according to the second target prompt through the target big model.

[0111] Optionally, the vectorized description data of the search macro includes a description document and a description vector; the backup search macro acquisition module 320 is also used to: use an information retrieval probability model to calculate the similarity between the description document in the vectorized description data of the search macro and the search macro retrieval statement to obtain a first backup search macro; use a vectorized model to calculate the similarity between the description vector in the vectorized description data of the search macro and the query vector of the search macro retrieval statement to obtain a second backup search macro; use a reciprocal sorting fusion method to fuse the first backup search macro and the second backup search macro to obtain the backup search macro.

[0112] Optionally, the target search macro feedback module 330 is further used to: input each of the backup search macros into the target macro model; calculate the relevance between each of the backup search macros and the search macro retrieval statement through the target macro model; and filter the target search macro from each of the backup search macros according to the relevance calculation result.

[0113] The above-mentioned search macro retrieval device can execute the search macro retrieval method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the search macro retrieval method provided by any embodiment of the present invention.

[0114] Since the search macro retrieval device introduced above is a device that can execute the search macro retrieval method in the embodiment of the present invention, based on the search macro retrieval method introduced in the embodiment of the present invention, the technicians in this field can understand the specific implementation of the search macro retrieval device of this embodiment and its various variations, so how the search macro retrieval device implements the search macro retrieval method in the embodiment of the present invention will not be described in detail here. As long as the technicians in this field implement the device used by the search macro retrieval method in the embodiment of the present invention, it belongs to the scope of protection of this application.

[0115] Embodiment 4

[0116] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0117] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0118] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0119] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a retrieval method for searching macros.

[0120] Optionally, the search macro retrieval method may include: obtaining a search macro retrieval statement in a natural language format input by the current user; performing similarity matching on the vectorized description data of the search macro and the search macro retrieval statement to obtain a backup search macro; filtering the backup search macro to obtain a target search macro, and feeding back the target search macro to the current user.

[0121] In some embodiments, the retrieval method for searching macros may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the retrieval method for searching macros described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the retrieval method for searching macros in any other appropriate manner (e.g., by means of firmware).

[0122] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0123] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0124] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0126] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0127] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0128] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0129] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A retrieval method for searching macros, characterized in that: include: Get the search macro retrieval statement in natural language format input by the current user; Performing similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a backup search macro; The backup search macros are filtered to obtain target search macros, and the target search macros are fed back to the current user.

2. The method according to claim 1, characterized in that: Before obtaining the search macro retrieval statement currently input by the user, the method further includes: Determining description data of the search macro according to the syntax parsing data of the search macro; Vector encoding is performed on the description data of the search macro to obtain vectorized description data of the search macro.

3. The method according to claim 2, characterized in that The search macro includes an underlying search macro, and the step of determining the description data of the search macro according to the syntax parsing data of the search macro includes: Determine the name, custom description, macro definition, command definition and function definition information of the underlying search macro according to the syntax parsing data of the underlying search macro; If it is determined that the user-defined description of the underlying search macro does not meet the description completeness condition, generating a first target prompt according to the name, macro definition, command definition and function definition information of the underlying search macro; The first target prompt is input into the target macro model, so as to output the description data of the underlying search macro according to the first target prompt through the target macro model.

4. The method according to claim 3, characterized in that The search macro also includes a nested search macro, and the step of determining the description data of the search macro according to the syntax parsing data of the search macro also includes: Determining the name, custom description, macro definition, command definition and function definition information of the nested search macro, and the custom description and macro definition information of the underlying search macro called by the nested search macro according to the syntax parsing data of the nested search macro; If it is determined that the custom description of the nested search macro does not meet the description completeness condition, generating a second target prompt according to the name, macro definition, command definition and function definition information of the nested search macro, and the custom description and macro definition information of the underlying search macro called by the nested search macro; The second target prompt is input into the target macro model, so as to output the description data of the nested search macro according to the second target prompt through the target macro model.

5. The method according to claim 1, characterized in that The vectorized description data of the search macro includes a description document and a description vector; and the vectorized description data of the search macro is matched with the search macro search statement for similarity to obtain a backup search macro, including: Using an information retrieval probability model to calculate the similarity between the description document in the vectorized description data of the search macro and the search macro search statement, to obtain a first backup search macro; Using a vectorized model to calculate the similarity between a description vector in the vectorized description data of the search macro and a query vector of the search macro retrieval statement, to obtain a second backup search macro; The first standby search macro and the second standby search macro are fused by adopting a reciprocal sorting fusion method to obtain the standby search macro.

6. The method according to claim 1, characterized in that The filtering of the backup search macro to obtain the target search macro includes: Inputting each of the backup search macros into the target macro model; Calculating the relevance between each of the backup search macros and the search macro retrieval statement through the target macro model; The target search macro is obtained by filtering from each of the backup search macros according to the correlation calculation result.

7. A retrieval device for searching macros, characterized in that: include: A search macro retrieval statement acquisition module is used to acquire the search macro retrieval statement in natural language format input by the current user; A spare search macro acquisition module, used for performing similarity matching between the vectorized description data of the search macro and the search macro search statement to obtain a spare search macro; The target search macro feedback module is used to filter the backup search macros to obtain the target search macro, and feed back the target search macro to the current user.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the search macro retrieval method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the search macro retrieval method described in any one of claims 1 to 6 when executed.

10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the search macro retrieval method described in any one of claims 1 to 6 is implemented.