Vertical class retrieval method and electronic equipment

By preconfiguring search templates for different scenarios, the problem of high development and maintenance costs in traditional solutions is solved, and the convenience and cost-effectiveness of adapting to the search needs of different scenarios is achieved.

CN119961296AActive Publication Date: 2025-05-09HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202311434422.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-09
Estimated Expiration
2043-10-30

AI Technical Summary

Technical Problem

Traditional vertical search solutions have high development and maintenance costs on electronic devices, long update cycles, and are difficult to adapt to the search needs of different application scenarios.

Method used

By preconfiguring the search templates for different scenarios, confirm the scene after receiving the search terms, match the preconfigured template for DSL statement encapsulation, and call the corresponding search engine for search.

Benefits of technology

It achieves the ability to meet the search needs in different scenarios, while shortening the development time, reducing development costs, and improving the update and maintenance convenience of the search system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961296A_ABST
    Figure CN119961296A_ABST
Patent Text Reader

Abstract

The invention provides a vertical class retrieval method and electronic device.The method comprises the steps that different retrieval templates are configured for different scenes in advance, that is, retrieval rules of the different scenes are configured in advance, when a retrieval word is received, the pre-configured retrieval template matched with the scene of the retrieval word can be found, and then the retrieval word can be retrieved according to the pre-configured retrieval template; and based on the matched version, packaging the DSL statement and calling an associated search engine to retrieve. According to the scheme, the whole retrieval process can meet different retrieval requirements of different scenes at the same time, the mode of pre-configuring the retrieval template is more beneficial to subsequent updating and maintenance, and compared with a traditional scheme, the development time is shortened, and the development cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic devices, and in particular to a vertical category retrieval method and electronic device. Background Art

[0002] Vertical field retrieval, also known as vertical category retrieval, is becoming more and more widely used. When providing services to users in different vertical fields, it is inevitable to provide related retrieval services. Therefore, it is necessary to quickly build corresponding retrieval capabilities based on their different vertical category data.

[0003] In traditional solutions, if vertical search services are set up on electronic devices, a specific search system must be built for each specific vertical field. This requires programmers to write tedious codes from the beginning until the entire search system is built. The development cycle is long and the personnel requirements are high, resulting in high costs and long update cycles. In addition, due to the continuous updating and upgrading of electronic devices, new search requirements may arise, and the search requirements of different application scenarios may also have different search focuses. In traditional solutions, these situations can only repeat the above development process to build a new search system, otherwise they cannot be searched.

[0004] Therefore, how to provide a better vertical category retrieval solution that is easier to update and maintain is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The present application provides a vertical category retrieval method and electronic device that can be more conveniently updated and maintained and adapt to the retrieval needs of different scenarios.

[0006] In a first aspect, a method for vertical category retrieval is provided, the method comprising: receiving a search term from a second electronic device, the search term being input by a user in a search bar of an application running on the second electronic device; determining a scenario of the search term, the scenario of the search term comprising an application source and a scenario identifier; determining a target template matching the scenario of the search term from at least one preconfigured retrieval template of at least one defined scenario, each defined scenario corresponding to at least one preconfigured retrieval template; encapsulating the search term into a domain specific language (DSL) statement according to an instruction of the target template to obtain a target DSL statement; sending the target DSL statement to a matching search engine for retrieval to obtain a retrieval result; and sending the retrieval result to the second electronic device.

[0007] In the technical solution of the present application, different versions are mainly configured for different scenarios in advance, that is, the search rules for different scenarios are pre-configured. Then, when the search term is received, the pre-configured search template matching the scenario can be found, and the DSL statement is encapsulated based on the matching version and the associated search engine is called for retrieval, so that the entire retrieval process can simultaneously meet the different retrieval requirements of different scenarios, and this method of pre-configuring search templates is more conducive to subsequent updates and maintenance. Compared with traditional solutions, it shortens the development time and saves development costs.

[0008] In combination with the first aspect, in certain implementations of the first aspect, when determining a target template that matches the scene of the search term from at least one preconfigured retrieval template of at least one defined scene, it may include: when at least one preconfigured retrieval template cached in the cache space of the first electronic device contains the target template, reading the target template from the cache space; or, when there is no target template in the cache space of the first electronic device, reading the target template from the database. In this implementation, the target template is first searched from the local cache space of the first electronic device, and the target template can be found. If the target template can be found in the local cache space, it is read locally first, and if it is not found locally, it is searched and read from the database instead.

