Search method, search device, electronic device and storage medium

By sending search requests to the server in real time and pre-rendering resources in the container, the problem of slow search response speed in the prior art is solved, and the search result pages are quickly obtained, which improves the user experience.

CN112084395BActive Publication Date: 2024-11-26BAIDU INT TECH (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011020778.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-25
Publication Date
2024-11-26
Estimated Expiration
2040-09-25

AI Technical Summary

Technical Problem

Among the existing search methods, the search response speed is slow and the user waits for a long time.

Method used

When the user enters a keyword, he sends a search request to the server in real time and pre-renders the resource in the container. When the keyword changes, he submits a new search request in real time and pre-renders the page in another container. When the search instruction is to be searched, he/shes a new search request in real time and pre-renders the page. Quickly output container resources corresponding to the current keyword.

Benefits of technology

It significantly improves search response speed, reduces user waiting time, and improves search experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112084395B_ABST
    Figure CN112084395B_ABST
Patent Text Reader

Abstract

The present application discloses a search method, a search device, an electronic device and a storage medium, and relates to the field of search technology. The method includes: in response to a first keyword input by a user, sending a first search request to a server; in the process of the server returning the resources of the first search result page, pre-rendering the returned resources in a first container; if it is detected that the user changes the current keyword to a second keyword, sending a second search request to the server; in the process of the server returning the resources of the second search result page, pre-rendering the returned resources in a second container; if a search instruction input by the user is detected, in response to the search instruction, outputting the resources in the container corresponding to the current keyword. The present application can improve the response speed of the search.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, in particular to the field of search technology, and specifically to a search method, a search device, an electronic device and a storage medium. Background Art

[0002] At present, when users search on the Internet, they usually enter keywords in the search box and initiate a search command (such as clicking a search button or pressing the Enter key), and then a search request is sent to the server. After receiving the resources of the search result page returned by the server, the client renders the page according to the resources of the search result page returned by the server. In the existing search method, the search response speed is slow. Summary of the invention

[0003] The present application provides a search method, a search device, an electronic device, a storage medium and a computer program product.

[0004] According to a first aspect, the present application provides a search method, comprising:

[0005] In response to a first keyword input by a user, a first search request is sent to a server; in the process of the server returning resources of a first search result page, the returned resources are pre-rendered in a first container; the first search result page is a search result page corresponding to the first keyword;

[0006] If it is detected that the user changes the current keyword to a second keyword, a second search request is sent to the server; in the process of the server returning the resources of the second search result page, the returned resources are pre-rendered in the second container; the second search result page is the search result page corresponding to the second keyword;

[0007] If a search instruction input by the user is detected, the resources in the container corresponding to the current keyword are output in response to the search instruction.

[0008] According to a second aspect, the present application provides a search device, including:

[0009] A first pre-rendering module is used to send a first search request to a server in response to a first keyword input by a user; in the process of the server returning resources of a first search result page, pre-render the returned resources in a first container; the first search result page is a search result page corresponding to the first keyword;

[0010] A second pre-rendering module is used to send a second search request to the server if it is detected that the user changes the current keyword to a second keyword; in the process of the server returning the resources of the second search result page, pre-render the returned resources in the second container; the second search result page is the search result page corresponding to the second keyword;

[0011] The output module is used to output the resources in the container corresponding to the current keyword in response to the search instruction if a search instruction input by the user is detected.

[0012] According to a third aspect, the present application provides an electronic device, including:

[0013] at least one processor; and

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

[0015] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform any method in the first aspect.

[0016] According to a fourth aspect, the present application provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause a computer to execute any one of the methods in the first aspect.

[0017] According to a fifth aspect, the present application provides a computer program product, comprising a computer program, wherein the computer program implements any one of the methods in the first aspect when executed by a processor.

[0018] According to the technology of this application, when a user enters a keyword, a search request for the input keyword is submitted to the server in real time, and the resources returned by the server are pre-rendered in the container; when the input keyword changes, a new search request is submitted to the server in real time, and the page of the resources returned by the server is pre-rendered in another container. In this way, when the user enters a search instruction, the resources in the container corresponding to the current keyword can be quickly output, so that the user can quickly obtain the search result page corresponding to the current keyword. Compared with the prior art, this application can improve the response speed of the search.

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

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0021] Figure 1 is a flowchart of a search method according to the first embodiment of the present application;

