Keyword search method, search device and electronic device
By detecting network status and keyword changes in electronic devices and combining the network status of the last search, the problem of web search results not being refreshed is solved, and the user experience and the accuracy of search results are improved.
Patent Information
- Application Number
- CN202410309863.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-03-18
AI Technical Summary
In the scenario where the network status of electronic devices changes and keywords remain unchanged, the web search results are not refreshed, resulting in poor user experience.
By detecting the search command, the current network status and keyword changes of the electronic device are determined. If the keyword remains unchanged and the device triggered a web search in a networkless state during the last search, the web search will be performed to update the results.
Ensure that when the network status changes, the search results of the web page matching keywords are updated in a timely manner to improve the user experience and the accuracy of search results.
Smart Images

Figure CN118349721B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of search technology, and more specifically, to a keyword search method, a search device and an electronic device. Background Art
[0002] With the development of smart terminals, users can use keywords to search for content matching keywords on electronic devices. Currently, electronic devices (e.g., mobile phones, laptops) support searching for local content of electronic devices (referred to as local search) and searching for web content (referred to as web search), and obtain local search results and web search results.
[0003] For web search, in order to reduce the time consumption caused by searching the Internet and the resulting display delay, when the keywords of the two previous search processes remain unchanged, the electronic device does not need to perform the web search process, but reuses the web search results obtained from the web page in the last search process, thereby improving the efficiency of web search. In this way, the web search process will only be executed when the keywords change. However, in the scenario where the network status of the electronic device changes and the keywords remain unchanged, the web search results for the same keyword will not be refreshed, resulting in a poor user experience. For example, in the scenario where the electronic device changes from an offline state to an online state and the keywords remain unchanged, since the web search results in the offline state have no relevant content, when the offline state changes to an online state, the web search results still have no relevant content, and the user experience is poor. Summary of the invention
[0004] The embodiments of the present application provide a keyword search method, a search device, and an electronic device, which can improve user experience.
[0005] In a first aspect, a keyword search method is provided, which is applied to an electronic device and includes:
[0006] A first search instruction for a first keyword is detected; in response to detecting the first search instruction, determining whether the electronic device is currently in a networked state; when it is determined that the electronic device is currently in a networked state, determining whether the first keyword is the same as a historical keyword used in a previous search process and whether the electronic device has triggered a web search in an offline state during the previous search process, the previous search process being the most recent search process of the electronic device before the first search instruction is detected; when it is determined that the first keyword is the same as a historical keyword and the electronic device has triggered a web search in an offline state during the previous search process, searching the web page for content matching the first keyword to obtain web page search results corresponding to the first keyword, the web page search results including at least one web page association word matching the first keyword.
[0007] It should be understood that when an electronic device triggers a web search, it means that the electronic device triggers the electronic device to perform conditional judgment after detecting a search instruction, but the web search is not ultimately performed after the conditional judgment. When an electronic device performs a web search, it means that the electronic device obtains web search results from a web page. Specifically, the electronic device sends a search request to the network to obtain web search results. For the search process described in the above embodiment, the electronic device performs a web search after performing a conditional judgment, that is, searches for content matching the first keyword from the web page to obtain web search results corresponding to the first keyword.
[0008] In some embodiments, the first search instruction includes any of the following:
[0009] An input operation of entering the first keyword in the search box.
[0010] When the first keyword has been entered in the search box, a selection operation is performed on any tab page. For example, any tab page can be such as Figure 1 Any tab among the All, Images, Apps, Documents, Folders, Archives, Videos, Audios, Webpages, etc.
[0011] When the first keyword has been entered in the search box, a selection operation is performed on any sorting option. For example, any sorting option can be Figure 3 You can select any of the sorting options such as match degree, name, modification date, type and size as shown in (a) in the figure.
[0012] When the first keyword has been entered in the search box, a selection operation is performed on any option of any one of the at least one attributes, where the attribute represents the attribute of the file. For example, the at least one attribute may be Figure 1 The name, type, path, modification date, size and other attributes in the property column of the , each attribute corresponds to multiple options, such as Figure 3 As shown in (b) to (d) in FIG.
[0013] When the first keyword has been entered in the search box, the network information when the network status changes. For example, the network information may be an IP address of the network or a network status value used to indicate the network status, where the network status is either connected or disconnected.
[0014] In the keyword search method provided by the embodiment of the present application, after detecting the search instruction, the electronic device will determine whether the electronic device is currently in a network state. When it is determined that the electronic device is currently in a network state, it will further determine whether the keyword has changed (that is, whether the first keyword is the same as the historical keyword used in the last search process) and whether the electronic device has triggered a web search in an offline state during the last search process. When it is determined that the keyword has not changed and the electronic device has triggered a web search in an offline state during the last search process, the electronic device performs a web search to obtain the web search results corresponding to the first keyword. In the above method, the electronic device not only determines whether to perform a web search based on the change of the keyword, but also determines whether to perform a web search based on the change of the network state. The change of the keyword and the change of the network state are combined to jointly determine whether to perform a web search. When it is determined that the web search can be performed, the web search results are obtained. In this way, the web search results can be displayed to the user, improving the user experience.
[0015] In addition, considering that in scenarios where the network status of electronic devices changes frequently, the web page may not be refreshed, resulting in the interface displaying web search results for other keywords, thereby causing inaccurate search results, the embodiments of the present application can also promptly obtain the web search results corresponding to the current keywords from the web page to improve the accuracy of obtaining web search results, thereby further improving the user experience. If it is stipulated that the web search of the electronic device is triggered when the electronic device changes from being off network to having network, but as long as the keywords do not change, the electronic device still reuses the web search results obtained from the last search, then in scenarios where the network status changes frequently, the web page may not be refreshed, resulting in the interface displaying web search results for other keywords. Fig.10 For example, Fig.10 As shown in (a) in FIG. 1 , when searching for the first time, the keyword is keyword 1 (eg, text) and the electronic device is connected to the Internet, and a web search result of keyword 1 is obtained; Fig.10As shown in (c), the electronic device is disconnected from the Internet and changes the keyword (to keyword 2, such as a text document) for search. Since there is no network, the electronic device will not obtain the web search results for keyword 2. When the electronic device is in a networked state but does not change the keyword (i.e., the keyword is still keyword 2) for search, because the electronic device changes from no network to networked, a web search will be triggered. However, since the keyword remains unchanged, the electronic device will reuse the web search results obtained last time according to the code logic, i.e., reuse the web search results for keyword 1, resulting in the web search results for keyword 1 (such as text) not being refreshed. In this scenario, the web search results for keyword 1 do not match keyword 2, resulting in inaccurate search results. Therefore, when considering whether to perform a web search based on network changes, the embodiment of the present application further considers whether the electronic device has triggered a web search in an offline state. For the scenario where the above-mentioned electronic device changes from networked to offline and then to networked, Fig.10 As shown in (d), when the electronic device is in a network state but does not change the keyword (that is, the keyword is still keyword 2) for searching, since the keyword of this search is the same as the keyword of the last search, and the electronic device triggered a web search when it was off the network last time, the electronic device will search for content matching keyword 2 from the web page after conditional judgment, that is, perform a web search for keyword 2 to obtain web search results for keyword 2. In this way, web search results matching the keyword can be obtained in a timely manner, improving the accuracy of obtaining web search results, thereby further improving user experience.
[0016] Optionally, in the above step of determining whether the first keyword is the same as the historical keyword used in the last search process and whether the electronic device has triggered a webpage search in the off-network state in the last search process when it is determined that the electronic device is currently in the network state:
[0017] When it is determined that the electronic device is currently in a network state, determine whether the first keyword is the same as the historical keyword; when it is determined that the first keyword is the same as the historical keyword, determine whether the electronic device triggered a web page search in an offline state during the last search process.
[0018] The keyword search method provided in the embodiment of the present application, when it is determined that the electronic device is currently in a network state, first determines whether the keyword has changed and then determines whether the electronic device has triggered a web search in an offline state. For the situation where a web search is performed when the keyword changes, the process of determining whether the electronic device has triggered a web search in an offline state can be omitted, which can save processing time and improve user experience.
[0019] Optionally, in the above step of determining whether the first keyword is the same as the historical keyword when it is determined that the electronic device is currently in a networked state: when it is determined that the electronic device is currently in a networked state, determine whether the first keyword is the same as the historical keyword based on a keyword change identifier, wherein the keyword change identifier is used to identify a first change state or a second change state, the first change state is used to identify that the keywords used in the two previous search processes are different, and the second change state is used to identify that the keywords used in the two previous search processes are the same.
[0020] The keyword search method provided in the embodiment of the present application identifies the change state of the keyword through the keyword change identifier, which is easy to implement and is conducive to the interactive processing between various modules in the device. For example, after detecting the keyword, the search box module of the search application compares the keywords before and after twice and sets the change state of the keyword change identifier, which is convenient for the IPC module to determine whether the keyword has changed based on the keyword change identifier, and then execute the subsequent process.
[0021] Optionally, in the above-mentioned step of determining whether the electronic device has triggered a web page search in an offline state during the last search process when it is determined that the first keyword is the same as the historical keyword: when it is determined that the first keyword is the same as the historical keyword, determining whether the electronic device has triggered a web page search in an offline state during the last search process according to the network's search identifier, wherein the network's search identifier is used to identify a first search state or a second search state, the first search state is used to identify that the electronic device has triggered a web page search in an offline state, and the second search state is used to identify a search state other than the first search state; and the method also includes: when it is determined that the electronic device has triggered a web page search in an offline state during the last search process, updating the network's search identifier from the first search state to the second search state.
[0022] The keyword search method provided in the embodiment of the present application identifies (or records) whether the electronic device has triggered a web page search in an offline state through a network search identifier, so that the electronic device can determine whether the electronic device has triggered a web page search in an offline state through the search state (first search state or second search state) identified by the network search identifier during the next search.
[0023] Optionally, the method further includes: when it is determined that the first keyword is different from the historical keyword, searching for content matching the first keyword on the web page to obtain web page search results corresponding to the first keyword.
[0024] The keyword search method provided in the embodiment of the present application determines that a keyword change (ie, the first keyword is different from the historical keyword) is performed on a web page search, and can effectively and timely obtain the web page search results corresponding to the first keyword.
[0025] Optionally, the method further includes: when it is determined that the first keyword is the same as the historical keyword and the electronic device has not triggered a web search without a network connection during the last search, using the web search results corresponding to the historical keyword as the web search results corresponding to the first keyword.
[0026] The keyword search method provided in the embodiment of the present application, when it is determined that the keyword remains unchanged (that is, the first keyword is the same as the historical keyword) and the electronic device did not trigger a web search in an offline state during the last search process, it means that the web search results of the historical keywords must have been obtained in a networked state during the last search process. Then, for this search, when the first keyword is the same as the historical keyword, the web search results of the first keyword are also the web search results of the historical keyword. Therefore, the web search results of the last search process are directly reused, saving the time of searching the network.
[0027] Optionally, the method further includes: when it is determined that the electronic device is in an offline state, displaying an offline interface to indicate that the electronic device is in an offline state.
[0028] The keyword search method provided in the embodiment of the present application can timely remind the user of the current network status by displaying an offline interface on the electronic device when the electronic device is offline, making it easier for the user to take measures to connect to the network, thereby improving the user experience.
[0029] Optionally, before detecting the first search instruction for the first keyword, the method also includes: in response to detecting the second search instruction for the second keyword, obtaining web page search results corresponding to the second keyword when the electronic device is in a network state, the second keyword is different from the first keyword; in response to detecting the third search instruction for the first keyword, triggering a web page search for the first keyword when the electronic device is in an offline state.
[0030] It should be understood that the web page search results corresponding to the second keyword obtained based on the second search instruction can be obtained from the web page during this search based on actual conditions, or the previous web page search results can be reused without changing the keywords.
[0031] Optionally, the above-mentioned detection of the first search instruction for the first keyword includes: detecting the first search instruction under the first tab page, and the first tab page can display the web page search results; and, when it is determined that the first keyword is the same as the historical keyword and the electronic device has triggered a web page search without a network connection during the last search process, searching the web page for content matching the first keyword, and after obtaining the web page search results corresponding to the first keyword, the method also includes: displaying the web page search results corresponding to the first keyword.
[0032] In a second aspect, an electronic device is provided, and the electronic device is used to execute the method provided in the first aspect. Specifically, the electronic device may include a module for executing any possible implementation manner of the first aspect.
[0033] In a third aspect, an electronic device is provided, comprising a processor. The processor is coupled to a memory and can be used to execute instructions in the memory to implement the method in any possible implementation of the first aspect. Optionally, the electronic device also includes a memory. Optionally, the device also includes a communication interface, and the processor is coupled to the communication interface.
[0034] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a device, the device implements the method in any possible implementation manner of the first aspect.
[0035] According to a fifth aspect, a computer program product comprising instructions is provided, wherein when the instructions are executed by a computer, the device implements the method in any possible implementation manner of the first aspect.
[0036] In a sixth aspect, a chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method in any possible implementation of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is a set of GUIs for the search process performed by the electronic device in a network state provided by an embodiment of the present application.
[0038] Figure 2 It is the GUI of the search results under the "Web Page" tab provided in the embodiment of the present application.
[0039] Figure 3 It is a GUI of the sorting function provided by the embodiment of the present application and multiple options in each attribute.
[0040] Figure 4 It is a GUI for opening a search application by means of a shortcut key provided in an embodiment of the present application.
[0041] Figure 5 It is a GUI for opening a search application through the YOYO assistant provided in an embodiment of the present application.
[0042] Figure 6 It is a GUI for opening a search application through a control provided in an embodiment of the present application.
[0043] Figure 7 It is a GUI for opening a search application through a computer manager application provided in an embodiment of the present application.
[0044] Figure 8 It is a schematic flowchart of a keyword search method 800 provided in an embodiment of the present application.
[0045] Fig. 9 It is a schematic flowchart of a keyword search method 900 provided in an embodiment of the present application.
[0046] Fig.10 A set of GUIs for searching keywords in a scenario where the network status changes frequently is provided in an embodiment of the present application.
[0047] Fig.11 It is a software structure block diagram of the electronic device provided in the embodiment of the present application.
[0048] Fig.12 It is a schematic flowchart of a keyword search method from the perspective of interaction between various modules in an electronic device provided in an embodiment of the present application.
[0049] Fig.13 This is another schematic flowchart of a keyword search method from the perspective of interaction between various modules in an electronic device provided in an embodiment of the present application.
[0050] Fig.14 It is an exemplary block diagram of the keyword search device 1400 provided in an embodiment of the present application.
[0051] Fig.15 It is a schematic structural diagram of an electronic device 1500 provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0053] The embodiments of the present application involve keyword search and can be applied to any electronic device that can perform keyword search, for example, mobile phones, tablet computers, wearable devices, laptop computers, netbooks, personal digital assistants (PDAs), and other types of electronic devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0054] In the keyword search, the user can use the keyword to search for content matching the keyword on the electronic device. For keywords, the electronic device not only supports local search, but also supports web search. Local search means searching for content matching the keyword in the local database of the electronic device to obtain local search results. Web search means that the electronic device searches for content matching the keyword on a web page (or network) to obtain web search results. It should be understood that web search can only be successfully performed when the electronic device is in a network state, and web search cannot be performed when the electronic device is in a networkless state.
[0055] For the convenience of description, the relevant contents of the search method involved in the present application are first introduced through a graphical user interface (GUI). In addition, the display interface of a notebook computer is used as an example for description.
[0056] Figure 1 It is a set of GUIs for the search process performed by the electronic device in a network state provided by an embodiment of the present application. Figure 2 It is the GUI of the search results under the "Web Page" tab provided in the embodiment of the present application. Figure 3 It is a GUI of the sorting function and multiple options in each attribute provided by the embodiment of the present application, wherein: Figure 3 (a) in the figure shows the GUI of the sorting function. Figure 3 (b) to Figure 3 (d) in the figure shows a GUI with multiple options for each attribute.
[0057] refer to Figure 1 The GUI shown in (a) detects the user's operation of opening the search application and displays the search box 10.
[0058] Here, the search application can be any application without any limitation, for example, Honor's smart search application. In addition, the operation of opening the search application can be any and without any limitation, for example, the operation of the shortcut key, the operation of the control center search application control, etc. Figures 4 to 7 Provide detailed explanation.
[0059] refer to Figure 1 The GUI shown in (b) in FIG. 1 detects an operation of inputting the keyword "text" in the search box 11, performs a local search and a web search in response to the operation, and displays an interface 20. The interface 20 includes the search box 10, a tab bar 21, a control 22 for a sorting function, a search result interface 23, and a scroll bar 24. When the search result interface 23 cannot fully display the search result, pulling the scroll bar 24 can scroll to display the complete search result.
[0060] The tab list 21 includes tabs of multiple content types, and the content types of each tab are different. For example, the multiple content types of tabs include all, pictures, applications, documents, folders, compressed packages, videos, audios, web pages, and other tabs of different content types. For tabs of different content types, search results of different content types will be displayed. For example, refer to Figure 1 In the GUI shown in (b), for the "All" tab 211, the search results displayed in the search results interface 23 are the search results of all content types that have been searched. Figure 1 In the GUI shown in (c) of FIG. 1 , pulling the scroll bar 24 downwards can display search results of more content types. The bottom one is the search results of web pages, i.e., web page search results 23a. Web page search results 23a include multiple web page association words, such as "text", "text document", "text comparison", etc., which can match "text". For another example, for the "Picture" tab, the search results displayed are the search results for the picture type (not shown in the figure). For another example, referring to Figure 2 In the GUI shown, for the "Web Page" tab 212, the search results displayed in the search results interface 23 are web page search results 23a obtained only from the web page. Select any web page associated word (such as "text"), and the interface 234 of the search results interface 23 will display the content about the web page associated word (such as "text").
[0061] The control 22 of the sorting function includes the current sorting option (such as the matching degree) and a drop-down icon (such as an inverted triangle icon). By clicking the control 22, multiple sorting options can be displayed. Figure 3 In the GUI shown in (a), the user clicks (for example, by clicking the mouse or clicking the finger) on the control 22. In response to the operation, a sort list 22a is displayed. The sort list 22a includes multiple sort options. For example, the multiple sort options may include sort options such as matching degree, name, modification date, type, and size. Exemplarily, the color of the control 22 will also become darker to facilitate the user to focus on the currently selected content. In implementation, the user selects (for example, by selecting the mouse or selecting the finger) any sort option, and the electronic device will sort the search results of each content type based on any sort option, thereby displaying the search results according to the matching degree of each content type. Taking the sort option of "matching degree" as an example, the user selects the sort option of "matching degree", and the default is the order of matching degree from large to small. The electronic device sorts the search results of each content type based on the order of matching degree from large to small, thereby displaying the search results according to the matching degree of each type. Figure 3In the "All" tab shown in (a), search results of various content types (such as pictures, documents, etc.) are displayed, and the search results of each content type are sorted from large to small according to the degree of match. In addition, exemplarily, in order to facilitate users to select the search result with the best match, the content with the best match is displayed first, such as the search result of text-70 under "Best Match".
[0062] The search result interface 23 is used to display various search results.
[0063] For local search results, each search result may be displayed by the attributes of the content corresponding to the search result. Therefore, the search result interface 23 may include an attribute bar 231 and a search result list 232. Each search result includes the attributes of the content corresponding to the search result. Figure 1 In the GUI shown in (b) of FIG. 1 , the attribute bar 231 includes multiple attributes, for example, the multiple attributes include the name, type, path, modification date, size and other attributes of the content corresponding to the search result, and each search result may include multiple attributes of the corresponding content. In addition, except for the name, each attribute of the remaining attributes corresponds to multiple options. When any option of any attribute is selected, the electronic device searches for content that satisfies any option of the attribute to obtain and display the corresponding search result. The search result list 232 includes each search result.
[0064] refer to Figure 3 In the GUI shown in (b), for the attribute "type", click the control 2311 of "type", and the electronic device displays the attribute list 2311a, which includes multiple options in "type". For example, the multiple options may include options of different formats such as "unspecified", "PDF document", "WORD document", "PPT document", etc., wherein the option "unspecified" indicates that there is no restriction on the format of the content. It can be understood that the multiple options in "type" represent multiple formats of the file, and one option corresponds to one format. Exemplarily, the color of the control 2311 will also become darker, so that the user can focus on the currently selected content. In implementation, select any option in "type", the electronic device searches for content that satisfies any option in "type", obtains and displays the corresponding search results. For example, the user selects the option "unspecified" in "type", and in response to this operation, the electronic device can search for content in all formats, obtain and display search results.
[0065] refer to Figure 3In the GUI shown in (c), for the attribute "path", click the control 2312 of "path", and the electronic device displays the attribute list 2312a, which includes multiple options in "path". For example, the multiple options may include options of different paths such as "this computer", "desktop", "system (C:)", and "data (D:)". Exemplarily, the color of the control 2312 will also become darker, so that the user can focus on the currently selected content. In implementation, select any option in "path", and the electronic device searches for content that satisfies any option in "path", obtains and displays the corresponding search results. For example, the user selects the option "this computer" in "path". In response to this operation, the electronic device can search the content of all storage paths (or storage spaces) in the electronic device, and obtain and display the search results.
[0066] refer to Figure 3 In the GUI shown in (d) of FIG, for the attribute "Modification Date", the control 2313 of "Modification Date" is clicked, and the electronic device displays the attribute list 2313a, which includes multiple options in "Modification Date", for example, the multiple options may include options such as "Unspecified", "Today", "Yesterday", "This Week", etc., wherein the option "Unspecified" indicates that there is no restriction on the modification date of the content. It can be understood that the multiple options in "Modification Date" correspond to multiple date ranges, and one option corresponds to one date range. Exemplarily, the color of the control 2313 will also become darker, so that the user can focus on the currently selected content. In implementation, select any one of the options in "Modification Date", and the electronic device searches for content that meets any one of the options in "Modification Date", obtains and displays the corresponding search results. For example, the user selects the option "Unspecified" in "Modification Date", and in response to this operation, the electronic device can search for content of all modification dates, obtain and display search results.
[0067] Continue to refer Figure 3In the GUI shown in (d), for the attribute "size", the control 2314 of "size" is clicked, and the electronic device displays the attribute list 2314a, which includes multiple options in "size", for example, the multiple options may include "unspecified", "small (0-3MB)", "medium (1-128MB)", "large (above 128MB)" and other options, wherein the option "unspecified" indicates that there is no limit on the size of the content. It can be understood that the multiple options in "size" correspond to multiple size ranges, one option corresponds to one size range, and one size range represents the size range of the number of bytes. Exemplarily, the color of the control 2314 will also become darker, so that the user can focus on the currently selected content. In implementation, select any one of the options in "size", the electronic device searches for content that meets any one of the options in "size", obtains and displays the corresponding search results. For example, the user selects the option "unspecified" in "size", and in response to this operation, the electronic device can search for content with all modification dates, obtain and display search results.
[0068] For web page search results, the web page associated words matching the keywords and the web page content related to the web page associated words (such as "text") can be displayed. Figure 2 For web page search results, the search result interface 23 may include an interface 233 and an interface 234, wherein the interface 233 includes a web page search result 23a corresponding to the keyword, the web page search result 23a includes at least one web page associated word matching the keyword, and the interface 234 may be understood as a preview interface, which may display web page content related to any web page associated word selected by the user. Figure 2 In the example, the user selects the web page association word “text” in the web page search result 23a, and the web page content related to “text” is displayed in the interface 234.
[0069] The above Figure 3 The selection operation for any option in the attribute bar 231, such as type, path, modification date and size, shown in (b) to (d) can be understood as a filtering operation. When a filtering operation is detected, the electronic device searches for content that matches the keyword and satisfies the options corresponding to the filtering operation to obtain corresponding search results.
[0070] In the embodiment of the present application, illustratively, the electronic device detects any of the operations of inputting keywords in the search box, selecting any tab page, selecting any sorting option, and selecting any option in any attribute, and can trigger the search process. For ease of description, any of the operations that can trigger the electronic device to perform the search process is collectively referred to as a search instruction.
[0071] For web page search, in some embodiments, web page search is performed only when a condition is met, and when the condition is not met, web page search is not required, but the web page search results obtained from the last search can be reused, wherein the condition can be set in combination with the change of keywords and the change of the network status of the electronic device. For specific descriptions, please refer to the relevant descriptions below. In addition, for the case where a web page search is not performed, when the electronic device detects a search instruction (such as any of the operations in the above examples), a web page search will be triggered, and the web page search will not be performed when it is determined through conditions that a web page search is not required. Here, the process of an electronic device performing a web page search means the process in which the electronic device sends a search request to the network to obtain new web page search results, and the behavior of an electronic device triggering a web page search may refer to the behavior of the electronic device triggering the electronic device to perform a conditional judgment after detecting the search instruction, but the web page search is not performed after the conditional judgment.
[0072] In some embodiments, for searching keywords under any of the above-mentioned tabs, as an example and not a limitation, the electronic device can trigger and perform a web page search based on actual conditions to obtain web page search results.
[0073] Of course, in other embodiments, the electronic device may be triggered by searching for keywords only under, for example, an "all" tab or a "web page" tab, and perform a web page search based on actual conditions to obtain web page search results.
[0074] In some embodiments, after obtaining web search results in the above-mentioned "All" tab or "Webpage" tab, the web search results are displayed on the electronic device. For other tabs, it is not necessary to display the web search results, and only the local search results need to be displayed. Of course, this is only a schematic description, and for web searches in other tabs, web search results can also be displayed without special restrictions.
[0075] Figures 4 to 7 It is a GUI for various ways of opening the search application provided in the embodiment of the present application. For the convenience of description, Honor's smart search is used as an example for explanation.
[0076] Figure 4 It is a GUI for opening a search application by means of a shortcut key provided in an embodiment of the present application.
[0077] The user sends an input signal to the electronic device through a keyboard shortcut (for example, Win+Shift+Q), and the electronic device detects the input signal and displays Figure 4 The GUI of (a) in FIG. 4 includes a search box 40, in which a reminder sentence such as "Smart search, one-click quick access" and a shortcut key combination of "Win+Shift+Q" are displayed. Click the search box 40 to display Figure 4In the GUI shown in (b) of FIG. 1 , the prompting statement of the search box 40 in the GUI becomes "Try to enter a keyword to search". When the user enters a keyword in the search box 40, the following information will be displayed: Figure 1 GUI shown in (b) in .
[0078] Figure 5 It is a GUI for opening a search application through the YOYO assistant provided in an embodiment of the present application.
[0079] refer to Figure 5 The GUI shown in FIG. 1 shows a YOYO assistant 51 in the lower right corner of the GUI. When YOYO assistant 51 is clicked, an interface 52 pops up on the electronic device. The interface 52 includes entrances to applications such as smart search, text, and AI subtitles. Clicking the smart search icon 521 displays the following information: Figure 4 The GUI shown in (a) includes a search box 40.
[0080] Figure 6 It is a GUI for opening a search application through a control provided in an embodiment of the present application.
[0081] refer to Figure 6 The GUI shown in FIG. 1 shows a control 61 below the GUI. The control 61 may be, for example, a control of a computer manager. When the control 61 is clicked, a control center interface 62 pops up on the electronic device. The control center interface 62 includes multiple functions or applications, such as Bluetooth, smart search, text, WLAN, etc. When the smart search icon 621 is clicked, the electronic device may display the following: Figure 4 The GUI shown in (a) includes a search box 40.
[0082] Figure 7 It is a GUI for opening a search application through a computer manager application provided in an embodiment of the present application.
[0083] Open Honor PC Manager and it will show Figure 7 The GUI shown in (a) of FIG. 1 includes icons (or entrances) of multiple functions or applications including smart search. Click the smart search icon 71, and the electronic device displays the following Figure 7 The GUI shown in (b) includes a search box 72, and a keyword search can be performed by entering a keyword in the search box 72.
[0084] It is understandable that for web searches, each search to obtain web search results will take time (approximately between 2s and 3s), resulting in a more obvious delay in the display of results, especially when the search process is performed frequently, which will lead to more obvious time consumption and more obvious display delay. In order to reduce the time consumed by web searches, when the keywords of the two previous search processes remain unchanged, the electronic device does not need to perform the web search process, but reuses the web search results obtained from the web page in the previous search process, thereby improving the efficiency of web searches. In this way, the web search process will only be executed when the keywords change. For example, Figure 1 (c) and Figure 2 For example, Figure 1 (c) in the figure can be regarded as the last search process. After entering the keyword "text" under the "All" tab, a web search is performed to obtain web search result 23a. During the next search, the keyword is not changed but the tab is switched, that is, switching from the "All" tab to the "Web" tab, which means searching for web content under the keyword "text". As mentioned above, the operation of switching tabs will trigger a web search on the electronic device. However, since the keyword has not changed, the electronic device will not execute the web search process and reuse the web search result obtained from the last search. Therefore, the search result interface can quickly display the web search result 23a for the keyword "text".
[0085] However, in the prior art, when the network status of the electronic device changes and the keyword remains unchanged, the web search results for the same keyword will not be refreshed, resulting in a poor user experience. For example, when the electronic device changes from an offline state to an online state and the keyword remains unchanged, since the web search results in the offline state do not contain relevant content, when the electronic device changes from an offline state to an online state, the web search results still do not contain relevant content, resulting in a poor user experience.
[0086] Based on this, the embodiment of the present application provides a keyword search method, search device and related equipment. After the electronic device detects a search instruction for a keyword, if it is determined that the electronic device is in a network state, it will determine whether the keywords of the two previous searches have changed and whether the electronic device has previously triggered a web search in an offline state. If it is determined that the keywords of the two previous searches have not changed and the electronic device has previously triggered a web search in an offline state, the electronic device will perform a web search, that is, obtain the web search results corresponding to the keyword from the web page. If it is determined that the keywords of the two previous searches have changed, the electronic device will also perform a web search; if it is determined that the keywords of the two previous searches have not changed and the electronic device has not previously triggered a web search in an offline state, the web search results of the keywords obtained in the previous search will be reused.
[0087] In the above method, the electronic device determines whether to perform a web search not only based on the change of keywords, but also based on the change of network status. The change of keywords and the change of network status are combined to jointly determine whether to perform a web search. When it is determined that a web search can be performed, the web search results are obtained. In this way, the web search results can be displayed to the user, improving the user experience. When it is determined that a web search is not necessary, the web search results of the last search are reused, reducing the time of searching the network.
[0088] Furthermore, considering that in scenarios where the network status of electronic devices changes frequently, the web page may not be refreshed, resulting in the interface displaying web search results for other keywords, thereby causing inaccurate search results (the specific scenario can be referred to the description below), the embodiments of the present application can also promptly obtain the web search results corresponding to the current keyword from the web page to improve the accuracy of obtaining the web search results, thereby further improving the user experience.
[0089] It should be noted again that in the embodiments of the present application, the electronic device triggers a web search, which means that the electronic device triggers the electronic device to perform conditional judgment after detecting a search instruction, but the web search is not performed after the conditional judgment. The electronic device performs a web search, which means that the electronic device obtains web search results from a web page, specifically, the electronic device sends a search request to the network to obtain web search results.
[0090] The following is a detailed description of the keyword search method of the embodiment of the present application. It should be understood that the execution subject for executing the method of the embodiment of the present application can be an electronic device, or a chip or processor in the electronic device. For the sake of ease of description, the electronic device is continued to be described as an example.
[0091] Figure 8 It is a schematic flowchart of a keyword search method 800 provided in an embodiment of the present application.
[0092] In step S810, the electronic device detects a first search instruction for a first keyword.
[0093] Here, the first search instruction is used to instruct to search for the first keyword, and can be an instruction in any form, without any limitation here.
[0094] In one example, reference Figure 1 In (b), the first search instruction may be an input operation of inputting a first keyword (eg, text) in the search box. In the code implementation, for example, it may be implemented by a function "TextPropertyChanged", and it may be possible to detect whether the keyword has changed.
[0095] In another example, reference Figure 2 The first search instruction may also be a selection operation on any tab (eg, picture, document, web page, etc.) when the first keyword (eg, text) has been entered in the search box. Figure 2 In the example, the user selects the "Webpage" tab, and the electronic device detects the user's selection operation of selecting the "Webpage" tab. In the code implementation, for example, the function "GroupButton_Click" can be used to detect the selection operation of any tab.
[0096] In another example, reference Figure 3 In (a), the first search instruction may also be a selection operation on any sorting option (eg, matching degree, name, modification date, type and size, etc.) when the first keyword (eg, text) has been entered in the search box. Figure 3 In (a), the user selects the sorting option of "matching degree", and the electronic device detects the selection operation of the user selecting "matching degree". In the code implementation, for example, the selection operation of any sorting option can be detected through the function "SortMenuItem_Click".
[0097] In another example, reference Figure 3 In (b) to (d) of the above, the first search instruction may also be a selection operation of any option (e.g., different options such as PDF document, PPT document, WORD document, etc. in the type under the document tab) in any property (e.g., type, path, modification date, size, etc.) in the property column when a keyword has been entered in the search box. In the code implementation, for example, the selection operation of any option in any property may be detected by the function "TypeMenuItem_Click".
[0098] In another example, the first search instruction may also be the network information when the network state changes when the keyword has been entered in the search box (for example, the IP address or network state value detected when the network state changes). For example, the electronic device changes from an offline state to an online state, and detects the network information when the network state changes. The electronic device executes step S820. The network information when the network state changes is the first search instruction. Exemplarily, the first search instruction may carry the network URL or the network state value. In the code implementation, for example, the function NetworkChange.NetworkAddressChanged+=new NetworkAddressChangedEventHandler(AddressChangedCallback) may be used to monitor changes in the network state, where AddressChangedCallback is a callback function that is called when the network state changes, and the callback function carries the URL or network state value of the changed network.
[0099] In step S820, in response to detecting the first search instruction, the electronic device determines whether the electronic device is currently in a network state.
[0100] When it is determined that the electronic device is currently in a network-connected state, the electronic device executes step S831; when it is determined that the electronic device is currently in a network-free state, illustratively, the electronic device may execute step S832.
[0101] In step S831, when it is determined that the electronic device is currently in a network state, it is determined whether the first keyword is the same as the historical keyword and whether the electronic device has triggered a web page search in an off-network state during the last search process.
[0102] The historical keywords are keywords used in the last search process, that is, the electronic device searches for the historical keywords in the last search process. In addition, the last search process is the most recent search process before the electronic device detects the first search instruction.
[0103] It should be noted that the search process described in this application can be regarded as a search process as long as the search behavior is triggered, regardless of whether the search process is successfully executed. In addition, the explanation of the electronic device triggering the web search can refer to the relevant description above, which will not be repeated.
[0104] In this step, the electronic device determines whether to perform a web page search not only based on changes in keywords, but also based on changes in network status.
[0105] Regarding the change of keywords, as described above, when the keywords remain unchanged, the electronic device can reuse the web page search results obtained from the last search, thereby reducing the time consumption of searching the web.
[0106] Regarding the change of network status, as described above, in a scenario where, for example, an electronic device changes from an offline state to an online state and the keywords remain unchanged, since there is no relevant content in the web search results in the offline state, when it changes from an offline state to an online state, the web search results still have no relevant content, and the user experience is poor. Therefore, since the present application takes the network status into consideration, when the network status of the electronic device changes from offline to online, the electronic device will obtain the web search results. It should be noted that the web search results obtained here may be obtained by re-executing the web search, or may be the reused web search results obtained from the last search. When the keywords remain unchanged but the electronic device changes from offline to online, if it is stipulated that the web search of the electronic device is triggered when the electronic device changes from offline to online, but as long as the keywords remain unchanged, the electronic device still reuses the web search results obtained from the last search, then, in the scenario where the network status changes frequently, the web page may not be refreshed, resulting in the interface displaying web search results for other keywords, and the problem of inaccurate search results will occur. For example, when searching for the first time, the keyword is keyword 1 and the electronic device is in a networked state, and the web search results for keyword 1 are obtained. The electronic device suddenly loses the network and changes the keyword (to keyword 2) for searching. Because there is no network, the electronic device will not obtain the web search results for keyword 2. When the electronic device is in a networked state but does not change the keyword (that is, the keyword is still keyword 2) for searching, because the electronic device changes from no network to network, a web search will be triggered, but because the keyword remains unchanged, the electronic device will reuse the web search results obtained last time according to the code logic, that is, reuse the web search results for keyword 1, resulting in the web search results for keyword 1 not being refreshed. In this scenario, the web search results for keyword 1 do not match keyword 2, resulting in inaccurate search results. Therefore, when considering whether to perform a web search based on network changes, the embodiment of the present application further considers whether the electronic device has triggered a web search in a networkless state. It can be understood that for the above problem scenario, when searching for the first time, the keyword is keyword 1 and the electronic device is in a networked state, and the web search results for keyword 1 are obtained. The electronic device suddenly loses network and changes the keyword (to keyword 2) for searching. Since the keyword has changed, the electronic device will trigger a web search. Since there is no network, the electronic device fails to successfully perform the web search process and will not obtain the web search results for keyword 2. When the electronic device is in a networked state but does not change the keyword (that is, the keyword is still keyword 2) for searching, since the keyword for this search is the same as the keyword for the last search, and the electronic device has triggered a web search in a networkless state in the last search, the electronic device will search for content matching keyword 2 from the web page after conditional judgment, that is, perform a web search for keyword 2 to obtain the web search results for keyword 2. In this way, web search results matching the keyword can be obtained in a timely manner, and the accuracy of obtaining web search results can be improved, thereby further improving the user experience.
[0107] In this step, when it is determined that the first keyword is the same as the historical keyword and the electronic device has triggered a web search in an offline state during the last search process (recorded as case 1), the electronic device executes step S841; when it is determined that the first keyword is different from the historical keyword (recorded as case 21), similarly, the electronic device will also execute step S841.
[0108] When it is determined that the first keyword is the same as the historical keyword and the electronic device has not triggered a web page search in an offline state during the last search process (recorded as situation 22), the electronic device executes step S842.
[0109] In an embodiment of the present application, the electronic device may first determine whether the first keyword is the same as the historical keyword (i.e., determine whether the keyword has changed), and then determine whether the electronic device has triggered a web search without a network connection. Alternatively, the electronic device may first determine whether the electronic device has triggered a web search without a network connection, and then determine whether the first keyword is the same as the historical keyword (i.e., determine whether the keyword has changed). There is no limitation on the order of the two.
[0110] For example, the electronic device first determines whether the first keyword is the same as the historical keyword (ie, determines whether the keyword has changed), and then determines whether the electronic device has triggered a web page search in an offline state.
[0111] In some embodiments, when it is determined that the electronic device is currently in a networked state, it is determined whether the first keyword is the same as the historical keyword; when it is determined that the first keyword is the same as the historical keyword, it is determined whether the electronic device has triggered a web search in an offline state during the last search. This process of first determining whether the keyword has changed and then determining whether the electronic device has triggered a web search in an offline state can omit the process of determining whether the electronic device has triggered a web search in an offline state in the case where a web search is performed when the keyword changes, which can save processing time and improve user experience.
[0112] In step S841, in the above-mentioned case 1 or case 21, the electronic device searches for content matching the first keyword from the web page, and obtains web page search results corresponding to the first keyword.
[0113] The webpage search results corresponding to the first keyword include at least one webpage associated word matching the first keyword. For example, if the first keyword is "text", the webpage associated words matching "text" may be words such as text, text document, and document-to-speech.
[0114] In situation 1, the electronic device performs a web search, that is, searches for content matching the first keyword on the web page to obtain web search results corresponding to the first keyword. This can effectively solve the problem that in the scenario where the network status changes frequently, the web page may not be refreshed, resulting in the interface displaying web search results for other keywords, which in turn leads to inaccurate search results.
[0115] In situation 21, the electronic device performs a web search, that is, searches for content matching the first keyword from the web page to obtain web search results corresponding to the first keyword, and can effectively and timely obtain the web search results corresponding to the first keyword.
[0116] In step S842, when it is determined that the first keyword is the same as the historical keyword and the electronic device has not triggered a web search in an offline state during the last search process (ie, situation 22), the electronic device uses the web search result corresponding to the historical keyword as the web search result corresponding to the first keyword.
[0117] That is, for situation 22, the electronic device does not need to perform a web page search, and can reuse the web page search results obtained in the previous search process.
[0118] It can be understood that in situation 22, the electronic device did not trigger a web search in an offline state during the last search process, which means that the web search results of the historical keywords in the last search process must have been obtained in an online state. Then, for this search, when the first keyword is the same as the historical keyword, the web search results of the first keyword are also the web search results of the historical keyword. Therefore, in order to save the time brought by the search, it is sufficient to directly reuse the web search results of the last search process.
[0119] In some embodiments, in step S850, the electronic device displays web page search results corresponding to the first keyword.
[0120] Here, the web search results obtained based on step S841 or step S842 are the same, and are all web search results corresponding to the first keyword. Exemplarily, for web searches under the tabs (referred to as the first tabs) that can display web search results, such as the "All" tab or the "Web Page" tab, the electronic device obtains the web search results corresponding to the first keyword and displays the web search results. In implementation, in step S810, the electronic device detects the first search result for the first keyword under the first tab, and after obtaining the web search results corresponding to the first keyword, in step S850, the electronic device displays the web search results.
[0121] In some embodiments, in step S832, when it is determined that the electronic device is in an offline state, the electronic device displays an offline interface to indicate that the electronic device is in an offline state.
[0122] Exemplarily, in the web search under the above-mentioned "All" tab or "Web Page" tab, the electronic device displays a no-network interface when it is determined that there is no network.
[0123] For example, the no network interface can be prompted by text (for example, the network is not connected, please check the network settings).
[0124] When the electronic device is in an offline state, the electronic device displays an offline interface, which can promptly remind the user of the current network status, making it easier for the user to take measures to connect to the network, thereby improving the user experience.
[0125] In the above embodiment, the entire logical judgment process for determining whether the electronic device is in a networked state, whether the first keyword is the same as the historical keyword, and whether the electronic device has triggered a web page search in an offline state during the last search process can be implemented in the code, for example, by function SendMsgToJa, executing step S841 in case 1 and case 21, and executing step S842 in case 22.
[0126] In an embodiment of the present application, in order to facilitate the improvement of processing speed, the change state of a keyword can be identified (or recorded) by a change identifier of the keyword. Wherein, the change identifier of the keyword is used to identify the first change state or the second change state, the first change state is used to identify that the keywords used in the two previous search processes are different, and the second change state is used to identify that the keywords used in the two previous search processes are the same. For example, the first change state is represented by ture, and the second change state is represented by false. For another example, for example, the first change state is represented by 0, and the second change state is represented by 1. In implementation, for the currently input keyword and the keyword of the last search process, the electronic device compares and sets the change identifier of the keyword to the first change state (for example, ture) or the second change state (for example, false), which is convenient for subsequent processes to use. For example, when it is determined that the electronic device is in a networked state, the change identifier of the keyword that has been set is used to determine whether the keyword has changed.
[0127] Exemplarily, the change mark of a keyword can be called a flag of the keyword, and can be represented by refreashWebMsg in the code. For example, refreashWebMsg==true indicates that the keyword has changed, and refreashWebMsg==flush indicates that the keyword has not changed.
[0128] Similarly, in order to facilitate the improvement of processing speed, the network search identifier can be used to identify (or record) whether the electronic device has triggered a web search in a no-network state. Among them, the network search identifier is used to identify the first search state or the second search state, the first search state is used to identify that the electronic device has triggered a web search in a no-network state, and the second search state is used to identify the search state other than the first search state. Here, the second search state can be a state in which the electronic device has not triggered a web search in a no-network state, or a state in which the electronic device has not triggered or has triggered a web search in a network state. For example, the first search state is represented by true, and the second search state is represented by false. For another example, for example, the first search state is represented by 0, and the second search state is represented by 1. In implementation, for the behavior of the electronic device triggering a web search in a no-network state, the electronic device sets the network search identifier to the first search state, and for other search behaviors, the electronic device sets the network search identifier to the second search state, so that the electronic device can determine whether the electronic device triggers a web search in a no-network state by the search state represented by the network search identifier during the next search.
[0129] Exemplarily, the network search identifier can be called a network flag, which can be represented by mNoWebSearchFlag in the code. For example, mNoWebSearchFlag==true indicates that the electronic device has triggered a web search without a network, and mNoWebSearchFlag==flush indicates that the electronic device has not triggered a web search without a network.
[0130] Fig. 9 900 is a schematic flow chart of a keyword search method 900 provided in an embodiment of the present application. Compared with method 800, it is first determined whether the keyword has changed and then whether the electronic device has triggered a webpage search in a network-free state, and the keyword change is determined by the keyword change identifier and whether the webpage search has been triggered in a network-free state is determined by the network search identifier. In the following, only the different steps are described in detail, and the same steps are described in a simplified manner.
[0131] In step S910, the electronic device detects a first search instruction for a first keyword.
[0132] It should be noted that when the first search instruction is detected, if the first search instruction is an input operation of inputting a keyword in the search box, it means that the keyword has definitely changed, and the electronic device sets the keyword change flag to the first change state. If the first search instruction is, for example, the above-mentioned selection operation of any tab page, the selection operation of any sorting option, the selection operation of any option in any attribute in the attribute column, or the change of the network status, it means that the keyword has definitely not changed, and the electronic device can set the keyword change flag to the second change state.
[0133] In step S920, in response to detecting the first search instruction, the electronic device determines whether the electronic device is currently in a network state.
[0134] When it is determined that the electronic device is currently connected to the network, the electronic device executes step S930; when it is determined that the electronic device is currently connected to the network, the electronic device may execute steps S961 and S962.
[0135] In step S930, the electronic device determines whether the change flag of the keyword indicates a first change state (eg, mNoWebSearchFlag==true?).
[0136] That is, the electronic device determines whether the keyword has changed according to the keyword change identifier, that is, determines whether the first keyword is the same as the historical keyword.
[0137] When the keyword change identifier is marked as the first change state, it is determined that the first key is different from the historical keyword, corresponding to case 21 in method 800, and the electronic device executes step S944; when the keyword change identifier is marked as the second change state, it is determined that the first key is the same as the historical keyword, and the electronic device executes step S941.
[0138] In step S941, when the change flag of the keyword indicates the second change state, the electronic device determines whether the search flag of the network indicates the first search state (mNoWebSearchFlag==true?).
[0139] That is, the electronic device determines whether the electronic device has triggered a web page search in an offline state according to the search identifier of the network.
[0140] When the keyword change identifier is identified as the second change state, the network search identifier is determined to be the first search state, that is, when the first keyword is the same as the historical keyword, it is determined that the electronic device has triggered a web page search in an offline state, corresponding to case 1 in method 800, and the electronic device executes steps S942 and S944; when the keyword change identifier is identified as the second change state, the network search identifier is determined to be the second search state, that is, when the first keyword is the same as the historical keyword, it is determined that the electronic device has not triggered a web page search in an offline state, corresponding to case 22 in method 800, and the electronic device executes step S943.
[0141] In step S942, the electronic device sets the search state of the current network to the second search state.
[0142] It can be understood that after determining through step S941 that the electronic device has triggered a web search in an offline state, the electronic device has been able to determine that a web search is needed to obtain web search results. Therefore, for the current search behavior in a networked state, the electronic device sets the current network search state to the second search state, or in other words, the electronic device updates the network search identifier from the first search state to the second search state. In this way, in the next search process, it can be determined based on the network search identifier that the electronic device has not triggered a web search in an offline state, so that the web search results obtained from the last search can be reused without changing the keywords, that is, the web search results obtained from the above search can be used as the web search results for the current search.
[0143] In step S944, the electronic device searches the web page for content matching the first keyword, and obtains web page search results corresponding to the first keyword.
[0144] When it is determined in step S930 that the keyword change identifier is the first change state, and when it is determined in step S930 that the keyword change identifier is the second change state and when it is determined in step S941 that the network search identifier is the first search state, the electronic device performs a web page search.
[0145] It should be noted that, when it is determined in step S930 that the change identifier of the keyword is the second change state and in step S941 that the search identifier of the network is the first search state, the electronic device will execute step S942 and step S944, and the order of step S942 and step S944 is not limited. For example, step 942 is executed first and then step S944, or step 944 is executed first and then step S942, or step S942 and step S944 can be executed at the same time.
[0146] In step S943, when it is determined that the search identification mark of the network is in the second search state, the electronic device determines the web page search result corresponding to the historical keyword as the web page search result corresponding to the first keyword.
[0147] In some embodiments, in step S950, the electronic device displays web page search results corresponding to the first keyword.
[0148] In step S961, when it is determined that the electronic device is currently in an offline state, the electronic device sets the current network search state to the first search state.
[0149] It can be understood that in this search process, step S910 triggers a webpage search, but since there is no network, it means that the electronic device has triggered a webpage search in the no-network state, so the electronic device sets the current network search state to the first search state. In this way, in the next search process, it can be determined based on the network search identifier that the electronic device has triggered a webpage search in the no-network state, so that the webpage search process can be performed without changing the keywords.
[0150] In some embodiments, in step S962, when it is determined that the electronic device is in an offline state, the electronic device displays an offline interface to indicate that the electronic device is in an offline state.
[0151] It is understood that the present application does not impose any limitation on the order of step S961 and step 962. For example, step S961 may be performed first and then step 962, or step S962 may be performed first and then step 961, or step S961 and step 962 may be performed simultaneously.
[0152] Fig.10 This is a set of GUIs for searching in a scenario where the network status changes frequently provided by the embodiment of the present application. For ease of description, the search process performed in the "Webpage" tab is taken as an example for explanation.
[0153] refer to Fig.10 In the GUI shown in (a), the user enters the keyword "text" (an example of the second keyword) in the search box 101 under the "web page" tab 102. In response to detecting the user's input of the keyword "text" (an example of the second search instruction), since the electronic device is in a network state, the electronic device obtains the web page search result 103a corresponding to "text" and displays the web page search result 103a corresponding to "text" on the interface 103. Here, based on actual conditions, the electronic device can obtain the web page search result from the web page, or reuse the previous web page search result without changing the keyword.
[0154] refer to Fig.10In the GUI shown in (b) of FIG. 1 , after the network is disconnected, the network status changes from connected to offline. When the network status changes, the electronic device detects the change in the network status and triggers a web search. However, since the electronic device is offline, the web search results corresponding to the "text" are not obtained, and the display is as follows: Fig.10 The interface 104 shown in (b) indicates that the electronic device is currently in an offline state.
[0155] To change keywords without Internet access, refer to Fig.10 In (c), the keyword "text document" (an example of the first keyword) is entered in the search box 101. As the keyword changes, the electronic device detects the keyword change (an example of the third search instruction) and triggers a web search. However, as the electronic device is offline, it will not obtain the web search results corresponding to "text document" and will still display interface 104 to indicate that the electronic device is currently offline.
[0156] refer to Fig.10 In the GUI shown in (d), when the network is connected, the electronic device is in a networked state, the network state changes from offline to connected, and the network state changes. After the electronic device detects the change in network state (an example of the first search instruction), a web search is triggered. Since the keywords of this search and the last search remain the same (both are "text document"), and the electronic device triggered a web search in an offline state during the last search, the electronic device will perform a web search, obtain and display the web search result 103b corresponding to "text document" from the web page.
[0157] It can be seen that in the above-mentioned scenario of frequent network changes, the embodiment of the present application determines the changes in keywords and whether the electronic device has triggered a web search in an offline state. When it is determined that the keywords have not changed and the electronic device has triggered a web search in an offline state, the web search process is executed, and web search results matching the keywords are obtained in a timely manner, thereby improving the accuracy of obtaining web search results and improving user experience.
[0158] In the following, the interaction between the modules in the electronic device to realize the keyword search is briefly described in conjunction with the modules in the electronic device.
[0159] Fig.11 It is a software structure diagram of the electronic device provided in the embodiment of the present application. It can be understood that Fig.11 The software architecture shown is more suitable for computer devices such as laptops, personal computers, etc. Fig.11 , the software architecture from top to bottom may include: application layer and operating system layer (OS layer).
[0160] The application layer may include various applications, for example, including search applications, office software, music, video, Bluetooth, WLAN and other applications. Fig.11 As shown, the search application can be a smart search.
[0161] Taking the search application as an example, smart search includes three modules: smart search UI, smart search service and smart search engine. Among them, the smart search UI includes an interface detection module, a result display module, a callback function and an inter-process communication (IPC) manager module.
[0162] The interface detection module is used to detect the user's operation on each option of the search content. Among them, the search box module in the interface detection module is used to detect the input keywords and whether the keywords have changed. Exemplarily, in the code implementation, the input of keywords and whether the keywords have changed are detected by, for example, the function "TextPropertyChanged". The first detection module in the interface detection module is used to detect the selection operation of other contents when the keywords have been entered in the search box, for example, to detect the selection operation of any tab page (for example, different tab pages such as pictures, documents, web pages, etc.), the selection operation of any sorting option (for example, matching degree, name, modification date, type and size, etc.), and the selection operation of any option in any attribute in the property bar (for example, type, path, modification date, size, etc.). The selection operation of each content can be implemented by the corresponding function. For the specific description, please refer to the relevant description in step 810, which will not be repeated.
[0163] The result display module is used to display search results, including local search results and / or web page search results.
[0164] The callback function is used to determine the relevant content of the network. When the network status changes, the callback function is called through the network monitoring module. The callback function carries the URL of the changed network or the network status value.
[0165] The IPC management module is used to execute the conditional judgment of the present application, such as the process of determining whether the electronic device currently has network access, determining whether the keywords have changed, and determining whether the electronic device has triggered a web search in an offline state as shown in method 800 and method 900. When it is determined that a web search needs to be performed (the above situation 1 or situation 21), the web search results are obtained from the web page through the network interface of the OS layer. When it is determined that a web search does not need to be performed (the above situation 22), the web search results obtained from the last search are reused.
[0166] The smart search service and the smart search engine are used for local search. The smart search service is used to construct and send search queries to the smart search engine, and parse the local search results fed back from the smart search engine, and send the parsed local search results to the IPC management module. The smart search engine is used to query local content according to the received search query, and feed back the local search results to the smart search service.
[0167] The OS layer is the intermediate bridge between hardware and software, and it consists of machine instructions and generalized instructions. Among them, machine instructions refer to instructions that the CPU can directly recognize and execute, and generalized instructions refer to software instructions defined and interpreted by the system. Exemplarily, the OS layer includes the network monitoring module and network interface shown in the figure, and may also include a process management module, a file management module, a device management module, and a driver management module, etc., which are not shown in the figure.
[0168] The network monitoring module is used to monitor the network status. When the network changes, the network monitoring module calls the callback function to obtain network information, thereby detecting the search instruction.
[0169] The network interface is used to obtain network search results from a web page. For example, a search request is sent to a web page through the network interface to obtain web page search results.
[0170] It should be understood that the software architecture diagram of the electronic device described above is only an exemplary description and should not be construed as limiting the embodiments of the present application. For example, the electronic device may be a mobile phone, and correspondingly, the software architecture diagram is a software module of the mobile phone.
[0171] Below, with Fig.11 Take the software architecture diagram shown in the figure as an example, combined with Fig.12 and Fig.13 The process of describing the keyword search method from the perspective of the interaction between various modules in the electronic device. Fig.12 and Fig.13 The main difference is that Fig.12 The schematic diagram shows that the search instruction is detected by the interface detection module. Fig.13 It is indicated that the search instruction is detected through the network monitoring module and the callback function.
[0172] Fig.12 It is a schematic flowchart of a keyword search method from the perspective of interaction between various modules in an electronic device provided in an embodiment of the present application.
[0173] The user inputs a search instruction, and in step S121a, the interface detection module detects the search instruction.
[0174] The search instruction may be an operation of entering a keyword in a search box detected by the search box module, or the search instruction may be an operation of selecting other content detected by the first detection module when a keyword has been entered in the search box, for example, an operation of selecting any tab page, an operation of selecting any sorting option, and an operation of selecting any option in any attribute in the attribute bar, etc.
[0175] In step S122, the interface detection module sends instruction 1 to the IPC management module, instructing to use the first keyword to perform web page search.
[0176] In step S1231, in response to instruction 1, the IPC management module performs conditional judgment.
[0177] Specifically, the IPC management module makes conditional judgments on whether the electronic device currently has access to the Internet, determines whether the keywords have changed, and determines whether the electronic device has triggered a web search in an offline state: when it is determined that the electronic device currently has access to the Internet, the keywords have not changed, and the electronic device has triggered a web search in an offline state (i.e., situation 1 above), or when it is determined that the electronic device currently has access to the Internet and the keywords have changed (i.e., situation 21 above), it is determined to perform a web search and a search request 1 is generated to request the web search results corresponding to the first keyword; and when it is determined that the electronic device currently has access to the Internet, the keywords have not changed, and the electronic device has not triggered a web search in an offline state (i.e., situation 22 above), the web search results obtained from the last search are reused.
[0178] In the following, Case 1, Case 21 and Case 22 are described respectively.
[0179] Case 1 or Case 21
[0180] In step S1232, the IPC management module sends a search request 1 to the network interface of the OS layer to request the web page search result corresponding to the first keyword.
[0181] In step S1234, the network interface feeds back the web page search result corresponding to the first keyword to the IPC management module.
[0182] Specifically, after receiving the search request 1, the network interface obtains the webpage search result corresponding to the first keyword from the webpage in response to the search request 1, and feeds back the webpage search result corresponding to the first keyword to the IPC management module.
[0183] In step S1235, the IPC management module sends the web page search result corresponding to the first keyword to the result display module.
[0184] In step S1236, the result display module displays the web page search results corresponding to the first keyword.
[0185] Situation 22
[0186] In step 1241, the IPC management module performs conditional judgment and reuses the web page search results obtained from the previous search.
[0187] In step S1242, the IPC management module sends the web page search results obtained from the last search to the result display module.
[0188] In step S1243, the result display module displays the web page search results obtained from the last search.
[0189] It should be understood that in situation 22, since the keyword has not changed, the web page search result obtained in the last search is the web page search result corresponding to the first keyword.
[0190] The following describes the process of local search
[0191] In step S1251, in response to instruction 1, the IPC management module sends a search request 2 to the smart search service to request local search results corresponding to the first keyword.
[0192] In step S1252 , the smart search service generates a search query based on the search request 2 .
[0193] It should be understood that the functions of the search request 2 and the search query are the same, but the formats of the two are different, and the format of the search query corresponds to the database. In other words, the database has its own query format (or query language), and the database can only be queried through a specific query format.
[0194] In step S1253, the smart search service sends a search query to the smart search engine.
[0195] In step S1254, the smart search engine queries the local database according to the search query, obtains local search result 1, and sends the obtained local search result 1 to the smart search service.
[0196] In step S1255, the smart search service parses local search result 1 to obtain local search result 2.
[0197] In step S1255, the smart search service sends local search results 2 to the IPC management module.
[0198] In step S1256, the IPC management module sends the local search result 2 to the result display module.
[0199] In step S1257 , the result display module displays local search result 2 .
[0200] Fig.13 This is another schematic flowchart of a keyword search method from the perspective of interaction between various modules in an electronic device provided in an embodiment of the present application.
[0201] Fig.13 Zhongyu Fig.12 The main difference is that Fig.13 The diagram shows that the search instruction is detected by the network monitoring module and the callback function. Specifically, the network monitoring module monitors network changes. When the network changes, the network monitoring module calls the callback function to obtain network information, thereby detecting the search instruction.
[0202] In one example, the network monitoring module can monitor changes in the IP address. In step S121b, when the IP address changes, the network monitoring module calls the callback function, which carries the IP address, thereby detecting the search instruction. In step S122, the callback function sends instruction 1 to the IPC management module, instructing to use the last input keyword to search the web page. After receiving instruction 1, the IPC management module executes step S1231. In step S1231, the IPC management module can further obtain the network status from the network status interface to determine whether the electronic device currently has a network.
[0203] In another example, the network monitoring module can monitor changes in the network status. In step S121b, when the network status changes, the network monitoring module calls the callback function, and the callback function carries the network status value, thereby detecting the search instruction. In step S122, the callback function sends instruction 1 (for example, it can carry the network status value) to the IPC management module, instructing to use the last input keyword to search the web page. After receiving instruction 1, the IPC management module executes step S1231, wherein the IPC management module can determine whether the electronic device currently has a network based on instruction 1, and then determine whether to perform a web page search.
[0204] It should be noted that, based on actual conditions, for the keywords that currently need to be searched, the electronic device can perform a local search to obtain local search results and obtain web search results, for example, a search under the "All" tab; or, the electronic device only performs a local search; or, the electronic device only obtains web search results, for example, a search under the "Web" tab.
[0205] For the case where the electronic device needs to perform a local search to obtain local search results and obtain web search results, illustratively, according to the actual situation, both search results can be displayed, or only one of the search results can be displayed. For example, in the search under the "Pictures" tab and the "Pictures" tab, the electronic device can perform a local search to obtain local search results and obtain web search results, but only display the local search results.
[0206] In addition, illustratively, if both local search results and web search results need to be displayed, after obtaining the web search results and the local search results, the IPC management module can send the web search results and the local search results in one message to the result display module.
[0207] The above describes in detail the keyword search method provided in the embodiment of the present application. Figure 14 to Figure 15 , describing a keyword search device and electronic device provided according to an embodiment of the present application.
[0208] Fig.14 1 is an exemplary block diagram of a keyword search device 1400 provided in an embodiment of the present application. The search device 1400 may be an electronic device or a chip in an electronic device. The search device 1400 is used to execute the various processes and steps corresponding to the electronic device in the above method 800 or 800. The search device 1400 includes: a processing unit 1410, and exemplarily, also includes a display unit 1420. The processing unit 1410 is used to perform the following steps:
[0209] A first search instruction for a first keyword is detected; in response to detecting the first search instruction, determining whether the electronic device is currently in a networked state; when it is determined that the electronic device is currently in a networked state, determining whether the first keyword is the same as a historical keyword used in a previous search process and whether the electronic device has triggered a web search in an offline state during the previous search process, the previous search process being the most recent search process of the electronic device before the first search instruction is detected; when it is determined that the first keyword is the same as a historical keyword and the electronic device has triggered a web search in an offline state during the previous search process, searching the web page for content matching the first keyword to obtain web page search results corresponding to the first keyword, the web page search results including at least one web page association word matching the first keyword.
[0210] Optionally, the processing unit 1410 is specifically used to: when it is determined that the electronic device is currently in a network state, determine whether the first keyword is the same as the historical keyword; when it is determined that the first keyword is the same as the historical keyword, determine whether the electronic device triggered a web page search in an offline state during the last search process.
[0211] Optionally, the processing unit 1410 is specifically used to: when it is determined that the electronic device is currently in a network state, determine whether the first keyword is the same as the historical keyword based on a keyword change identifier, wherein the keyword change identifier is used to identify a first change state or a second change state, the first change state is used to identify that the keywords used in the two previous search processes are different, and the second change state is used to identify that the keywords used in the two previous search processes are the same.
[0212] Optionally, processing unit 1410 is specifically used to: when it is determined that the first keyword is the same as the historical keyword, determine whether the electronic device has triggered a web page search in an offline state during the last search process based on the network search identifier, wherein the network search identifier is used to identify a first search state or a second search state, the first search state is used to identify that the electronic device has triggered a web page search in an offline state, and the second search state is used to identify a search state other than the first search state; and processing unit 1410 is also used to: when it is determined that the electronic device has triggered a web page search in an offline state during the last search process, update the network search identifier from the first search state to the second search state.
[0213] Optionally, the processing unit 1410 is further configured to: when it is determined that the first keyword is different from the historical keyword, search the web page for content matching the first keyword to obtain web page search results corresponding to the first keyword.
[0214] Optionally, the processing unit 1410 is further used to: when it is determined that the first keyword is the same as the historical keyword and the electronic device did not trigger a web search in an offline state during the last search process, use the web search results corresponding to the historical keyword as the web search results corresponding to the first keyword.
[0215] Optionally, the processing unit 1410 is further configured to: when it is determined that the electronic device is in an offline state, display an offline interface to indicate that the electronic device is in an offline state.
[0216] Optionally, processing unit 1410 is also used to: in response to detecting a second search instruction for a second keyword, obtain web page search results corresponding to the second keyword when the electronic device is in a network state, and the second keyword is different from the first keyword; in response to detecting a third search instruction for the first keyword, trigger a web page search for the first keyword when the electronic device is in an offline state.
[0217] Optionally, the processing unit 1410 is specifically used to: detect a first search instruction under a first tab page, and the first tab page can display web page search results; and the processing unit 1410 is also used to: display web page search results corresponding to the first keyword.
[0218] Optionally, the first search instruction includes any one of the following:
[0219] An input operation of inputting a first keyword in the search box;
[0220] Select any tab page after entering the first keyword in the search box;
[0221] Selecting any sorting option after entering the first keyword in the search box;
[0222] A selection operation of any option of any attribute of at least one attribute when a first keyword has been input in the search box, the attribute representing an attribute of the file;
[0223] Network information when the network status changes when the first keyword has been entered in the search box.
[0224] It should be understood that the processing unit 1410 can be used for various steps executed by the electronic device. For specific descriptions, please refer to the relevant descriptions above and will not be repeated here.
[0225] In the embodiments of the present application, Fig.14 The device may also be a chip or a chip system, such as a system on chip (SoC).
[0226] Fig.15 1 is a schematic structural diagram of an electronic device 1500 provided in an embodiment of the present application. The electronic device 1500 is used to execute the corresponding steps and / or processes in the above method embodiment.
[0227] The electronic device 1500 includes a processor 1510, a transceiver 1520, a memory 1530 and a display screen 1540. The processor 1510 communicates with the transceiver 1520, the memory 1530 and the display screen 1540 through internal connection paths.
[0228] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 1500. In other embodiments of the present application, the electronic device 1500 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0229] The processor 1510 can implement the functions of the processor 1510 in various possible implementations of the electronic device 1500. The processor 1510 may include one or more processing units, for example: the processor 1510 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors.
[0230] The controller may be the nerve center and command center of the electronic device 1500. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0231] Processor 1510 is used to perform the following steps: detecting a first search instruction for a first keyword; in response to detecting the first search instruction, determining whether the electronic device is currently in a networked state; when it is determined that the electronic device is currently in a networked state, determining whether the first keyword is the same as the historical keyword used in the last search process and whether the electronic device has triggered a web page search in an offline state during the last search process, and the last search process is the most recent search process of the electronic device before detecting the first search instruction; when it is determined that the first keyword is the same as the historical keyword and the electronic device has triggered a web page search in an offline state during the last search process, searching for content matching the first keyword on the web page to obtain web page search results corresponding to the first keyword, and the web page search results include at least one web page association word matching the first keyword.
[0232] The memory 1530 is used to store instructions, and the processor 1510 is used to execute the instructions stored in the memory 1530 , or in other words, the processor 1510 can call these stored instructions to implement the functions of the processor 1510 in the electronic device 1500 .
[0233] The memory 1530 may be used to store computer executable program codes, which include instructions. The processor 1510 executes various functional applications and data processing of the electronic device 1500 by running the instructions stored in the memory 1530. In other words, when the processor 1510 executes the instructions stored in the memory, the processor 1510 is used to execute the various steps and / or processes of the method embodiment corresponding to the above electronic device.
[0234] The memory 1530 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 1500 (such as audio data, a phone book, etc.), etc. In addition, the memory 1530 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0235] The electronic device 1500 implements the display function through a GPU, a display screen 1540, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 1540 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 1510 may include one or more GPUs that execute program instructions to generate or change display information.
[0236] The display screen 1540 is used to display images, videos, etc. The display screen 1540 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 1500 may include 1 or N display screens 1540, where N is a positive integer greater than 1.
[0237] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware processor for execution, or a combination of hardware and software units in a processor for execution. The software unit can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor executes the instructions in the memory, and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it is not described in detail here.
[0238] The embodiment of the present application provides a computer program product, when the computer program product is run on a terminal device, the terminal device executes the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above method-related embodiments, and will not be repeated here.
[0239] The embodiment of the present application provides a readable storage medium, the readable storage medium contains instructions, when the instructions are executed in a terminal device, the terminal device executes the technical solution of the above embodiment. The implementation principle and technical effect are similar, and will not be repeated here.
[0240] The embodiment of the present application provides a chip, the chip is used to execute instructions, when the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar, and will not be repeated here.
[0241] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0242] It should be understood that the "embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the various embodiments in the entire specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.
[0243] It should also be understood that in the present application, "when", "if" and "if" all mean that the UE or base station will take corresponding actions under certain objective circumstances. It is not a time limit, and it does not require the UE or base station to make judgments when implementing it, nor does it mean that there are other limitations.
[0244] A person skilled in the art may understand that the various numerical numbers such as first and second involved in the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application, and also indicate the order of precedence.
[0245] In this application, elements expressed in the singular are intended to mean "one or more" rather than "one and only one", unless otherwise specified. In this application, "at least one" is intended to mean "one or more", and "more than one" is intended to mean "two or more", unless otherwise specified.
[0246] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. A can be singular or plural, and B can be singular or plural.
[0247] In this document, the term "at least one of..." or "at least one of..." means all or any combination of the listed items. For example, "at least one of A, B, and C" may mean: A exists alone, B exists alone, C exists alone, A and B exist at the same time, B and C exist at the same time, and A, B, and C exist at the same time, where A may be singular or plural, B may be singular or plural, and C may be singular or plural.
[0248] 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.
[0249] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0250] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the 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.
[0251] 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.
[0252] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0253] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0254] The same or similar parts between the various embodiments in this application can refer to each other. In the various embodiments in this application, and the various implementation methods / implementation methods / implementation methods in each embodiment, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment are consistent and can be referenced to each other. The technical features in different embodiments and the various implementation methods / implementation methods / implementation methods in each embodiment can be combined to form new embodiments, implementation methods, implementation methods, or implementation methods according to their inherent logical relationships. The above-described implementation methods of this application do not constitute a limitation on the scope of protection of this application.
[0255] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims. In short, the above is only a preferred embodiment of the technical solution of the present application, and is not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A keyword search method, applied to an electronic device, characterized in that: include: detecting a first search instruction for a first keyword; In response to detecting the first search instruction, determining whether the electronic device is currently in a network state; In the case where it is determined that the electronic device is currently in a network state, determining whether the first keyword is the same as a historical keyword; If it is determined that the first keyword is the same as the historical keyword, determining whether the electronic device has triggered a webpage search in an offline state during a previous search process, wherein the previous search process is the most recent search process of the electronic device before detecting the first search instruction; When it is determined that the first keyword is the same as the historical keyword and the electronic device has triggered a web search without a network connection during the last search, content matching the first keyword is searched on the web page to obtain web page search results corresponding to the first keyword, and the web page search results include at least one web page association word matching the first keyword.
2. The method according to claim 1, characterized in that In the case where it is determined that the electronic device is currently in a network state, determining whether the first keyword is the same as the historical keyword includes: When it is determined that the electronic device is currently in a network state, determine whether the first keyword is the same as the historical keyword based on the keyword change identifier, wherein the keyword change identifier is used to identify the first change state or the second change state, the first change state is used to identify that the keywords used in the two previous search processes are different, and the second change state is used to identify that the keywords used in the two previous search processes are the same.
3. The method according to claim 1 or 2, characterized in that: When it is determined that the first keyword is the same as the historical keyword, determining whether the electronic device has triggered a webpage search in an offline state during the last search process includes: In the case where it is determined that the first keyword is the same as the historical keyword, determining whether the electronic device has triggered a webpage search in an offline state during the last search process according to a network search identifier, wherein the network search identifier is used to identify a first search state or a second search state, the first search state is used to identify that the electronic device has triggered a webpage search in an offline state, and the second search state is used to identify a search state other than the first search state; And, the method further comprises: When it is determined that the electronic device has triggered a webpage search in an off-network state during the last search process, the search identifier of the network is updated from the first search state to the second search state.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: When it is determined that the first keyword is different from the historical keyword, content matching the first keyword is searched on the web page to obtain web page search results corresponding to the first keyword.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: When it is determined that the first keyword is the same as the historical keyword and the electronic device has not triggered a web search without a network connection during the last search, the web search result corresponding to the historical keyword is used as the web search result corresponding to the first keyword.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When it is determined that the electronic device is in an offline state, a offline interface is displayed to indicate that the electronic device is in an offline state.
7. The method according to any one of claims 1 to 6, before detecting a first search instruction for a first keyword, the method further comprises: In response to detecting a second search instruction for a second keyword, obtaining web page search results corresponding to the second keyword when the electronic device is in a network state, the second keyword being different from the first keyword; In response to detecting a third search instruction for the first keyword, triggering a web page search for the first keyword when the electronic device is in an offline state.
8. The method according to any one of claims 1 to 7, characterized in that The detecting a first search instruction for a first keyword includes: The first search instruction is detected in a first tab page, and the first tab page can display web page search results; and when it is determined that the first keyword is the same as the historical keyword and the electronic device has triggered a web page search in an offline state during the last search process, searching for content matching the first keyword from a web page, and obtaining web page search results corresponding to the first keyword, the method further includes: The web page search results corresponding to the first keyword are displayed.
9. The method according to any one of claims 1 to 8, characterized in that The first search instruction includes any one of the following: An input operation of inputting the first keyword in the search box; Selecting any tab page when the first keyword has been entered in the search box; When the first keyword has been entered in the search box, a selection operation on any sorting option; When the first keyword has been input in the search box, a selection operation is performed on any one of the at least one attribute, the attribute representing the attribute of the file; The network information when the network status changes when the first keyword has been entered in the search box.
10. An electronic device, characterized in that: include: Memory, for storing computer instructions; A processor, configured to call the computer instructions stored in the memory to execute the method according to any one of claims 1 to 9.
11. A computer-readable storage medium, characterized in that: Used to store computer instructions, wherein the computer instructions are used to implement the method according to any one of claims 1 to 9.
12. A chip, characterized in that: The chip comprises: Memory: used to store instructions; A processor is used to call and execute the instructions from the memory so that an electronic device equipped with the chip system executes the method as described in any one of claims 1 to 9.
Citation Information
Patent Citations
Method and system for internet search
CN101539918A
Retrieval recommendation method and device
CN108733694A