[0009] In one example, when there is no target template in the cache space of the first electronic device, the step of reading the target template from the database may include: when the database contains the target template, reading the target template from the database; or, when there is no target template in the database, generating abnormal indication information and sending it to the second electronic device. When taking the target template from the database, if it is in the database, it can be read; if there is no corresponding version in the database, it is necessary to end the search and inform the second electronic device of the abnormality.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: after reading the first template from the database for the first time, storing the first template in a cache space of the first electronic device, wherein the first template is any version of all preconfigured retrieval templates in the database. In this implementation, the target template can be found more quickly later by storing it in the local cache space after reading it from the database for the first time.

[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: when the number of times the second template is read from the database within a preset time period is greater than or equal to a preset threshold, storing the second template in a cache space of the first electronic device. In this implementation, a threshold is set for the versions cached locally, and only the more commonly used versions are stored in the local cache space, which can reduce the occupation of the local cache space while ensuring that it is convenient to find the target template faster later.

[0012] In combination with the first aspect, in certain implementations of the first aspect, when sending the target DSL statement to a matching search engine for retrieval, it may include: performing template parameter verification on the target DSL statement; when the parameter verification succeeds, sending the target DSL statement to a matching search engine for retrieval; or, when the parameter verification fails, generating abnormal indication information and sending it to the second electronic device. In this implementation, verification of the encapsulated DSL statement is added to avoid failure to complete the retrieval due to errors in the encapsulated data, and if the verification fails, the retrieval is terminated and the second electronic device is notified of the abnormality.

[0013] In combination with the first aspect, in certain implementations of the first aspect, before determining the target template, the method further includes: defining at least one scenario, and for each at least one scenario, creating at least one preconfigured retrieval template for the scenario; sending the defined scenario and the created preconfigured retrieval template corresponding to the scenario to a database for storage. In this implementation, it is necessary to predefine the scenario and create the preconfigured retrieval template first, and put these in a database so that these data can be retrieved from the database later. The database plays a role of centralized management, and can increase the storage capacity of the version, and can also effectively reduce the storage pressure in the case of local storage.

[0014] In conjunction with the first aspect, in certain implementations of the first aspect, the method further includes: when the target template is not read from the cache space of the first electronic device and from the database, a prompt message is displayed on the screen of the first electronic device, the prompt message is used to instruct the staff to add a definition of the scene corresponding to the search term and create a search template for the scene. In this implementation, when the target template cannot be found at all, it can also be prompted that a new search template needs to be created for this scene.

[0015] In combination with the first aspect, in certain implementations of the first aspect, each preconfigured search template includes a scene identifier and a DSL statement format, the scene identifier includes a scene code and / or a scene name, and the DSL statement format includes keywords and types. The scene code and the scene name can be regarded as examples of different scene identifiers, and the two can also be used in a superimposed manner. The DSL statement format is mainly used to guide what content to encapsulate and how to encapsulate.

[0016] In one example, each preconfigured retrieval template also includes at least one of the following: a version identifier, an associated index, and an application source identifier, and the associated index includes the index library corresponding to the preconfigured retrieval template. The version identifier can be understood as being for distinguishing different versions under the same scenario, but it should be understood that although a scenario can have multiple versions, at the same time, a scene can only have one version online, otherwise it will be impossible to determine which target template should be used. The index can be understood as a directory or link to a pre-created index library. Each preconfigured retrieval template will have an associated index to determine the index library corresponding to this preconfigured retrieval template.

[0017] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: performing version control on each preconfigured search template in both the sandbox and online environments; the version control in the sandbox environment includes at least one of the following: creating a new version, putting the created version online, editing the existing version, and deleting the existing version; the version control in the online environment includes taking the online version offline. Performing version creation and maintenance control in the sandbox can effectively prevent the impact on ongoing search services (stock services), and only those created or modified in the sandbox will be put online.

[0018] Version control in a live environment can also include deleting versions that are no longer offline.

[0019] In one example, version control also includes control based on the version status of each preconfigured search template, and the version status includes: editing, online, offline, and offline. Editing may be done when creating, or it may be modified again after creation. Offline means that it has been created or modified but not yet online. Offline means that it has been online and has been offline.

[0020] In one example, editing and deleting an existing version is performed when the version status is offline or offline. If the version is still online, modification or deletion will inevitably cause the retrieval service to be unavailable, so editing or deletion can only be performed when the version status is offline or offline, and editing or deletion must be performed in a sandbox environment.

[0021] In a second aspect, a device for performing vertical category retrieval is provided, the device comprising a unit composed of software and / or hardware for executing any one of the methods of the first aspect.

[0022] In a third aspect, an electronic device is provided, comprising a memory, one or more processors, and a computer program stored in the memory and executable on the processors, wherein when the one or more processors execute the computer program, the electronic device is enabled to implement any one of the methods of the first aspect.

[0023] In a fourth aspect, a chip is provided, comprising a processor, wherein the processor is used to read and execute a computer program stored in a memory, and when the computer program is executed by the processor, the electronic device in which the chip is located can implement any one of the methods of the first aspect.

[0024] Optionally, the chip also includes a memory, and the memory is electrically connected to the processor.

[0025] Optionally, the chip may also include a communication interface.

[0026] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by an electronic device, any one of the methods according to the first aspect can be implemented.

[0027] In a sixth aspect, a computer program product is provided, which includes a computer program, and when the computer program is executed by an electronic device, it can implement any one of the methods of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a schematic diagram of a vertical category retrieval system of an embodiment of the present application.

[0029] Figure 2 It is a schematic flowchart of a method for vertical category retrieval in an embodiment of the present application.

[0030] Figure 3 It is an interactive diagram for defining a retrieval scenario in an embodiment of the present application.

[0031] Figure 4 It is a schematic diagram of the interface interaction of version control in a sandbox environment of an embodiment of the present application.

[0032] Figure 5 It is a schematic diagram of the interface interaction of version control in an online environment of an embodiment of the present application.

[0033] Figure 6 It is a schematic diagram of the conversion logic of a version state of an embodiment of the present application.

[0034] Figure 7 It is a schematic flowchart of another vertical category retrieval method of an embodiment of the present application.

[0035] Figure 8 It is a schematic diagram of a vertical category retrieval system of an embodiment of the present application.

[0036] Fig. 9 It is a schematic diagram of a vertical category retrieval device in an embodiment of the present application.

[0037] Fig.10 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0038] The scheme of the embodiment of the present application is introduced below with reference to the accompanying drawings.