[0022] Figure 2 is a schematic diagram of the structure of the client and the server according to the first embodiment of the present application;

[0023] Figure 3 is an example of a search method according to the first embodiment of the present application;

[0024] Figure 4 is a schematic structural diagram of a search device according to a second embodiment of the present application;

[0025] Figure 5 It is a block diagram of an electronic device used to implement the search method of an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0027] First embodiment

[0028] like Figure 1 As shown, the present application embodiment provides a search method, comprising the following steps:

[0029] Step 101: In response to a first keyword input by a user, a first search request is sent to a server; in the process of the server returning resources of a first search result page, the returned resources are pre-rendered in a first container; the first search result page is a search result page corresponding to the first keyword.

[0030] The "keywords" involved in this application, such as the first keyword mentioned above and the target keyword, second keyword, etc. in the following text, can be understood as the content entered by the user in the search box during a search process. When the user enters the search command, the keyword in the current search box becomes the search term, query term or query. Here, a search process can be understood as the entire process from the user starting to enter keywords in the search box to the user entering the search command and displaying the search results page.

[0031] The search method of the embodiment of the present application can be implemented through a client with a search function, such as a mobile phone, a tablet, a personal computer (Personal Computer, PC for short), etc.

[0032] In the prior art, after a user inputs a search instruction, such as clicking a search button or pressing the Enter key, the client will initiate a search request to the server. Different from the prior art, in the embodiments of the present application, when the user inputs a keyword, the client can immediately send a search request to the server.

[0033] Generally, during a search process, the process of a user inputting keywords is a dynamic process, and moreover, the processes of different users inputting keywords vary from person to person. During a search process, a user may input keywords multiple times, that is, input a search instruction after inputting keywords multiple times; or may input keywords once, that is, input a search instruction after inputting keywords once. For example, if a user wants to search for "Li Bai's homesickness poems", the user can successively input "Li Bai's", "homesickness", "poems" in the search box, or the user can successively input "Li Bai", "of", "homesickness", "poems" in the search box, or the user can also input "Li Bai's homesickness poems" in the search box, and so on.

[0034] The first keyword input by the user can be understood as the first keyword input by the user, or rather, the keyword input by the user for the first time. That is to say, when it is detected that the user has input the first keyword, the client can start to initiate a search request to the server. For example, if the user inputs "Li Bai's", then "Li Bai's" can be used as the first keyword.

[0035] The first keyword input by the user can also be understood as the first keyword with a clear meaning input by the user. This keyword may be the keyword input for the first time or may be the keyword input multiple times. For example, if the user successively inputs "Li", "Bai", "of",..., the client can start to initiate a search request to the server when the keyword "Li" is input, or can also start to initiate a search request to the server when the keyword "Li Bai" is input. That is to say, the first keyword can be either the keyword "Li" input for the first time or the first keyword with a clear meaning "Li Bai".

[0036] Of course, the first keyword input by the user can also be understood as a keyword with other meanings, and no more description will be made here.

[0037] In the embodiments of the present application, the way for the user to input keywords can be either voice input or text input.

[0038] In this step, the client may send a first search request to the server in response to the first keyword input by the user. After receiving the first search request sent by the client, the server may return the resources of the corresponding search result page, that is, the resources of the first search result page, to the client. The client may receive the resources of the first search result page returned by the server. In the process of the server returning the resources of the first search result page, the returned resources may be pre-rendered in the first container, and the pre-rendered resources are loaded into the first container. The first container may be a container pre-created by the client, which can be used to store the pre-rendered resources.

[0039] It can be seen that through the above process, the client obtains the resources of the search result page from the server in advance, and stores the resources of the search result page locally through pre-rendering.

[0040] It should be noted that the container involved in the embodiment of the present application can be understood as a pre-rendering container. The container involved in the embodiment of the present application can be a container for loading web pages, a container for loading mini-programs, or a container for loading structured data.