[0039] Figure 1 Schematic diagram of a vertical category search system in an embodiment of the present application. Figure 1 As shown, electronic device A can be a server or a computer, which is used to execute the steps executed by the first electronic device in the embodiment of the present application, and can be regarded as an example of the first electronic device below. Electronic device B can be a terminal device such as a mobile phone, a tablet computer, a laptop computer, etc., and can be regarded as an example of the second electronic device below.

[0040] For ease of understanding, here, electronic device A is taken as a cloud server and electronic device B is taken as a mobile phone. Electronic device A can store or read data in a database (DB), and can also call a search engine to search and receive search results.

[0041] An application is running on the mobile phone, that is, application C. When the user enters the search term in the search bar of application C, the search term will be sent to the cloud server and will carry the application and scenario of the search term. After receiving the search term, the cloud server finds a matching search template based on the scenario and then encapsulates the domain-specific language (DSL) statement based on the instructions of the search template. After encapsulation, the corresponding search engine can be called for retrieval, and then the search results are sent back to the mobile phone. At this point, the search is completed.

[0042] The search template can be understood as the work flow (work instructions) of the search process, or the instruction manual of the search process, or the search rules, or the search format.

[0043] If you change the application and enter a new search term, the process is still the same, but the matching version found will be different, so the search engine called may be different, and the search results will also be different. If you enter a new search term in another scenario of application C (corresponding to another interface), the process is the same, but the matching version found will be different, so the search engine called may be different, and the search results will also be different.

[0044] The embodiments of the present application are mainly aimed at the problem that in traditional solutions, each retrieval system can only adapt to the retrieval needs of one scenario, which makes updating and maintenance inconvenient, and the development or maintenance costs are high and time-consuming. By pre-configuring appropriate search versions for different scenarios, it is possible to adapt to the retrieval needs of different scenarios at the same time, and updating and maintenance are more convenient and cost-effective.

[0045] Figure 2 This is a schematic flow chart of a method for vertical category retrieval in an embodiment of the present application. Figure 2 The method is applied to a first electronic device, which may be a cloud server or other electronic device capable of performing scene definition and version control, and capable of calling a search engine.

[0046] S201: Receive a search term from a second electronic device, where the search term is input by a user in a search bar of an application running on the second electronic device.