[0041] Step 102: If it is detected that the user changes the current keyword to a second keyword, a second search request is sent to the server; in the process of the server returning the resources of the second search result page, the returned resources are pre-rendered in a second container; the second search result page is the search result page corresponding to the second keyword.

[0042] As mentioned above, during a search, the process of users inputting keywords is usually a dynamic process. Therefore, after entering the first keyword, the user may change the keyword. There are many ways to change the keyword, which can be to add new content based on the current keyword, or to modify part of the content of the current keyword, or to replace the current keyword with a new keyword, and so on.

[0043] For example, if the user enters the keyword "Li Bai's", the current keyword is "Li Bai's". If the user enters the keyword "homesickness", the user changes the current keyword "Li Bai's" to the second keyword "Li Bai's homesickness". For another example, if the user enters the keyword "Li Bai's", the current keyword is "Li Bai's". If the user changes the keyword "Li Bai's" to "Du Fu's", the second keyword is "Du Fu's". For another example, if the user enters the keyword "Li Bai", the current keyword is "Li Bai". If the user changes the "Bai" in the keyword "Li Bai" to "Bai", the second keyword is "Li Bai".

[0044] In this step, no matter which keyword input method the user adopts, during a search process, each time the user enters a new keyword, the client can initiate a new search request (i.e., the second search request) to the server in real time for the current keyword (i.e., the second keyword). For example, if the user enters "Li Bai's", "homesickness", and "poem" in sequence, when the user enters "Li Bai's", the client initiates a search request for "Li Bai's" to the server, and when the user enters "homesickness" again, the client initiates a search request for "Li Bai's homesickness" to the server, and when the user enters "poem" again, the client initiates a search request for "Li Bai's homesickness poems" to the server.

[0045] In this step, the client can receive the resources of the new search result page (i.e., the second search result page) returned by the server. In the process of the server returning the resources of the second search result page, the returned resources can be pre-rendered in the second container, and the pre-rendered resources are loaded into the second container. The second container can be a container pre-created by the client, which can be used to store the pre-rendered resources.

[0046] It can be seen that through the above process, during the keyword input process, the client can dynamically and real-time obtain resources of different search result pages from the server in advance, and store the resources of different search result pages in different containers locally through pre-rendering.

[0047] It should be noted that the second keyword is not limited to the keyword input by the user for the nth time. It can be the keyword input for the second time, or the third time or even more times. Each changed keyword can be understood as the second keyword.

[0048] In order to more clearly understand the dynamic and real-time search method involved in the keyword input process, the following is an example in which a user enters "Li Bai's", "homesickness", and "poem" in the search box in sequence.

[0049] The user enters "Li Bai's" in the search box, and the client initiates a search request for "Li Bai's" to the server. The server returns the resources of search result page A1 to the client. The client receives the resources of search result page A1 returned by the server, and pre-renders the resources of search result page A1 in container a1. The pre-rendered resource B1 is loaded into container a1. The user continues to enter "homesickness" in the search box, and the client initiates a search request for "Li Bai's homesickness" to the server. The server returns the resources of search result page A2 to the client. The client receives the resources of search result page A2 returned by the server, and pre-renders the resources of search result page A2 in container a2. The pre-rendered resource B2 is loaded into container a2. The user continues to enter "poetry" in the search box, and the client initiates a search request for "Li Bai's homesickness poems" to the server. The server returns the resources of search result page A3 to the client. The client receives the resources of search result page A3 returned by the server, and pre-renders the resources of search result page A3 in container a3. The pre-rendered resource B3 is loaded into container a3.

[0050] Through the above process, the client dynamically and in real time obtains the resources of the search result page corresponding to the current keyword, and pre-renders the resources of the search result page in different containers, so that the pre-rendered resources can be loaded in different containers, thereby realizing that the client pre-uploads the resources of the search result page from the server to the local.

[0051] Step 103: If a search instruction input by the user is detected, in response to the search instruction, the resources in the container corresponding to the current keyword are output.

[0052] In this step, when the search instruction input by the user is detected, since the resources of the search result page corresponding to the current keyword have been pre-loaded in the corresponding container, the client only needs to output the resources in the container corresponding to the current keyword.