[0047] The second electronic device can be, for example, a mobile phone, a tablet computer, etc., which are not listed one by one, as long as they can provide vertical search services. For the running application, as long as there are vertical search services, there is no limitation. For example, it can be a sports health application or a smart space application, etc., which are not listed one by one.

[0048] After the user inputs the search word, the search word can be sent to the first electronic device through the communication interface of the second electronic device.

[0049] S202: Determine the scenario of the search term, where the scenario of the search term includes an application source of the search term and a scenario identifier.

[0050] A scenario can be understood as corresponding to a business, which can be a business under a certain application. For example, different sections (businesses) in an audio-visual application, such as songs, short videos, web browsing, etc., can be regarded as a business. When a user enters the same search term in different sections, different resources can still be retrieved. For another example, a health application may include business sections such as weight loss and body shaping. If a user searches for "running" in the weight loss section, it may be possible to retrieve how to lose weight by running, and search for "running" in the body shaping section, it can be retrieved how to build muscle by running. In this example, running in the weight loss section may be fast running or alternating fast and slow running, while in the body shaping section, it may be more fast running or weighted running. When searching, it is necessary to compare the search term and the keyword (title), and the retrieved results may be divided into multiple result groups, or understood as types or columns. It can be grouped by data carrier type, such as video, audio, text, etc.; it can also be grouped by content category. For example, a health application can group content into content categories such as courses, sharing, and punching. Other situations are not listed one by one.

[0051] From the above examples, we can see that the search requirements in different scenarios are different, which can be understood as the required knowledge bases are different. Therefore, using scenarios as the granularity to correspond to vertical categories is more in line with the search requirements of different businesses in different applications of electronic devices. Other situations will not be listed one by one.

[0052] The application source can be understood as the application from which the search term is reported. The scenario identifier can be understood as the type of scenario, which can be a business name or a customized text or character identifier, as long as it can distinguish different search scenarios.

[0053] S203: Determine a target template that matches the scene of the search term from at least one preconfigured search template of at least one defined scene, where each defined scene corresponds to at least one preconfigured search template.

[0054] By pre-creating some pre-configured search templates corresponding to different scenarios, once the scenario of the received search term is determined, the matching version, i.e. the target template, can be found from these pre-configured search templates. A scenario can correspond to one or more pre-configured search templates.

[0055] These pre-configured search templates can be centrally stored in a database for easy centralized management and use, and can be read from the database when needed. One or more versions that may be used can also be stored locally on the first electronic device, so that they can be read directly locally later, without having to fetch data from the database every time.

[0056] For an explanation of the version, see Figure 1 Related content will not be repeated.

[0057] In one implementation, step S203 may include: when at least one pre-configured search template cached in the cache space of the first electronic device includes the target template, reading the target template from the cache space; or, when there is no target template in the cache space of the first electronic device, reading the target template from a database (DB). In this implementation, the target template is first searched from the local cache space of the first electronic device, and the target template can be found. If the target template can be found in the local cache space, it is read from the local space first, and if it is not found locally, it is searched and read from the database instead.

[0058] In one example, when there is no target template in the cache space of the first electronic device, the step of reading the target template from the database may include: when the database contains the target template, reading the target template from the database; or, when there is no target template in the database, generating abnormal indication information and sending it to the second electronic device. When taking the target template from the database, if it is in the database, it can be read; if there is no corresponding version in the database, it is necessary to end the search and inform the second electronic device of the abnormality.

[0059] In one implementation, the method further includes: after reading the first template from the database for the first time, storing the first template in a cache space of the first electronic device, wherein the first template is any version of all preconfigured search templates in the database. In this implementation, the target template can be found more quickly later by storing it in the local cache space after reading it from the database for the first time.

[0060] In another implementation, the method further includes: when the number of times the second template is read from the database within a preset time period is greater than or equal to a preset threshold, storing the second template in the cache space of the first electronic device. In this implementation, a threshold is set for the versions cached locally, and only the more commonly used versions are stored in the local cache space, which can reduce the occupation of the local cache space while ensuring that it is convenient to find the target template faster later.

[0061] In one implementation, before determining the target template, the method further includes: defining at least one scenario, and for each at least one scenario, creating at least one preconfigured retrieval template for the scenario; sending the defined scenario and the preconfigured retrieval template created corresponding to the scenario to a database for storage. In this implementation, it is necessary to predefine the scenario and create the preconfigured retrieval template first, and put these in the database so that the data can be retrieved from the database later. The database plays a role in centralized management, and can increase the storage capacity of the version, and can also effectively reduce the storage pressure in the case of local storage.

[0062] In another implementation, the method further includes: when the target template is not read from the cache space of the first electronic device and from the database, a prompt message is displayed on the screen of the first electronic device, the prompt message is used to instruct the staff to add a definition of the scene corresponding to the search term and create a search template for the scene. In this implementation, when the target template cannot be found at all, it can also be prompted that a new search template needs to be created for this scene.

[0063] S204: Encapsulate the search term into a DSL statement according to the instruction of the target template to obtain a target DSL statement.

[0064] The target template may include the encapsulation format of the DSL statement, and encapsulation may be performed according to the format.

[0065] In one implementation, each preconfigured search template includes a scenario identifier and a DSL statement format, wherein the scenario identifier includes a scenario code and / or a scenario name, and the DSL statement format includes keywords and types. The scenario code and the scenario name can be regarded as examples of different scenario identifiers, and the two can also be used in a superimposed manner. The DSL statement format is mainly used to guide what content to encapsulate and how to encapsulate it.

[0066] In one example, each preconfigured retrieval template also includes at least one of the following: a version identifier, an associated index, and an application source identifier, and the associated index includes the index library corresponding to the preconfigured retrieval template. The version identifier can be understood as being for distinguishing different versions under the same scenario, but it should be understood that although a scenario can have multiple versions, at the same time, a scene can only have one version online, otherwise it will be impossible to determine which target template should be used. The index can be understood as a directory or link to a pre-created index library. Each preconfigured retrieval template will have an associated index to determine the index library corresponding to this preconfigured retrieval template.

[0067] In one example, the definition of a search scenario can be as follows Figure 3 As shown. Figure 3As shown in (a), the scenario in the sports health application is taken as an example. It can be seen that the application ID of the sports health application is represented by app_sport_xxx. In the case where there is already an application name, the application ID is added to effectively distinguish similar applications. In addition, when the electronic device is processing in the background, the application ID is needed to recognize the application instead of the Chinese name of the application. Figure 3 There are both scene codes and scene names. Take 123 as an example for the scene code and scene1 as an example for the scene name. It can be seen that the scene does not necessarily have to be named after the corresponding business. However, in actual use, in order to increase readability, it is preferred to name the scene name and scene code after the business. The associated index exists in the form of a doc document. The DSL statement format gives keywords (i.e. title) and types (i.e. column type) (the type can be understood as corresponding to the above title type, such as running video, running is the keyword, and video is the type). Here, the keyword can be the default field as an example, for example Figure 3 The "$title" and "$type" in the URL represent the default keyword and default type respectively. Figure 3 The DSL statement format shown in (a) also defines the result field ""_source":["name","age"]", that is, the DSL statement format can include other elements besides keywords and types according to actual conditions.

[0068] Figure 3 As shown in (b), a schematic diagram of the debugging results is also given after the search scenario is defined. During the debugging process, you can enter the title and type and then click Search to test. Here, the title is entered as Health Course and the type is entered as 1 as an example.

[0069] In short, you can modify the DSL statement format to match different search requirements. For example, for a single business application scenario, you can only agree on the title in the DSL statement format, that is, only agree on keywords. For applications with more business, you can add elements to further subdivide the search requirements of different scenarios.

[0070] In the scheme of the embodiment of the present application, even if new scenarios are added later or existing scenarios have new retrieval requirements, the new retrieval requirements can be adapted by recreating the retrieval template of the scenario or modifying the parameters in the created retrieval template, thereby achieving more convenient maintenance and adaptation to new requirements, saving development time and development costs.

[0071] S205: Send the target DSL statement to a matching search engine for retrieval to obtain a retrieval result.

[0072] After the DSL statement is encapsulated, the corresponding search engine can be called for retrieval. The corresponding search engine can be called by associating the index, or based on the encapsulated DSL statement.

[0073] In one implementation, step S205 may include: performing template parameter verification on the target DSL statement; when the parameter verification succeeds, sending the target DSL statement to a search engine that matches it for retrieval; or, when the parameter verification fails, generating abnormal indication information and sending it to the second electronic device. In this implementation, verification of the encapsulated DSL statement is added to avoid failure to complete the retrieval due to errors in the encapsulated data, and if the verification fails, the retrieval is terminated and the second electronic device is notified of the abnormality.

[0074] S206: Send the search result to the second electronic device.

[0075] The search result may be sent to the second electronic device through the communication interface.