[0053] Here, the specific process of outputting the resources in the container may be as follows: when a search instruction input by the user is detected, the container switches from the background to the foreground, and forms a page with the pre-rendered resources in the container and displays it to the user.

[0054] In order to implement the above search process, Figure 2As shown, an input processing module, a logic and parameter processing module and a pre-rendering container management module can be set in the client, and a search service module can be set in the server. Among them, the input processing module can be used to monitor the content input by the user and pass the content input by the user to the logic and parameter processing module; the pre-rendering container management module can be used to create, release or reuse pre-rendering containers; the logic and parameter processing module can be used to achieve: (1) assembling search request parameters according to the keywords input by the user; (2) calling the pre-rendering container management module to load the resources of the corresponding search result page; (3) when the user determines the search behavior, the resources in the container corresponding to the current keyword are output. The search service module can be used to provide search-related service capabilities.

[0055] In the embodiment of the present application, when the user inputs a keyword, a search request for the input keyword is submitted to the server in real time, and the resources returned by the server are pre-rendered in the container; when the input keyword changes, a new search request is submitted to the server in real time, and the page of the resources returned by the server is pre-rendered in another container. In this way, when the user inputs a search instruction, the resources in the container corresponding to the current keyword can be quickly output, so that the user can quickly obtain the search result page corresponding to the current keyword. Compared with the prior art, the present application can improve the response speed of the search and reduce the waiting time of the user.

[0056] For the search results page, the size of the page resources is usually in MB level, and the number of resources usually reaches hundreds. In order to save the consumption of network resources and further reduce the time and resources consumed by the container in resource pre-rendering, based on the above search method, the embodiment of the present application also provides the following multi-resource reuse strategy.

[0057] Optionally, the method further includes:

[0058] In the process of the server returning the resource of the second search result page, if the first resource of the second search result page is the same as the second resource of the first search result page, the second resource in the first container is reused in the second container.

[0059] This implementation method involves a multi-resource reuse strategy. Specifically, if the second search result page contains the same resources as the first search result page, the client can reuse the same resources locally without making repeated network requests. In this way, on the one hand, for the same resource, the client does not need to send network requests for the resource to the server multiple times, and the server does not need to return resources multiple times for the network requests for the same resource, which can save network resource consumption. On the other hand, the same resource does not need to be pre-rendered multiple times in different containers, thereby reducing the time and resources consumed by the container on resource pre-rendering. Therefore, by adopting a multi-resource reuse strategy, the embodiment of the present application can further improve the search response speed while reducing overall resource consumption, thereby further improving the user's search experience.

[0060] In order to implement the multi-resource reuse strategy, Figure 2 As shown, a network sharing management module can also be set in the client, which can uniformly manage and reuse all resource requests in the search process. In this implementation, whether different resources are the same can be determined based on the request parameters of different resources, such as url, header, body, etc.

[0061] The multiple resource reuse strategy can be applied to resources that have been obtained from the server (i.e., resource reuse) or to resources that are being obtained from the server but have not yet been obtained (i.e., resource request reuse). For resources that have been obtained from the server, if the resources in the first container can be reused in the second container, the resources in the first container can be directly reused in the second container. For the reuse of resource requests, the following implementation methods can be adopted.

[0062] Optionally, the reusing the second resource in the first container into the second container includes:

[0063] If the second resource is in a resource request state, establishing an association between the resource request of the second resource and the second container;

[0064] When the second resource is loaded into the first container, the second resource is reused in the second container.

[0065] In this implementation, if the second resource in the first container is being requested and is also dependent on by the second container, then the second container's request for the resource can reuse the resource request currently in progress in the first container, and establish a connection between the second container and the resource request. After the resource request is completed, the associated second container is notified, and the resource is reused in the second container. Specifically, when the resource request is completed, the relevant data can be cached, including control parameters such as the cache duration and HTTP Header, and the relevant data and the corresponding control parameters returned by the server are directly returned to the dependent container.

[0066] By adopting the above-mentioned multi-resource reuse strategy, both resource reuse and resource request reuse are achieved, which can minimize the overall resource consumption and maximize the search response speed.

[0067] Since the number of pre-created containers is usually limited, the embodiment of the present application also provides the following container reuse strategy.