[0076] In order to better manage different versions, you can also set up different management environments, such as sandbox and online management environments. In the sandbox environment, you can create, maintain, and launch versions, and in the online environment, you can take versions offline.

[0077] In one implementation, the method further includes: performing version control on each preconfigured search template in both the sandbox and online environments; the version control in the sandbox environment includes at least one of the following: creating a new version, putting the created version online, editing the existing version, and deleting the existing version; the version control in the online environment includes taking the online version offline. The creation and maintenance control of versions in the sandbox can effectively prevent the impact on the ongoing search business (stock business), and only those created or modified in the sandbox will be put online.

[0078] Version control in a live environment can also include deleting versions that are no longer offline.

[0079] In one example, version control also includes control based on the version status of each preconfigured search template, and the version status includes: editing, online, offline, and offline. Editing may be done when creating, or it may be modified again after creation. Offline means that it has been created or modified but not yet online. Offline means that it has been online and has been offline.

[0080] In one example, editing and deleting an existing version is performed when the version status is offline or offline. If the version is still online, modification or deletion will inevitably cause the retrieval service to be unavailable, so editing or deletion can only be performed when the version status is offline or offline, and editing or deletion must be performed in a sandbox environment.

[0081] exist Figure 2 In the scheme shown, different templates are configured for different scenarios in advance, that is, the search rules for different scenarios are pre-configured. Then, when the search term is received, the pre-configured search template matching the scenario can be found, and the DSL statement is encapsulated based on the matching version and the associated search engine is called for search, so that the entire search process can simultaneously meet the different search requirements of different scenarios. Moreover, this method of pre-configuring search templates is more conducive to subsequent updates and maintenance. Compared with traditional solutions, it shortens the development time and saves development costs.

[0082] Figure 4 Schematic diagram of the interface interaction of version control in a sandbox environment of an embodiment of the present application. Figure 4 As shown, in the sandbox environment of the scene management, various information including the name of the application, scene code, scene name, etc. The status column gives examples of draft (that is, not online), online, under revision (that is, editing), and offline.

[0083] You can also perform version control by clicking Edit, Go Online, or Delete these controls. Figure 4 Only scenes in the draft and offline states have edit and delete controls, while scenes in the online and under-modification states do not have edit and delete controls.

[0084] Figure 5 Schematic diagram of the interface interaction of version control in an online environment of an embodiment of the present application. Figure 5 As shown, in the online environment of the scene management, various information including application name, scene code, scene name, etc. The status column gives examples of online and offline.

[0085] You can also perform version control by clicking View, Offline, Refresh, and Delete. Figure 5 Only offline scenes have delete controls, and online scenes do not have delete controls. Offline scenes will appear in the sandbox environment, while online scenes can be deleted.

[0086] Figure 6 Schematic diagram of the conversion logic of a version state in an embodiment of the present application. Figure 6As shown, the "draft" state is converted to the "online" state after going online, the "online" state is converted to the "modifying" state when editing, the "modifying" state is converted to the "online" state after going online, the "modifying" state can also be converted to the "offline" state after going offline, the "online" state is converted to the "offline" state after going offline, the "draft" state can be converted to the "deleted" state after being deleted, the "offline" state can be converted to the "draft" state when editing, and the "offline" state can be converted to the "deleted" state after being deleted. It should also be understood that the "deleted" state can continue to be displayed on the interactive interface, and a cleanup control is added to instruct the user to delete it to prevent the user from regretting and wanting to restore it. But it is more common that the "deleted" state is gone and is no longer displayed on the interactive interface.

[0087] Figure 7 It is a schematic flowchart of another vertical category retrieval method of an embodiment of the present application. Figure 7 It can be seen as Figure 2 An example of the method shown is shown below. Figure 7 Each step is introduced.

[0088] S701, perform business verification of the search term, if the verification passes, proceed to step S702, if the verification fails, proceed to step S711.

[0089] S702: Read the application identifier (appid) and scene identifier (sceneid) used to query the scene configuration.

[0090] A scenario configuration is a preconfigured search template.

[0091] S703, determine whether there is a corresponding scene configuration in the local cache, when the judgment result is yes, turn to execute step S704, when the judgment result is no, turn to execute step S705.

[0092] The corresponding scenario configuration is the target template mentioned above.

[0093] S704: Read corresponding scene configuration from the local cache.

[0094] S705, determine whether there is a corresponding scenario configuration in the database (DB), when the judgment result is yes, turn to execute step S706, when the judgment result is no, turn to execute step S711.

[0095] S706: Read corresponding scene configuration from the database.

[0096] S707: Perform DSL encapsulation to obtain DSL statements.

[0097] S708, perform template parameter verification. If the verification passes, proceed to step S709; if the verification fails, proceed to step S711.

[0098] S709: Send the DSL statement to a corresponding search engine for retrieval.

[0099] S710: Encapsulate the search results and return them.

[0100] Return can be understood as sending back to the electronic device that sent the search term.

[0101] S711. Encapsulate the exception information and return it.

[0102] Figure 8 It is a schematic diagram of a vertical category retrieval system of an embodiment of the present application. Figure 8 The system shown can be used to implement the solution of the embodiment of the present application. Figure 8 The system shown can be regarded as Figure 1 As a specific example, the search side can be regarded as the electronic device B side, and the operation side can be regarded as the electronic device A side. The search side is used to send vertical data to the operation side, and the operation side is used to perform subsequent steps. However, it should be understood that Figure 8 The search engine and DB in the system do not need to belong to the operation side, but can be used by the operation side. Figure 8 As shown, the scenario definition and version control are performed on the operation side server, and the scenario definition and each created version are sent to the DB database. These scenario definitions and versions can also be synchronized to the local cache space.

[0103] When the search side device sends a vertical data, it can distribute the scene based on the vertical data, that is, determine its scene information, and then obtain the scene configuration of the scene from the local cache or DB. After that, DSL statements are generated based on the scene configuration, and the generated DSL statements are sent to the corresponding search engine for retrieval, so that different scenes can be retrieved using the search engine associated with them.

[0104] The above mainly introduces the method of the embodiment of the present application in conjunction with the accompanying drawings. It should be understood that although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence, these steps are not necessarily performed in sequence in the order shown in the figure. Unless clearly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the various embodiments described above may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a part of the steps or stages in other steps. The device of the embodiment of the present application is introduced below in conjunction with the accompanying drawings.

[0105] Fig. 9 Schematic diagram of a vertical category search device in an embodiment of the present application. Fig. 9 As shown, the device 2000 includes a transceiver unit 2001 and a processing unit 2002. The device 2000 can be integrated in electronic devices such as computers, servers, and cloud devices.

[0106] The device 2000 can be used to perform any of the vertical category search methods described above. For example, the transceiver unit 2001 can be used to perform steps S201 and S206, and the processing unit 2002 can be used to perform steps S202-S205. For another example, the device 2000 can also be used to perform Figure 7 The device 2000 can also be used to perform Figure 8 The steps performed by the equipment on the operating side in the process shown.

[0107] In one implementation, the apparatus 2000 may further include a storage unit for storing relevant data. The storage unit may be integrated in any one of the above units, or may be a unit independent of all the above units.

[0108] Fig.10 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. Fig.10 As shown, the electronic device 3000 includes: at least one processor 3001 ( Fig.10 Only one is shown in the figure) a processor, a memory 3002, and a computer program 3003 stored in the memory 3002 and executable on the at least one processor 3001, and when the processor 3001 executes the computer program 3003, the steps in any one of the above methods are implemented.

[0109] Those skilled in the art will understand that Fig.10These are merely examples of electronic devices and do not constitute a limitation on the electronic device. In practice, the electronic device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0110] The processor 3001 may be a central processing unit (CPU), other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0111] In some embodiments, the memory 3002 may be an internal storage unit of the electronic device 3000, such as a hard disk or memory of the electronic device 3000. In other embodiments, the memory 3002 may also be an external storage device of the electronic device 3000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 3000. Optionally, the memory 3002 may also include both an internal storage unit of the electronic device 3000 and an external storage device. The memory 3002 is used to store an operating system, an application program, a boot loader, data, and other programs, such as the program code of the computer program. The memory 3002 may also be used to temporarily store data that has been output or is to be output.

[0112] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0113] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0114] The embodiment of the present application also provides an electronic device, which includes: one or more processors, a memory, and a computer program stored in the memory and executable on the one or more processors, wherein the one or more processors execute the computer program so that the electronic device can implement the steps in any of the above methods. The embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by the electronic device, the steps in each of the above method embodiments can be implemented.

[0115] The computer-readable medium may include at least: any entity or device capable of carrying computer program codes to a camera / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk, or an optical disk. In some jurisdictions, according to legislation and patent practice, a computer-readable medium cannot be an electric carrier signal or a telecommunication signal.