[0068] Optionally, in the process of returning the resources of the second search result page by the server, pre-rendering the returned resources in the second container includes:

[0069] If all pre-created containers are occupied, a second container is selected from the pre-created containers for reuse, and in the process of the server returning resources of the second search result page, the returned resources are pre-rendered in the second container.

[0070] In this implementation, if all pre-created containers are occupied, a container can be selected from the occupied containers for reuse to ensure that the pre-created containers can be better utilized during the search process. With the reuse of containers, the resources previously loaded by the containers can be destroyed or released.

[0071] The reuse of containers can be achieved by using algorithms such as first-in-first-out or least recently used. Assume that containers a1, a2 and a3 are pre-created in the client, container a1 is occupied first, container a2 is occupied later, and container a3 is occupied last. If a new keyword search request is generated, all containers are already occupied at this time, and container a1 can be reused for the current keyword search request.

[0072] Optionally, the method further includes:

[0073] When the second container is reused or released, if there is an ongoing resource request for the second container, the resource request is disassociated from the second container.

[0074] In this implementation, when a container is reused or released, the container is only disassociated from the resource request originally generated by the container, and is not destroyed or released with the reuse or release of the container. Therefore, the resource request originally generated by the container can continue to be reused by the required container. This implementation implements separate management of resource requests and improves the reusability of resource requests, thereby minimizing overall resource consumption and maximizing search response speed.

[0075] It should be noted that container reuse and resource reuse have different meanings. Container reuse is the reuse of occupied containers, which represents the destruction and reuse of containers; while resource reuse is the loading of the same resources into different containers, which represents the multiple uses of resources.

[0076] Optionally, if there is an ongoing resource request for the second container, disassociating the resource request from the second container includes:

[0077] If there is an ongoing resource request for the second container, and the ongoing resource request is reused or can be reused for a third container, then the resource request is disassociated from the second container.

[0078] In this implementation, if a resource request is relied upon by multiple containers or can be relied upon by multiple containers, when a container is reused or released, only the association between the resource request and the container is resolved, so that other containers can continue to reuse the resource request, thereby minimizing overall resource consumption and maximizing search response speed.

[0079] In order to better understand the overall technical solution, the following Figure 3 The examples shown are for illustration purposes only.

[0080] like Figure 3 As shown, the user enters "Li Bai's", "homesickness", and "poem" in the search box in sequence, which correspond to the keywords "Li Bai's", "Li Bai's homesickness", and "Li Bai's homesickness poem" respectively.

[0081] The resources on the search result page corresponding to "Li Bai's" include: resource x1, resource y1, resource i, resource j, resource q; the resources on the search result page corresponding to "Li Bai's homesickness" include: resource x2, resource y2, resource i, resource j, resource q; the resources on the search result page corresponding to "Li Bai's homesickness poems" include: resource x3, resource y2, resource i, resource j, resource q.

[0082] Then, the resources of the search result page corresponding to "Li Bai's" can be pre-rendered in container a1: resource x1, resource y1, resource i, resource j, resource q; resource i, resource j, resource q in container a1 can be reused in container a2, and resource y2 can be pre-rendered in container a2; resource i, resource j, resource q in container a1 can be reused in container a3, and resource y2 in container a2 can be reused.

[0083] Furthermore, when reusing resources i, j, and q in container a1 in container a2, if resource i in container a1 has been obtained from the server, container a2 can directly reuse resource i in container a1; if resource j and resource q in container a1 have not been obtained from the server, an association can be established between the resource requests of resource j and resource q and container a2; after resource j and resource q are obtained from the server, resource j and resource q can be reused in container a2.

[0084] Correspondingly, when reusing resources i, j, and q in container a1 in container a3, if resources i and j in container a1 have been obtained from the server, container a3 can directly reuse resources i and j in container a1; if resource q in container a1 has not been obtained from the server, an association can be established between the resource request of resource q and container a3; after resource q is obtained from the server, resource q can be reused in container a3.

[0085] When reusing resource y2 in container a2 in container a3, if resource y2 in container a2 has been obtained from the server, container a3 can directly reuse resource y2 in container a2; if resource y2 in container a2 has not been obtained from the server, an association can be established between the resource request of resource y2 and container a3, and after resource y2 is obtained from the server, resource y2 can be reused in container a3.