[0116] The present application embodiment provides a computer program product, which includes a computer program, and when the computer program is executed by an electronic device, the steps in the above-mentioned various method embodiments can be implemented. The computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form.

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

[0118] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0119] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0122] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0123] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0124] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0125] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A vertical category search method, characterized in that: Applicable to a first electronic device, comprising: Receiving a search term from a second electronic device, where the search term is input by a user in a search bar of an application currently running on the second electronic device; Determining the scenario of the search term, wherein the scenario of the search term includes an application source and a scenario identifier of the search term; Determining a target template matching the scene of the search term from at least one preconfigured search template of at least one defined scene, each defined scene corresponding to at least one preconfigured search template; According to the instruction of the target template, encapsulate the search term into a domain specific language DSL statement to obtain a target DSL statement; Sending the target DSL statement to a search engine that matches it for retrieval to obtain retrieval results; The search result is sent to the second electronic device.

2. The method according to claim 1, characterized in that The step of determining a target template matching the scene of the search term from at least one pre-configured search template of at least one defined scene comprises: When at least one pre-configured retrieval template cached in the cache space of the first electronic device includes the target template, reading the target template from the cache space; or, When the target template does not exist in the cache space of the first electronic device, the target template is read from the database DB.

3. The method according to claim 2, characterized in that When the target template is not in the cache space of the first electronic device, reading the target template from the database includes: When the database contains the target template, reading the target template from the database; or, When the target template does not exist in the database, abnormal indication information is generated and sent to the second electronic device.

4. The method according to claim 2, characterized in that: The method further comprises: After the first template is read from the database for the first time, the first template is stored in the cache space of the first electronic device, where the first template is any version of all preconfigured retrieval templates in the database.

5. The method according to claim 2, characterized in that: The method further comprises: When the number of times the second template is read from the database within a preset time period is greater than or equal to a preset threshold, the second template is stored in the cache space of the first electronic device.

6. The method according to claim 2, characterized in that The method further comprises: When the target template is not read from the cache space of the first electronic device and from the database, a prompt message is displayed on the screen of the first electronic device, and the prompt message is used to instruct the staff to add a definition of the scene corresponding to the search term and create a search template for the scene.

7. The method according to any one of claims 1 to 6, characterized in that The step of sending the target DSL statement to a search engine that matches the target DSL statement for retrieval to obtain retrieval results includes: Performing template parameter verification on the target DSL statement; When the parameter verification succeeds, the target DSL statement is sent to a matching search engine for retrieval; or, When the parameter verification fails, abnormal indication information is generated and sent to the second electronic device.

8. The method according to any one of claims 1 to 6, characterized in that Before determining the target template, the method further includes: Defining at least one scenario, and for each of the at least one scenario, creating at least one preconfigured retrieval template for the scenario; The defined scenario and the created pre-configured retrieval template corresponding to the scenario are sent to the database for storage.

9. The method according to any one of claims 1 to 6, characterized in that Each preconfigured search template includes a scenario identifier and a DSL statement format, wherein the scenario identifier includes a scenario code and / or a scenario name, and the DSL statement format includes a keyword and a type.

10. The method according to claim 9, characterized in that Each preconfigured search template also includes at least one of the following: a version identifier, an associated index, and an application source identifier, and the associated index includes an index library corresponding to the preconfigured search template.

11. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Version control is performed on each preconfigured search template in both the sandbox and online environments; version control in the sandbox environment includes at least one of the following: creating a new version, putting the created version online, editing the existing version, and deleting the existing version; version control in the online environment includes taking the online version offline.

12. The method according to claim 11, characterized in that The version control also includes controlling based on the version status of each preconfigured search template, where the version status includes: editing, online, offline, and offline.

13. The method according to claim 12, characterized in that Editing a created version and / or deleting an existing version is performed when the version status is offline or offline.

14. An electronic device comprising a memory, one or more processors, and a computer program stored in the memory and executable on the processors, characterized in that: When the one or more processors execute the computer program, the electronic device implements the method according to any one of claims 1 to 13.

15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by an electronic device, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Data retrieval method and device, electronic equipment and computer storage medium

    CN112015771A

  • Searching method and device, electronic equipment and storage medium

    CN115809255A

  • Distributing search loads to optimize security event processing

    US11588844B1

  • Search query refinement using generated keyword triggers

    US20230046298A1

  • Method, apparatus and electronic device for video content retrieval

    WO2017088415A1