[0086] When the user enters a search command, the client can output the resources in container a3, thereby quickly displaying the search result page of "Li Bai's Homesickness Poems" to the user.

[0087] It should be noted that the various optional implementations of the search method in the present application can be implemented in combination with each other or can be implemented separately, and the present application does not limit this.

[0088] The above embodiments of the present application have at least the following advantages or beneficial effects:

[0089] In this application, when a user enters a keyword, a search request for the input keyword is submitted to the server in real time, and the resources returned by the server are pre-rendered in the container; when the input keyword changes, a new search request is submitted to the server in real time, and the page of the resources returned by the server is pre-rendered in another container. In this way, when the user enters a search instruction, the resources in the container corresponding to the current keyword can be quickly output, so that the user can quickly obtain the search result page corresponding to the current keyword. Compared with the prior art, this application can improve the response speed of the search.

[0090] Second embodiment

[0091] like Figure 4 As shown, the present application provides a search device 200, comprising:

[0092] A first pre-rendering module 201 is used to send a first search request to a server in response to a first keyword input by a user; in the process of the server returning resources of a first search result page, pre-render the returned resources in a first container; the first search result page is a search result page corresponding to the first keyword;

[0093] The second pre-rendering module 202 is used to send a second search request to the server if it is detected that the user changes the current keyword to a second keyword; in the process of the server returning the resources of the second search result page, pre-render the returned resources in the second container; the second search result page is the search result page corresponding to the second keyword;

[0094] The output module 203 is configured to output the resources in the container corresponding to the current keyword in response to a search instruction input by the user if the search instruction is detected.

[0095] Optionally, the search device 200 further includes:

[0096] The resource reuse module is used to reuse the second resource in the first container into the second container if the first resource of the second search result page is the same as the second resource of the first search result page during the process of the server returning the resource of the second search result page.

[0097] Optionally, the resource reuse module includes:

[0098] an association submodule, configured to establish an association between the resource request of the second resource and the second container if the second resource is in a resource request state;

[0099] The multiplexing submodule is used to reuse the second resource in the second container when the second resource is loaded in the first container.

[0100] Optionally, the second pre-rendering module 202 is specifically configured to:

[0101] If all pre-created containers are occupied, a second container is selected from the pre-created containers for reuse, and in the process of the server returning resources of the second search result page, the returned resources are pre-rendered in the second container.

[0102] Optionally, the search device 200 further includes:

[0103] The disassociating module is configured to disassociate the resource request from the second container if there is an ongoing resource request for the second container when the second container is reused or released.

[0104] Optionally, the disassociation module is specifically used for:

[0105] If there is an ongoing resource request for the second container, and the ongoing resource request is reused or can be reused for a third container, then the resource request is disassociated from the second container.

[0106] Optionally, the container includes at least one of the following:

[0107] A container for loading web pages;

[0108] A container for loading applets;

[0109] A container for loading structured data.

[0110] The search device 200 provided in the present application can implement each process in the above-mentioned search method embodiment and can achieve the same beneficial effects. To avoid repetition, it will not be described again here.

[0111] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0112] like Figure 5 , is a block diagram of an electronic device according to a search method according to an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0113] like Figure 5 As shown, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 601 is taken as an example.

[0114] The memory 602 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable at least one processor to perform the search method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the search method provided in the present application.

[0115] The memory 602 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the search method in the embodiment of the present application (for example, the attached Figure 4 The processor 601 executes various functional applications and data processing of the search device by running the non-transient software programs, instructions and modules stored in the memory 602, that is, implements the search method in the above method embodiment.

[0116] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device of the search method, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the electronic device of the search method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0117] The electronic device of the search method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0118] The input device 603 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the search method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 604 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0119] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0120] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

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

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

[0123] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0124] According to the technical solution of the embodiment of the present application, when the user inputs a keyword, a search request for the input keyword is submitted to the server in real time, and the resources returned by the server are pre-rendered in the container; when the input keyword changes, a new search request is submitted to the server in real time, and the page of the resources returned by the server is pre-rendered in another container. In this way, when the user inputs a search instruction, the resources in the container corresponding to the current keyword can be quickly output, so that the user can quickly obtain the search result page corresponding to the current keyword. Compared with the prior art, the present application can improve the response speed of the search.

[0125] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0126] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A search method, comprising: In response to a first keyword input by a user, sending a first search request to a server; In the process of the server returning the resources of the first search result page, pre-rendering the returned resources in the first container; the first search result page is the search result page corresponding to the first keyword; If it is detected that the user changes the current keyword to a second keyword, a second search request is sent to the server; in the process of the server returning the resources of the second search result page, the returned resources are pre-rendered in the second container; the second search result page is the search result page corresponding to the second keyword; If a search instruction input by the user is detected, in response to the search instruction, the resources in the container corresponding to the current keyword are output; The output of resources in the container corresponding to the current keyword includes: when a search instruction input by the user is detected, the container is switched from the background to the foreground, and a page composed of pre-rendered resources in the container is presented to the user; In the process of returning the resource of the second search result page by the server, if the first resource of the second search result page is the same as the second resource of the first search result page, reusing the second resource in the first container in the second container; The reusing the second resource in the first container into the second container includes: If the second resource is in a resource request state, establishing an association between the resource request of the second resource and the second container; When the second resource is loaded into the first container, the second resource is reused in the second container.

2. The method according to claim 1, wherein: In the process of returning the resources of the second search result page by the server, pre-rendering the returned resources in the second container includes: If all pre-created containers are occupied, a second container is selected from the pre-created containers for reuse, and in the process of the server returning resources of the second search result page, the returned resources are pre-rendered in the second container.

3. The method according to claim 2, further comprising: When the second container is reused or released, if there is an ongoing resource request for the second container, the resource request is disassociated from the second container.

4. The method according to claim 3, wherein: If the second container has an ongoing resource request, disassociating the resource request from the second container includes: If there is an ongoing resource request for the second container, and the ongoing resource request is reused or can be reused for a third container, then the resource request is disassociated from the second container.

5. The method according to claim 1, wherein: The container comprises at least one of the following: A container for loading web pages; A container for loading applets; A container for loading structured data.

6. A search device, comprising: A first pre-rendering module, configured to send a first search request to a server in response to a first keyword input by a user; In the process of the server returning the resources of the first search result page, pre-rendering the returned resources in the first container; the first search result page is the search result page corresponding to the first keyword; A second pre-rendering module is used to send a second search request to the server if it is detected that the user changes the current keyword to a second keyword; in the process of the server returning the resources of the second search result page, pre-render the returned resources in the second container; the second search result page is the search result page corresponding to the second keyword; an output module, configured to output the resources in the container corresponding to the current keyword in response to a search instruction input by a user if a search instruction input by a user is detected; The output of resources in the container corresponding to the current keyword includes: when a search instruction input by the user is detected, the container is switched from the background to the foreground, and a page composed of pre-rendered resources in the container is presented to the user; a resource reuse module, configured to reuse the second resource in the first container into the second container if the first resource of the second search result page is the same as the second resource of the first search result page during the process of the server returning the resource of the second search result page; Wherein, the resource reuse module includes: an association submodule, configured to establish an association between the resource request of the second resource and the second container if the second resource is in a resource request state; The resource reuse submodule is used to reuse the second resource in the second container when the second resource is loaded in the first container.

7. The device according to claim 6, wherein: The second pre-rendering module is specifically used for: If all pre-created containers are occupied, a second container is selected from the pre-created containers for reuse, and in the process of the server returning resources of the second search result page, the returned resources are pre-rendered in the second container.

8. The apparatus according to claim 7, further comprising: The disassociating module is configured to disassociate the resource request from the second container if there is an ongoing resource request for the second container when the second container is reused or released.

9. The device according to claim 8, wherein the disassociation module is specifically configured to: If there is an ongoing resource request for the second container, and the ongoing resource request is reused or can be reused for a third container, then the resource request is disassociated from the second container.

10. The device according to claim 6, wherein: The container comprises at least one of the following: A container for loading web pages; A container for loading applets; A container for loading structured data.

11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the method of any one of claims 1 to 5.

13. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 5.